GL_OCCLUSION_TEST_HP(3gl)GL_OCCLUSION_TEST_HP(3gl)NAMEGL_OCCLUSION_TEST_HP - allows an application to quickly determine the
visibility of some set of geometry based on the visbility of the bound‐
ing box of the geometry.
DESCRIPTION
Enabling GL_OCCLUSION_TEST_HP allows an application to render a bound‐
ing box of some complicated geometry and at the completion of the ren‐
dering to determine if any of the geometry could or did modify the
depth buffer. If the occlusion test failed, ie the bounding box was
depth culled due to the current contents of the depth buffer, then the
geometry enclosed by the bounding box would also be depth culled. Based
on the occlusion test result, an application can choose to not render
the complicated geometry when its bounding box is depth culled; hence
the rendering performance can be significantly improved.
Occlusion culling operates independently of the current rendering state
(ie. when occlusion culling is enabled fragments are generated and the
depth and/or color buffer may be updated). To prevent updating the
depth/color buffers, the application must disable updates to these buf‐
fers. As a side effect of reading the occlusion result, the internal
result state is cleared.
The expected usage of this feature is :
- disable updates to color and depth buffer (optional)
glDepthMask(GL_FALSE)
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE)
- enable occlusion test
glEnable(GL_OCCLUSION_TEST_HP)
- render bounding geometry
gl rendering calls
- disable occlusion test
glDisable(GL_OCCLUSION_TEST_HP)
- enable updates to color and depth buffer
glDepthMask(GL_TRUE)
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE)
- read occlusion test result
glGetBooleanv(GL_OCCLUSION_RESULT_HP, &result)
- if (result) render internal geometry
else don't render
For this extension to be useful, the time to render the geometry under
test should be much more than rendering the encompassing geometry,
including reading back the test result.
GL_OCCLUSION_TEST_HP can be specified in the <cap> parameter of glEn‐
able, glDisable, and glIsEnabled.
GL_OCCLUSION_RESULT_HP can be specified in the <pname> parameter of
glGetBooleanv, glGetIntegerv, glGetFloatv, and glGetDoublev.
SEE ALSO
glEnable, glDisable, glIsEnabled, glGetBooleanv, glGetIntegerv, glGet‐
Floatv, and glGetDoublev.
10 Apr 98 GL_OCCLUSION_TEST_HP(3gl)