hello people,
please I need to know how to simulate smoke in openGl (code or equivalent), basically there should be a cigarette rotating and the smoke should be coming out of it and I couldn’t figure out how to do that… anything you can give me would be highly appreciate it…
The MAM/VRS toolkit has a pretty ok smoke example (OpenGL is used for the rendering), look under examples at the smoke application, there is screenshot of it.
I recommend using particles. They don’t look quite as cool as pocketmoon’s demo, but they’re fast, easy, effective, and looks equally good from all angles.
Just store the position, velocity and opacity of a few particles (as many as you like - more looks better, but as few as 15 can look good), and each frame randomly alter the velocity, displace the position by the velocity * the frame time, and reduce the opacity by an amount proportional to the frame time. Once the opacity is below 0 reset the particle positioned at the end of the cigarette.
Draw the particles as alpha blended billboards (use qsort() to z-sort them).
Although not OpenGL (dos and in 2d), Hugo Elias has a very nice looking smoke demo. But there is no article about how it was done. Or I didn’t find it anyway.
Maybe one could do a procedural texture map thing with this technic.