diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-23 21:25:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 21:25:09 +0100 |
commit | cfc7c78732198a7ebc43b92ed24e7025fdf4bc11 (patch) | |
tree | 384ec6810f91b44fd3b9e1d83fcf554f2c155680 | |
parent | 565823c562724d9f5c304b183e266a623141294f (diff) | |
parent | 3ce5cceef9c738616f725b0343491bba49dbe8a0 (diff) |
Merge pull request #58474 from darrylryan/master
-rw-r--r-- | servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl index cf2e835b04..1c9b08b6d3 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl @@ -79,7 +79,7 @@ void light_compute(vec3 N, vec3 L, vec3 V, float A, vec3 light_color, float atte float NdotL = min(A + dot(N, L), 1.0); float cNdotL = max(NdotL, 0.0); // clamped NdotL float NdotV = dot(N, V); - float cNdotV = max(NdotV, 0.0); + float cNdotV = max(NdotV, 1e-4); #if defined(DIFFUSE_BURLEY) || defined(SPECULAR_SCHLICK_GGX) || defined(LIGHT_CLEARCOAT_USED) vec3 H = normalize(V + L); @@ -210,7 +210,7 @@ void light_compute(vec3 N, vec3 L, vec3 V, float A, vec3 light_color, float atte // Clearcoat ignores normal_map, use vertex normal instead float ccNdotL = max(min(A + dot(vertex_normal, L), 1.0), 0.0); float ccNdotH = clamp(A + dot(vertex_normal, H), 0.0, 1.0); - float ccNdotV = max(dot(vertex_normal, V), 0.0); + float ccNdotV = max(dot(vertex_normal, V), 1e-4); #if !defined(SPECULAR_SCHLICK_GGX) float cLdotH5 = SchlickFresnel(cLdotH); |