overview of OpenGL
OpenGL extensions
OpenGL extensions
The extensions listed in this section are extensions that
visibility test extensions
HP supports extensions for visibility testing and occlusion culling.
See the
occlusion extension
This occlusion culling extension defines a mechanism whereby an application can determine the
Typical usage of this feature would include testing the bounding boxes of complex objects for visibility. If the bounding box is not visible, then it is known that the object is not visible and need not be rendered.
occlusion culling code fragments
The following is a sample code segment that shows a simple usage of occlusion culling.
/* Turn off writes to depth and color buffers */ glDepthMask(GL_FALSE);
glColorMask (GL_FALSE, GL_FALSE, GL_FALSE); /* Enable Occlusion Culling test */ glEnable(GL_OCCLUSION_TEST_HP);
for (i=0; i < numParts; i++) {
/* Render your favorite bounding box */ renderBoundingBox(i);
/* If bounding box is visible, render part */ glGetBooleanv(GL_OCCLUSION_RESULT_HP, &result);
Chapter 1 | 19 |