HP c8000 manual Textures, State changes and their effects on display lists

Page 56

programming hints

OpenGL performance hints

mode

Specifies the primitive or primitives that will be

 

created from the vertices. Ten symbolic constants are

 

accepted: GL_POINTS, GL_LINES, GL_LINE_STRIP,

 

GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP,

 

GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and

 

GL_POLYGON.

list

A sequence of starting indices in the enabled arrays.

 

Each index is the start of a primitive in the set. The

 

final value in the sequence indexes the end of the set.

 

The total number of indices is count+1.

count

The number of primitives in the set to render.

When glDrawArraySethp is called, it iterates over count + 1 vertex array indices from list. For 0 HP uses list[i+1] - list[i] sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element list[i].

Calling glDrawArraySethp(mode, list, count) is functionally equivalent to:

for (i = 0; i < count; i++)

glDrawArrays(mode, list[i], list[i+1]- list[i]);

textures

If calls to glTexImage are put into a display list, they may be cached. In general, for best performance, use Array Sets and Arrays, Display, and Immediate Mode (Vertex API). Note that if you are going to use the same texture multiple times, you may gain better performance if you put the texture in a display list. Another solution would be to use texture objects. Since 3D textures can potentially become very large, they are not cached.

state changes and their effects on display lists

If there are several state changes in a row, it is possible, in some circumstances, for the display list to optimize them.

It is more efficient to put a state change before a glBegin, than after it. For example, this is always more efficient:

glColor3f(1,2,3); glBegin(GL_TRIANGLES); glVertex3f(...);

54

Chapter 5

Image 56
Contents OpenGL Implementation Guide Legal Notices Contents Installation and setup Programming hints Contents Overview of OpenGL Introduction OpenGL Reference ManualHp’s implementation of the OpenGL libraries OpenGL productHp’s implementation of OpenGL 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 supportStandard OpenGL product OpenGL Utilities Library GLUInput and output routines OpenGL extensions for the X Window system GLXOpenGL product Mixing of OpenGL and Xlib Gamma correction OpenGL extensions Visibility test extensionsOcclusion extension Occlusion culling code fragmentsEnumerated Types for Occlusion GLHPsupersample extension Default visuals Rendering detailsEXP and EXP2 fogging Bow-tie quadrilateralsVertices 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? 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 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 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 Texture coordinates OpenGL correctness hints4D values Glcompileandexecute mode OpenGL performance hintsDisplay list performance Geometric primitivesDraw array set extensions Textures State changes and their effects on display listsRegular primitive data Texture downloading performance Selection 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