HP Workstation zx2000 HP OpenGL Implementation Guide for HP-UX 11.X (IPF versi - Page 39

texture downloading performance, selection performance, state change, vertex-data commands

Page 39 highlights

programming hints Performance is increased by maximizing the number of vertices per Begin/End pair. If your vertex data in memory is organized in a linear, rather than a random manner, performance is enhanced by taking advantage of vertex pre-fetch. It is most efficient to use 32-bit float data, which avoids the need to convert data. texture downloading performance This section includes some helpful hints for improving the performance of your program when downloading textures. ■ If you are downloading MIPmaps, always begin with the base level (level 0) first. ■ If it is possible, you should use texture objects to store and bind textures. ■ If you are doing dynamic downloading of texture maps, you will get better performance by replacing the current texture with a texture of the same width, height, border size, and format. This should be done instead of deleting the old texture and creating a new one. selection performance To increase the performance of selection (glRenderMode GL_SELECTION) it is recommended that the following capabilities be disabled before entering the selection mode. GL_TEXTURE_* GL_TEXTURE_GEN_* GL_FOG GL_LIGHTING 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-setting commands, 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 OpenGL implementation guide 5-5

  • 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

OpenGL implementation guide
5–5
programming hints
Performance is increased by maximizing the number of vertices per Begin/End pair. If your
vertex data in memory is organized in a linear, rather than a random manner, performance is
enhanced by taking advantage of vertex pre-fetch. It is most efficient to use 32-bit float data,
which avoids the need to convert data.
texture downloading performance
This section includes some helpful hints for improving the performance of your program when
downloading textures.
If you are downloading MIPmaps, always begin with the base level (level 0) first.
If it is possible, you should use texture objects to store and bind textures.
If you are doing dynamic downloading of texture maps, you will get better performance by
replacing the current texture with a texture of the same width, height, border size, and
format. This should be done instead of deleting the old texture and creating a new one.
selection performance
To increase the performance of selection (
glRenderMode GL_SELECTION
) it is recommended
that the following capabilities be disabled before entering the selection mode.
GL_TEXTURE_*
GL_TEXTURE_GEN_*
GL_FOG
GL_LIGHTING
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-setting
commands, 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