# Culling Lights to Screen Tiles

This topic is 3005 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm working on a Deferred Renderer where the lighting is calculated in a compute shader pretty much like Dice explains here. So far its working very nice but I'm not yet culling the lights. It's currently sitting at 80 fps for 100 lights and can get to 280~ before it drops below 30 fps at 720p. I'm now going to try to cull the lights to the tiles and to do this I believe I need to create a frustum that defines the area that the tile occupies using the min and max depth of the tile. But I have no idea how to create the frustum planes to do this. Also, I'm currently storing depth from "z/w", do I need to switch to storing it as linear z for the creation of the frustum? Thanks in advance

##### Share on other sites
simply project those lights to screen and sort them into the tiles. (be careful with w<0 when projecting lights).

##### Share on other sites
I'm still struggling to understand what it is I need to do.

So I multiply the lights with the ViewProjection Matrix? What do I do with the lights radius to get that to projection space too?

Even then I don't see how I can use the min and max depth of the tile to cull the light, so that lights floating in space not in range of any surfaces correctly get culled.

Do I treat the tiles like an AABB, find the closest point and compare the distance?

##### Share on other sites
Quote:
 Original post by LaccolithAlso, I'm currently storing depth from "z/w", do I need to switch to storing it as linear z for the creation of the frustum?

You can reconstruct your view-space z value from post-projection z/w with a few parameters from your projection matrix. Just reverse the equations here, and you can ignore the "1<<N" stuff.

1. 1
2. 2
Rutin
22
3. 3
4. 4
JoeJ
16
5. 5

• 14
• 29
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631775
• Total Posts
3002284
×