Advertisement

Occlusion Testing

Started by July 12, 2004 11:03 AM
2 comments, last by vincoof 20 years, 4 months ago
I am putting in Occlusion testing into my program (using the "GL_HP_occlusion_test" extension) and have found that just issuing an "glEnable(GL_OCCLUSION_TEST_HP);" (and the corrosponding disable) sucks up a huge amout of fps.. (I'm not even doing any rendering to see the result of the occlusion) Is this the norm ?? (I have a ATI Radion if that help).. is the Nvidia extension faster (I would think the HP one would be faster due to the fact that it only has to bomb out once it knows that at least one pixel is visible, where as the nvidia extension counts every pixel..) Cheers Guys.. Chris
Look up ARB verison of this extension ARB_occlusion_query. It's simmilar to nVidias verison (that has evolved from form HP one). But getting it to work fast is not so easy. The huge drop mainly comes from the fact you are stalling GPU pipeline. With ARB verison this can be avoided.. almost :)
You should never let your fears become the boundaries of your dreams.
Advertisement
Quote: Original post by _DarkWIng_
Look up ARB verison of this extension ARB_occlusion_query. It's simmilar to nVidias verison (that has evolved from form HP one). But getting it to work fast is not so easy. The huge drop mainly comes from the fact you are stalling GPU pipeline. With ARB verison this can be avoided.. almost :)

I don't understand if this refers to HP, NV or ARB so I'll add my own considerations.

HP does testing syncronously so, you're effectively stalling the pipe while waiting for test to complete.

NV actually does not since you can run multiple queries at the same time. There's possibly some upper limitation in the number of queries which can be run at optimal performance but considering the hassle of implementing the feature, I think it's easy you get at least 8 or more queries. It's still possible to stall the GPU while waiting for a query to finish but this is harder, you need a specific call.

ARB is just a polished NV extension. If it adds something different I completely missed it. Well, it counts samples instead of pixels but this does not change a thing in real applications.

Now, I'll add a random rumor about GPU stalls and NV / ARB queries.
It's rumored NV_conditional_render will remove GPU stalls completely. It's also rumored it's not implemented in NV3x and still not exposed in NV4x drivers (not even in beta).
I know very little about this, but I still say it because it opens new horizons to engine design.
I personally was very excited when I heard that because my engine was designed to have that feature. :)

Previously "Krohm"

Quote: Original post by Krohm
Well, it counts samples instead of pixels but this does not change a thing in real applications.

It's especially true that it doesn't change anything since implementations are free no to count real number of samples when multisampling is enabled.

Taken from the spec :
Quote: Ideally, the samples-passed count would be incremented by the precise number of samples, but we permit implementations to instead increment the samples-passed count by SAMPLES if at least one sample in a given fragment is covered.


As for hanging the application, NVIDIA posted a tip about it some time ago. Basically it tells not to query the result immediately after the query started, and it proposes a way to achieve it. I guess this issue works with ARB_occlusion_query too.

This topic is closed to new replies.

Advertisement