Naive Question: Why not do light culling in world space?

Started by
12 comments, last by CDProp 10 years, 2 months ago

Well you can (very easily) use forward rendering and still do culling for screen-space tiles. This is exactly what "Forward+" does, and what I did in my Light Indexed Deferred demo. You just use a compute shader to do the culling, and output a list of indices per tile. Then in your forward pass you figure out what tile a pixel is in, and loop over the light indices.

Advertisement

Yeah, that's true. Do you do the depth-only prepass, like other Forward+ implementations I've read about, to find min/max depth for each tile to bracket the depth of your tile frustum? Have you found that to be a useful optimization?

The worst-case scenario that I'm thinking about, with something like Forward+, is that I'm looking through a vehicle window straight down a street that is lined with street lamps, which would be common in my case. Because I'm looking through a window, my min depth is very close by. My max depth is very far away. So, there will be some tiles whose frustum will intersect ALL of these street lights. When I go to draw my window, then, I have to process every one of those lights, even though none of them actually affect the window. Doing a world-space grid doesn't really have this problem.

So, it seems to me that it would at least be useful to modify Forward+ by splitting each tile frustum into chunks along the depth. That way, I'm not just asking, "Which lights affect this tile?" but "Which lights affect this tile at this depth?" And then that seems to get rid of the need to do any per-tile min/max depth determination (although a depth-only prepass may still be a useful optimization in terms of reducing over-shading).

I guess what I really need to do is experiment and see what works.

Edit: Not that you guys haven't been helpful, because you've been immensely helpful. I just think that maybe I'm worrying about the cost of things (e.g., a depth-only prepass, or resorting lights every frame, or worst-case scenarios, etc.) that I haven't even tried yet.

So, it seems to me that it would at least be useful to modify Forward+ by splitting each tile frustum into chunks along the depth.


You mean like this: https://sites.google.com/site/takahiroharada/storage/2012SA_2.5DCulling.pdf?attredirects=0

Yes, exactly. Thanks. I've hesitated to call it "clustered rendering" because, although the diagrams look similar, I haven't read up on it in enough detail yet to know if that's exactly what this is.

This topic is closed to new replies.

Advertisement