Particle effects

The final topic we are going to look at is particle effects. Particles are basically billboards, but in addition to being rotated to face the camera we move them over time. For example, we may specify a starting position, direction, and speed, and move each particle along its direction at its speed from its starting position based on the time that has elapsed since the particle began moving in the vertex shader. It is possible to create very complicated effects using particles, as they are relatively cheap—fire, smoke, and so on, are all easily achieved and convincing using particle systems.

In this case, we will specify a starting position, movement direction, speed, lifetime, fade in time, and "wind" value (which moves all particles ...

Get 3D Graphics with XNA Game Studio 4.0 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.