-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

OpenGL 4 Shading Language Cookbook
By :

Smoke is characterized by many small particles that float away from the source, and spread out as they move through the air. We can simulate the floatation effect with particles by using a small upwards acceleration (or constant velocity), but simulating the diffusion of each small smoke particle might be too expensive. Instead, we can simulate the diffusion of many small particles by making our simulated particles change their size (grow) over time.
The following image shows an example of the results:
The texture for each particle is a very light smudge of grey or black color.
To make the particles grow over time, we'll simply increase the size of our quads.
Start with the basic particle system presented in the Creating a particle system using transform feedback recipe:
Accel
to a small upward value like (0.0, 0.1, 0.0).ParticleLifetime
uniform variable to about 10
seconds.Change the font size
Change margin width
Change background colour