Per-pixel occlusion culling

Started by
5 comments, last by superpig 18 years, 8 months ago
I haven't found any description of subj in the web. Can anyone help me with detailed information about this algorithm?
Advertisement
It's also called depth-culling...
It uses a Z-buffer.
Take a look at this article:
http://www.cs.unc.edu/~zhangh/dissertation.pdf

I've found that an implementation of this technique can work really well with a software renderer for the occluders and thus access to a precise depth buffer as well.

- Kasper
Ok. How can I achieve results like these?
Quote:
Reality Engine Features

* Hierarchical Per-pixel Occlusion Culling. No more portals, zones, vis-gen waiting times, or manual occluders! Occlusion is fully automatic, fast, and accurate to the pixel.
Check out this article. I wrote it right when DX9 came out (when hardware occlusion queries were new). It is pretty primitive, but check out these optimizations that I never got around to:

Quote:
Here are some of the preliminary things I've been thinking about:

(1) Use an array of IDirect3DQuery9's (100-200 of them seems to work well, depending on the amount of objects you are using). First, draw the bounding meshes of all the objects, and use a separate query for each. After all objects are drawn, go back and query the data. At this point, it should be ready, and you don't have to waste any CPU cycles in the while loop.

(2) Batch render all of the bounding meshes for the preliminary render. This will save many DrawIndexedPrimitive (DIP) calls.

(3) Couple this occlusion technique with another culling technique, such as octrees. That way, you aren't wasting valuable DIP calls for an object that isn't even close to being in the scene.

(4) Use occlusion culling in an offline method, coupled with PVS. The occlusion tool will take the world, render all possible viewpoints, and export the PVS data. The engine will then load the PVS data, and use it accordingly. This is nice, because it's very accurate (you won't experience overdraw/underdraw), and it replaces some complicated offline algorithms. It should also be very flexible for both indoor and outdoor environments. However, this is a little complicated to implement in an article.

(5) Only test the objects that are above a certain triangle count. This is to make sure that actually rendering the full object is not faster than doing all of the occlusion stuff.

The biggest killer for this method is all of the DIP calls it sucks up. The rendered meshes actually take up 3 calls a piece, which is *definetly* not good.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
When people answers your questions you should try to actually put an effort into checking out what they suggest to you!

Read the article I linked, think about what I wrote above and try to figure out for yourself if this will help you in your own engine.

I don't know exactly what they do in the Reality engine but I would be impressed if they get fast and accurate occlusion culling with *no* effort. Still, if used with the real rendering geometry, the method I talk about could do what they claim - but since it's currently slow/hard to get access to the real z-buffer I cannot think of a way where that would be practical. With access to the real z-buffer and frame coherency you might be able to use the z-buffer from last frame to occlusion cull the current. I find it more practical to select and render a few manually created occluder meshes (which can be really low-poly).

- Kasper
There's an article in GPU Gems 2 that has very good coverage of a practical hierarchical occlusion system, which I recommend you read.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

This topic is closed to new replies.

Advertisement