fixed dynamic lights incorrectly affecting back faces in the GRP

This commit is contained in:
myT 2024-07-02 04:26:52 +02:00
parent 26ddd7e6cc
commit eee321a641

View file

@ -117,7 +117,7 @@ float4 ps(VOut input) : SV_Target
float spec = pow(specFactor, 16.0) * 0.25;
// Lambertian diffuse reflection term (N.L)
float diffuse = min(abs(dot(nN, nL)), 1.0);
float diffuse = max(dot(nN, nL), 0);
float3 color = (base.rgb * diffuse.rrr + spec.rrr) * intens * intensity;
float alpha = lerp(opaque, 1.0, base.a);
float4 final = float4(color.rgb * alpha, alpha);