karx11erx
01-04-2008, 02:48 PM
I am using an occlusion query to determine how much of a quad is rendered to the screen provided the quad is not occluded.
Later on I am rendering the quad again, this time with any occluders in front of it, and determine how much of it is visible.
The quotient of the two values is used as a brightness intensity gradient for the quad later on.
With Catalyst v7.10 that worked; with 7.12 it doesn't: The first step - just rendering every quad ("glDisable (GL_DEPTH_TEST)") and querying the rendered samples afterwards always yields 0 now. The quads are however rendered.
The procedure basically works like this:
glDepthMask (0);
glDisable (GL_DEPTH_TEST);
<for all quads> {
glBeginQuery (GL_SAMPLES_PASSED_ARB, <handle>);
<render quad>
glEndQuery (GL_SAMPLES_PASSED_ARB);
}
glFlush ();
<for all quads> {
GLint bAvailable = 0;
GLuint nSamples;
do {
glGetQueryObjectiv (<handle>, GL_QUERY_RESULT_AVAILABLE_ARB, &bAvailable);
} while (!bAvailable);
glGetQueryObjectuiv (<handle>, GL_QUERY_RESULT_ARB, &nSamples);
}
nSamples is always 0. Each quad has ofc its own unique handle (the handles are stored in an array).
What could I be doing wrong?
Later on I am rendering the quad again, this time with any occluders in front of it, and determine how much of it is visible.
The quotient of the two values is used as a brightness intensity gradient for the quad later on.
With Catalyst v7.10 that worked; with 7.12 it doesn't: The first step - just rendering every quad ("glDisable (GL_DEPTH_TEST)") and querying the rendered samples afterwards always yields 0 now. The quads are however rendered.
The procedure basically works like this:
glDepthMask (0);
glDisable (GL_DEPTH_TEST);
<for all quads> {
glBeginQuery (GL_SAMPLES_PASSED_ARB, <handle>);
<render quad>
glEndQuery (GL_SAMPLES_PASSED_ARB);
}
glFlush ();
<for all quads> {
GLint bAvailable = 0;
GLuint nSamples;
do {
glGetQueryObjectiv (<handle>, GL_QUERY_RESULT_AVAILABLE_ARB, &bAvailable);
} while (!bAvailable);
glGetQueryObjectuiv (<handle>, GL_QUERY_RESULT_ARB, &nSamples);
}
nSamples is always 0. Each quad has ofc its own unique handle (the handles are stored in an array).
What could I be doing wrong?