I'm so stumped on Clustered Forward Rendering. I believe there's something wrong with the cluster generation which is causing the light culling to be wonky.
The video I attached shows me moving towards a point light, which is to the left of where the camera spawns. Red equals zero lights, and green means one light. The lighter the color, the farther depth slice in the cluster frustum that fragment is using. It also appears to have a sort of "shadow acne" on the green as it moves closer, maybe thats due to depth inaccuracies though and doesn't really matter. Here's the light culling shader: https://pastebin.com/X76Qhft4
I also attached a picture of the froxel visualization looking from the top down, which shows a weird shape and what I think is a tiny gap between the clusters. Here's the shader code that generates the clusters: https://pastebin.com/u3UKpAXs
I'm not sure what is wrong, any help will be appreciated! I asked in the Graphics Programming discord (in the "questions-forum" channel), but nobody responded to me.
#rust #vulkan #gamedev #ScreenshotSaturday #customengine #rendering