Files
Cortex_Engine/imgui.ini
T
emil28092005 2f7430e3b1 fix: flip normals when facing away from light/view — fixes cube lighting
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.
2026-06-18 21:53:15 +03:00

31 lines
359 B
INI

[Window][Debug##Default]
Pos=60,60
Size=400,400
Collapsed=0
[Window][Debug]
Pos=10,10
Size=216,107
Collapsed=0
[Window][Hierarchy]
Pos=353,299
Size=250,398
Collapsed=0
[Window][Inspector]
Pos=112,297
Size=300,425
Collapsed=0
[Window][Cortex Engine Debug]
Pos=1,1
Size=226,196
Collapsed=0
[Window][Shadow Parameters]
Pos=772,456
Size=507,263
Collapsed=0