Light fixes to correct light culling. Now lights show up properly!

This commit is contained in:
TriVoxel
2025-05-05 14:27:24 -06:00
parent 5b5de92890
commit e569352f0b
3 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,8 @@ void main() {
// gl_Position = vec4((gl_VertexID % 2) * 4.0 - 1.0, (gl_VertexID / 2) * 4.0 - 1.0, 0.0, 1.0);
// For reverse-Z, the “far” plane lives at NDC z = 0
vec4 v = vec4(pos.x, pos.y, 0.0, 1.0);
vec4 ndcFar = vec4(pos.x, pos.y, 0.0, 1.0);
vec4 v = invVP * ndcFar;
v = vec4(invVP * v);
v.xyz /= v.w;
viewRay = v.xyz - eye;