Przeglądaj źródła

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.
Enzo Nocera 7 lat temu
rodzic
commit
6c25eabbc5
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      drivers/gles3/shaders/scene.glsl

+ 1 - 1
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;
 
 	}