mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-06-08 03:23:01 +00:00
fix(render): clamp combined diffuse lighting to prevent overlighting
SPECIFICALLY on the top face where both lights add up to >1, causing the issue in the first place
This commit is contained in:
parent
0d1af91386
commit
3c3a5759b8
|
|
@ -46,7 +46,7 @@ void main() {
|
|||
|
||||
float d0 = max(dot(n, uLight0Dir), 0.0);
|
||||
float d1 = max(dot(n, uLight1Dir), 0.0);
|
||||
vColor = vec4(col.rgb * (uLightAmbient + uLightDiffuse * (d0 + d1)), col.a);
|
||||
vColor = vec4(col.rgb * (uLightAmbient + uLightDiffuse * clamp(d0 + d1, 0.0, 1.0)), col.a);
|
||||
} else {
|
||||
vColor = col;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue