summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-12-06 14:30:10 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-12-06 14:30:49 -0300
commite8494f7ab710501790dcfdb2e86683fc3b9c5a15 (patch)
treed29f25cf458b5059eff0b7b695df17afc3f1273e /drivers/gles3/shaders
parenta8ae46e1431a25ced8565db39e44e068b8815c21 (diff)
Fixed rim lighting glitch, closes #13340, closes #13986
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r--drivers/gles3/shaders/scene.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 79b989be4a..676541649c 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1030,7 +1030,7 @@ LIGHT_SHADER_CODE
#if defined(LIGHT_USE_RIM)
- float rim_light = pow(1.0-cNdotV, (1.0-roughness)*16.0);
+ float rim_light = pow(max(0.0,1.0-cNdotV), max(0.0,(1.0-roughness)*16.0));
diffuse_light += rim_light * rim * mix(vec3(1.0),diffuse_color,rim_tint) * light_color;
#endif
}