Jump to content
  • Advertisement
Sign in to follow this  
Laccolith

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.

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
Advertisement
simply project those lights to screen and sort them into the tiles. (be careful with w<0 when projecting lights).

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!