next up previous contents
Next: 17.9.3 Large and Small Up: 17.9 Particle Systems Previous: 17.9.1 Representing Particles   Contents


17.9.2 Particle Sizes

If particles are very small, or the particles are clustered tightly together some distance from the viewer, good effects are possible with particles of a single size. If the particles are moving a large distance towards or away from the viewer, a constant sized particle may appear unrealistic. Particles of changing sizes can lead to performance penalties. Changing point size can be a costly operation in OpenGL. Whenever possible, sort and group the particles by size when rendering to minimize the number of glPointSize() calls. Sorting overhead can be minimized in many cases by using an incremental sorting algorithm, since points generally move only a small distance from frame to frame.

If the GL_ EXT_point_parameters extension is available, you can use glPointParameterfEXT() and glPointParameterfvEXT() to set parameters that control point size as a function of distance from the viewer. This extension should be carefully benchmarked to see if your implementation can handle a set points with unsorted distance values efficiently. If not, then the points should still be sorted (or perhaps just partially sorted) to increase rendering efficiency.

Often sorting can be minimized by quantizing point sizes to a few distinct values. Groups of points within a given bounding volumes can be all set to an average size appropriate for that volume. As before, the effectiveness of quantizing particle size will depend on the behavior of particles in a particular system.


next up previous contents
Next: 17.9.3 Large and Small Up: 17.9 Particle Systems Previous: 17.9.1 Representing Particles   Contents
2001-01-10