HP j6700 OpenGL Implementation Guide for HP-UX 11.x - Page 22
Table 1-9, Enumerated Types for Occlusion, Extended Area, Enumerated Type, Description
View all HP j6700 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 22 highlights
overview of OpenGL OpenGL extensions if (result) { glColorMask(GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask(GL_TRUE); renderPart(i); glDepthMask(GL_FALSE); glColorMask (GL_FALSE, GL_FALSE, GL_FALSE); } } /* Disable Occlusion Culling test */ glDisable(GL_OCCLUSION_TEST_HP); /* Turn on writes to depth and color buffers */ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask(GL_TRUE); The key idea behind occlusion culling is that the bounding box is much simpler (i.e., fewer vertices) than the part itself. Occlusion culling provides a quick means to test non-visibility of a part by testing its bounding box. It should also be noted that this occlusion culling functionality is very useful for viewing frustum culling. If a part's bounding box is not visible for any reason (not just because it's occluded in the Z-buffer) this test will give correct results. Table 1-9 To maximize the probability that an object is occluded by other objects in a scene, the database should be sorted and rendered from front to back. Also, the database may be sorted hierarchically such that the outer objects are rendered first and the inner are rendered last. An example would be rendering the body of an automobile first and the engine and transmission last. In this way, the engine would not be rendered due to the bounding box test indicating that the engine is not visible. Enumerated Types for Occlusion Extended Area Enumerated Type Description Enable.Disable/IsEnabled GL_OCCLUSION_TEST_HP Default: Disabled Get* GL_OCCLUSION_TEST_RESULT_HP Default: Zero (0) pname variable. pname variable For related information, see the functions: glGet, glEnable, glDisable, and glIsEnabled. 20 Chapter 1