summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnzo Nocera <32960642+AlmightyScientist@users.noreply.github.com>2017-12-18 09:12:11 +0100
committerEnzo Nocera <32960642+AlmightyScientist@users.noreply.github.com>2017-12-18 09:15:28 +0100
commit6c25eabbc5b80c55dea5e3b848cb770c501c0680 (patch)
treee223d5f779aa414b446708b5c60a584eaae6af4f
parentabf20709aff09495ef0fb0effcf488c0457c198c (diff)
Shader Language: Fix Vertex Lighting artifacts.
- When using Direction Lighting along with Vertex Lighting, putting a SpatialMaterial Roughness to 1.0 causes artifacts to appear. (#14552) Fixes #14552.
-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 9bc2bc079d..f71a2690f6 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -174,7 +174,7 @@ void light_compute(vec3 N, vec3 L,vec3 V, vec3 light_color, float roughness, ino
vec3 H = normalize(V + L);
float dotNH = max(dot(N,H), 0.0 );
- float intensity = pow( dotNH, (1.0-roughness) * 256.0);
+ float intensity = (roughness >= 1.0 ? 1.0 : pow( dotNH, (1.0-roughness) * 256.0));
specular += light_color * intensity;
}