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

@ -478,8 +478,8 @@ void main() {
#endif
#ifdef _Clusters
// compute linear depth for clustering directly from the reconstructed view-space pos:
float viewz = length(viewPos);
// compute depth for clustering: use the view-space Z component (linearized depth)
float viewz = viewPos.z;
int clusterI = getClusterI(texCoord, viewz, cameraPlane);
int numLights = int(texelFetch(clustersData, ivec2(clusterI, 0), 0).r * 255);