Getting ready

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

  1. Set the uniform variable Accel to a small upward value like (0.0, 0.1, 0.0).
  2. Set the ParticleLifetime uniform variable to about 10 seconds.
  3. Create and load a texture for the particles that looks like just a light-grey smudge. Bind it to texture unit zero, and set the uniform ParticleTex to 0.
  4. Set the MinParticleSize and MaxParticleSize uniform variables to 0.1 and 2.5 respectively.

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.