PDA

View Full Version : occlusion culling without extension in two passes ?



DJSnow
12-27-2003, 05:50 AM
hi everyone.

wouldn't it be possible to do something like occlusion culling by rendering the scene with two passes and different state setup, if no extension is available on the target platform ?

jwatte
12-27-2003, 08:48 AM
How would you read the result back in a useful manner?

Cyranose
12-27-2003, 12:13 PM
Originally posted by jwatte:
How would you read the result back in a useful manner?

The same way we've been doing for years: render the scene with color tags (unlit, no alpha, no texture, etc..) and build a histogram. Assign one unique color per visibility group (object, primitive, whatever) and the histogram will count how exactly many pixels of that group are visible in the final image and unlike HW_histogram, do this regardless of draw order.

The big downside of this approach over HW_occlusion is the full buffer read, since HW histogram is almost never supported. But that doesn't make it "not useful" for some applications. http://www.opengl.org/discussion_boards/ubb/smile.gif

Avi

DJSnow
01-03-2004, 07:08 AM
@Cyranose:

do you have any links or a similar starting point ?! have you tried this way ?
i mean, is it really useful, or is the overhead so big that it's useless, in comparison to the hardware method ? i'm interested in such way, because my target platform has no support for ARB_occlusion_query, or at least "it mustn't have" - so, i thought doing this in software would be a work-around for older graphic cards.

cass
01-03-2004, 08:07 AM
You could do something like you suggest to get some occlusion query info, but it would certainly be expensive.

To behave exactly like OQ, you have to count fragments that overlap each other and still pass the depth test. So back-to-front rendering will produce a lot more "temporarily visible" samples than just reading the final buffer.

Still, if you can get useful information quickly enough by this other method, then it is (by definition) good enough.

Lots of hardware supports OQ now though, so you should probably support it as well since it should be much faster.

Thanks -
Cass