HP j6700 OpenGL Implementation Guide for HP-UX 11.x - Page 22

Table 1-9, Enumerated Types for Occlusion, Extended Area, Enumerated Type, Description

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62

overview of OpenGL
OpenGL extensions
Chapter 1
20
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.
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.
For related information, see the functions: glGet, glEnable, glDisable,
and glIsEnabled.
Table 1-9
Enumerated Types for Occlusion
Extended Area
Enumerated Type
Description
Enable.Disable/IsEnabled GL_OCCLUSION_TEST_HP
Default: Disabled
pname variable.
Get*
GL_OCCLUSION_TEST_RESULT_HP
Default: Zero (0)
pname variable