Particle Geometry
When doing a particle system one must decide what type of geometry to send to the GPU. In other words, what vertices. It’s also important to decide where and when to transform the geometry to screen space for rasterization.
It have been standard to use quads (sometimes just single triangles) as representation for particles. These quads are usually billboarded to the screen which requires additional work. There also exist a technique called point sprites that allows one to render a simple billboarded image by just sending a single vertice for each particle to the GPU , compared to at least four when doing quads (and maybe also indices). This sprite will be scaled by the distance accordingly to a formula that can be tweaked. It’s easy to translate it (it’s the position of the vertex itself) but it’s not so easy to rotate it. Rotation would need a special fragment shader that does the rotation manually.
Sprites can reduce the bandwidth usage a lot, at the cost of increased complexity in the fragment shader. Also, quads allows more possibilities, for example stretching. Which method is faster depends on where the bottleneck is in the rendering pipeline.
The movie above shows an example of a particle system.
Reference to the paperBuilding a Million Particle System:
http://www.2ld.de/gdc2004/MegaParticlesPaper.pdf
Some old info about point sprite based particle engines:
http://www.gamedev.net/reference/articles/article2002.asp
3 Comments »
RSS feed for comments on this post. TrackBack URI





















When using point sprites, the GPU generates texture coords for you. You can modify those in the vertex shader, so you don’t have to use a fragment shader. You can also use texture matrices for rotations, but then you get the same rotation for every point sprite.
Humus has a great article on automated generation of best fit geometry for particle textures to reduce overdraw (http://www.humus.name/index.php?ID=266). Another great way to reduce overdraw is render particles to a lower resolution render target using a downsampled depth buffer, and composite this with the main scene. This chapter from gpu gems 3 (http://http.developer.nvidia.com/GPUGems3/gpugems3_ch23.html) contains details on doing this, although the stencil-masking/high res step is often not needed/worth it for the performance cost.
Thanks for sharing that info. Yes, rendering to a texture smaller than screen size is a trick used more and more now. I will probably write an article about it and what filters can be used to upsample the texture (if needed).