HP c8000 manual Enumerated Types for Occlusion

Page 22

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.

 

 

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.

Table 1-9

Enumerated Types for Occlusion

 

 

 

 

 

Extended Area

 

Enumerated Type

Description

 

 

 

Enable.Disable/IsEnabled

GL_OCCLUSION_TEST_HP

pname variable.

 

 

Default: Disabled

 

 

 

 

 

Get*

 

GL_OCCLUSION_TEST_RESULT_HP

pname variable

 

 

Default: Zero (0)

 

 

 

 

 

 

For related information, see the functions: glGet, glEnable, glDisable,

 

and glIsEnabled.

 

20

Chapter 1

Image 22
Contents OpenGL Implementation Guide Legal Notices Contents Installation and setup Programming hints Contents Overview of OpenGL Introduction OpenGL Reference ManualHp’s implementation of OpenGL OpenGL productHp’s implementation of the OpenGL libraries Supported graphics devices Supported operating systemsSupported visuals Visual Table for HP Visualize fxeVisual Table for ATI Fire GL T2/X1/X3 Stereo Visual Support for HP Fire GL-UX Visual support for other graphics devicesBuffer sharing between multiple processes and threads Sigchld and the GRM daemonBit programming Sample 64-bit compile and link for 11.x only SLS supportInput and output routines Standard OpenGL productOpenGL Utilities Library GLU OpenGL extensions for the X Window system GLXOpenGL product Mixing of OpenGL and Xlib Gamma correction Occlusion extension OpenGL extensionsVisibility test extensions Occlusion culling code fragmentsEnumerated Types for Occlusion GLHPsupersample extension EXP and EXP2 fogging Default visualsRendering details Bow-tie quadrilateralsDecomposition of concave quadrilaterals Index mode ditheringVertices outside of a begin/end pair Environment variables New environment variables as of release Switches to the faster double buffering method Installation and setup Installation and setup Is your system software preloaded with instant ignition? Verification instructionsVerify that OpenGL is on your workstation Installing OpenGL Install OpenGLOpenGL Development Environment Filesets for 11.0 Check log file Verify the product OpenGL file structure 64-bit libraries are in a subdirectory OpenGL file structure Chapter Running OpenGL programs Visual support for the VGL mode Virtual GLX VGL modeSpecial considerations Bool hpglXDisplayIsVGLDisplay *dpy, int screen Running hps implementation of the OpenGL stereo application Running hps implementation of the OpenGL stereo application Running OpenGL programs Compiling and linking programs Overview Subdirectory This Directory ContainsIncluding header files Linking shared libraries Compiling 32-bit and 64-bit applications for OpenGL OpenGL procedure calls Programming hints Programming hints 4D values OpenGL correctness hintsTexture coordinates Display list performance Glcompileandexecute modeOpenGL performance hints Geometric primitivesDraw array set extensions Textures State changes and their effects on display listsRegular primitive data Texture downloading performance Selection performanceState change Occlusion culling Optimization of lightingHigh frame rate applications Rescaling normals OpenGL performance hints
Related manuals
Manual 27 pages 63.95 Kb Manual 8 pages 32.71 Kb Manual 89 pages 28.35 Kb