mirror of
https://github.com/godotengine/godot.git
synced 2025-01-30 21:33:18 +08:00
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:
parent
abf20709af
commit
6c25eabbc5
@ -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;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user