Getting ready

Start with the basic particle system presented in the Creating a particle system using transform feedback recipe earlier in this chapter:

  1. Set the uniform variable Accel to a small upward value such as (0.0, 0.1, 0.0).
  2. Set the ParticleLifetime uniform variable to about 3 seconds.
  3. Create and load a texture for the particles that has fire-like colors. Bind it to the first texture channel, and set the uniform ParticleTex to 0.
  4. Use a particle size of about 0.5. This is a good size for the texture that is used in this recipe, but you might use a different size depending on the number of particles and the texture.

Get OpenGL 4 Shading Language Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.