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.
14 KiB
14 KiB