HP c8000 manual State change

Page 59

programming hints

OpenGL performance hints

state change

OpenGL state setting commands can be classified into two different categories. The first category is vertex-data commands. These are the calls that can occur between a glBegin/glEnd pair:

glVertex glColor glIndex glNormal glEdgeFlag glMaterial glTexCoord

The processing of these calls is very fast. Restructuring a program to eliminate some vertex data commands will not significantly improve performance.

The second category is modal state-settingcommands, or sometimes referred to as “mode changes.” These are the commands that:

Turn on/off capabilities,

Change attribute settings for capabilities,

Define lights,

Change matrices,

etc.

These calls cannot occur between a glBegin/glEnd pair. Examples of such commands are:

glEnable(GL_LIGHTING); glFogf(GL_FOG_MODE, GL_LINEAR); glLightf(..); glLoadMatrixf(..);

Changes to the modal state are significantly more expensive to process than simple vertex-data commands. Also, application performance can be optimized by grouping modal-state changes, and by minimizing the number of modal-state changes:

Chapter 5

57

Image 59
Contents OpenGL Implementation Guide Legal Notices Contents Installation and setup Programming hints Contents Overview of OpenGL OpenGL Reference Manual IntroductionHp’s implementation of the OpenGL libraries OpenGL productHp’s implementation of OpenGL Supported operating systems Supported graphics devicesVisual Table for HP Visualize fxe Supported visualsVisual Table for ATI Fire GL T2/X1/X3 Visual support for other graphics devices Stereo Visual Support for HP Fire GL-UXSigchld and the GRM daemon Buffer sharing between multiple processes and threadsBit programming SLS support Sample 64-bit compile and link for 11.x onlyOpenGL extensions for the X Window system GLX Standard OpenGL productOpenGL Utilities Library GLU Input and output routinesOpenGL product Mixing of OpenGL and Xlib Gamma correction Occlusion culling code fragments OpenGL extensionsVisibility test extensions Occlusion extensionEnumerated Types for Occlusion GLHPsupersample extension Bow-tie quadrilaterals Default visualsRendering details EXP and EXP2 foggingVertices outside of a begin/end pair Index mode ditheringDecomposition of concave quadrilaterals Environment variables New environment variables as of release Switches to the faster double buffering method Installation and setup Installation and setup Verify that OpenGL is on your workstation Verification instructionsIs your system software preloaded with instant ignition? Install OpenGL Installing 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 Special considerations Virtual GLX VGL modeVisual support for the VGL mode 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 Subdirectory This Directory Contains OverviewIncluding header files Linking shared libraries Compiling 32-bit and 64-bit applications for OpenGL OpenGL procedure calls Programming hints Programming hints Texture coordinates OpenGL correctness hints4D values Geometric primitives Glcompileandexecute modeOpenGL performance hints Display list performanceDraw array set extensions State changes and their effects on display lists TexturesRegular primitive data Selection performance Texture downloading performanceState change High frame rate applications Optimization of lightingOcclusion culling 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