 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(1,0))*vInvShadowMapWH, Values0.y );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(2,0))*vInvShadowMapWH, Values0.z );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(3,0))*vInvShadowMapWH, Values0.w );
-	Values0 = step4(Values0, vec4(litZ, litZ, litZ, litZ));
+	Values0 = step4(Values0 + bias, vec4(litZ, litZ, litZ, litZ));
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(0,1))*vInvShadowMapWH, Values1.x );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(1,1))*vInvShadowMapWH, Values1.y );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(2,1))*vInvShadowMapWH, Values1.z );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(3,1))*vInvShadowMapWH, Values1.w );
-	Values1 = step4(Values1, vec4(litZ, litZ, litZ, litZ));
+	Values1 = step4(Values1 + bias, vec4(litZ, litZ, litZ, litZ));
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(0,2))*vInvShadowMapWH, Values2.x );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(1,2))*vInvShadowMapWH, Values2.y );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(2,2))*vInvShadowMapWH, Values2.z );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(3,2))*vInvShadowMapWH, Values2.w );
-	Values2 = step4(Values2, vec4(litZ, litZ, litZ, litZ));
+	Values2 = step4(Values2 + bias, vec4(litZ, litZ, litZ, litZ));
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(0,3))*vInvShadowMapWH, Values3.x );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(1,3))*vInvShadowMapWH, Values3.y );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(2,3))*vInvShadowMapWH, Values3.z );
 	SampleShadowMap(shadowIndex, (Sample00TexelCenter+vec2(3,3))*vInvShadowMapWH, Values3.w );
-	Values3 = step4(Values3, vec4(litZ, litZ, litZ, litZ));
+	
+	Values3 = step4(Values3 + bias, vec4(litZ, litZ, litZ, litZ));
 
 	vec2 VerticalLerp00 = mix(vec2(Values0.x, Values1.x), vec2(Values0.y, Values1.y), Fraction.xx);
 	float PCFResult00 = mix(VerticalLerp00.x, VerticalLerp00.y, Fraction.y);

	vec3 prefilteredColor = dualParobolidSampleLOD(prefilterMap, reflectionVector,Roughness *MAX_REFLECTION_LOD).rgb;
	irradiance = pow(irradiance, vec3(2.2));
	prefilteredColor = pow(prefilteredColor, vec3(2.2));
	vec3 ambientDiffuse = kD * irradiance * albedo;
	vec3 ambientSpecular =  EnvBRDFApprox(F0, Roughness, NoV) * prefilteredColor;
	vec3 ambient = (ambientDiffuse + ambientSpecular);
	return (kD * albedo / PI + specular) * radiance * NdotL * shadowFactor + ambient;
}
void main() 
{

	// cook-torrance brdf
	float NDF = DistributionGGX(N, H, Roughness);
	
	//float G   = GeometrySmith(N, V, L, Roughness); 
	float G   = Vis_Schlick(Roughness, NoV, dot(N, L));     
	vec3 F    = fresnelSchlick(max(dot(H, V), 0.0), F0);       

	vec3 diffuseColor = albedo - albedo * metallic;
	vec3 specular     = vec3(NDF)* G * F;
	// add to outgoing radiance Lo
	float NdotL = max(dot(N, L), 0.0);

