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.
This commit is contained in:
Enzo Nocera 2017-12-18 09:12:11 +01:00
parent abf20709af
commit 6c25eabbc5

View file

@ -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;
}