From 3c3a5759b8e9e9d0e6a9163b7157d14c2fbe670d Mon Sep 17 00:00:00 2001 From: Sally Knight Date: Fri, 3 Apr 2026 04:07:48 +0300 Subject: [PATCH] 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 --- targets/platform/shaders/vertex.vert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/platform/shaders/vertex.vert b/targets/platform/shaders/vertex.vert index e57cddf78..aa4978dd7 100644 --- a/targets/platform/shaders/vertex.vert +++ b/targets/platform/shaders/vertex.vert @@ -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; }