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

OpenGL performance hints, display list performance

Page 54 highlights

programming hints OpenGL performance hints OpenGL performance hints Hints provided in this section are intended to help improve your applications performance when using HP's implementation of OpenGL. display list performance The topics covered here are areas where you can gain substantial improvements in program performance when using OpenGL display lists. Here is a list of the topics that are covered: • geometric primitives • GL_COMPILE_AND_EXECUTE mode • textures • state changes and their effects on display lists • regular primitive data. geometric primitives Geometric primitives will typically be faster in a display list than by using immediate mode. Each display list should have numerous primitives to ensure good performance. As a general rule, larger primitives will be faster than smaller ones. Performance gains here can be dramatic. For example, it is possible that a single GL_TRIANGLES primitive with 20 or so triangles will render three times faster than 20 GL_TRIANGLES primitives with a single triangle in each one. GL_COMPILE_AND_EXECUTE mode Due to the pre-processing of the display list, and execution performance enhancements, creating a display list using the GL_COMPILE_AND_EXECUTE mode will reduce program performance. If you need to improve your programs performance, do not create a display list using the GL_COMPILE_AND_EXECUTE mode. You will find that it is easier and faster to create the display list using the GL_COMPILE mode, and then execute the list after it is created. 52 Chapter 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
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62

programming hints
OpenGL performance hints
Chapter 5
52
OpenGL performance hints
Hints provided in this section are intended to help improve your
applications performance when using HP’s implementation of OpenGL.
display list performance
The topics covered here are areas where you can gain substantial
improvements in program performance when using OpenGL display
lists. Here is a list of the topics that are covered:
geometric primitives
GL_COMPILE_AND_EXECUTE mode
textures
state changes and their effects on display lists
regular primitive data.
geometric primitives
Geometric primitives will typically be faster in a display list than by
using immediate mode. Each display list should have numerous
primitives to ensure good performance. As a general rule, larger
primitives will be faster than smaller ones. Performance gains here can
be dramatic. For example, it is possible that a single
GL_TRIANGLES
primitive with 20 or so triangles will render three times faster than 20
GL_TRIANGLES
primitives with a single triangle in each one.
GL_COMPILE_AND_EXECUTE mode
Due to the pre-processing of the display list, and execution performance
enhancements, creating a display list using the
GL_COMPILE_AND_EXECUTE
mode will reduce program performance. If
you need to improve your programs performance, do not create a display
list using the
GL_COMPILE_AND_EXECUTE
mode. You will find that it is
easier and faster to create the display list using the
GL_COMPILE
mode,
and then execute the list after it is created.