2f7430e3b1845f86ddddd88beca318c6090e1080
Root cause: cube.obj has inconsistent winding order. Many faces have normals pointing inward (e.g. back face normal = +Z instead of -Z). With cullMode=None, both sides render, but inward normals cause: - No diffuse lighting (NdotL < 0 → max() = 0) - Wrong shadow bias (slope-dependent bias uses wrong NdotL) - Inconsistent shadow edges on cube faces Fix: in fragment shader, flip normal if dot(N,L) < 0 or dot(N,V) < 0 This is the standard approach for double-sided rendering with non-watertight geometry or inconsistent winding order.
Description
AI powered Game Engine
23 MiB
Languages
C#
97.8%
GLSL
1.8%
Shell
0.2%
PowerShell
0.2%