Sign in to follow this  

Culling Lights to Screen Tiles

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Laccolith
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?


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.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this