COSC 3P98 Assignment Notes

Assignment 3's animation can involve a lot of particles or objective flying about the scene. When you get to a certain number of particles, things may slow down a lot, due to all the processing being done. Much of this processing is the transferring of object vertices from your application to the OpenGL engine.

You can speed up processing by minimizing the numer of vertex (and other) communications between your application and OpenGL. Three commands to consider are these (pages in OpenGL Primer 3e):

1. Display lists (p.72)
2. vertex arrays (p.94)
3. vertex buffer objects (see Wikipedia)

Display lists will let you define your objects once, and transfer them to OpenGL's memory. This saves having to write them to OpenGL repeatedly. You can apply transformations in your application, and then refer to the object in OpenGL to render the basic object. Multiple objects can be defined. Once a display list is defined, however, it cannot be changed. Therefore, you should not define each transformed particle as a separate display list, because then you'd have to repeatedly redefine them after every frame of the animation.

Vertex arrays let you transfer an object to OpenGL with a single call. It does not save the object in OpenGL's memory. However, a single call is faster than multiple calls (one per vertex, for example).

Vertex buffer objects are the most sophisticated approach. See Wikipedia and the below web site for more details.

Good reference: http://www.songho.ca/opengl/index.html

Back