Sign in to follow this  
GreenCode

How do games make fire and smoke effects?

Recommended Posts

Hi all, I was wondering around, searching internet about particle system and fire effects but I haven't found any good answers. On some games I have realized that some sort of movie is being shown as the fire, which is pretty good but not for the fires which are close to the viewer. Please let me know how to make realistic fire and smoke effect in a game. Also if you have a good sample code or good description of how to make these kinds of cool fires please note them too.

Thanks.

Share this post


Link to post
Share on other sites
To make fire or smoke, I use small squares for each particle that has a "fire" or "smoke" texture mapped on it. The square is billboarded so that it always faces the camera no matter which way you change your view. With the right particle settings you can make some pretty realistic fire and smoke this way.

Share this post


Link to post
Share on other sites
[quote name='GreenCode' timestamp='1305898226' post='4813452']
Hi all, I was wondering around, searching internet about particle system and fire effects but I haven't found any good answers. On some games I have realized that some sort of movie is being shown as the fire, which is pretty good but not for the fires which are close to the viewer. Please let me know how to make realistic fire and smoke effect in a game. Also if you have a good sample code or good description of how to make these kinds of cool fires please note them too.
[/quote]

Take a look at the GPU gems book 1 chapter 6. It explains one way of producing fire and smoke effects similar to the Balrog's fire from Lord of the Rings.

[url="http://developer.nvidia.com/node/105"]http://developer.nvidia.com/node/105[/url]

Share this post


Link to post
Share on other sites
For fire you should use additive blending. This means that you simply add the particles onto what is already in the framebuffer through blending, which is done with the blend equation glBlendFunc(GL_ONE, GL_ONE).
A nice property of additive blending is that you don't have to sort the particles by depth prior to rendering them.

For smoke you typically use alpha blending. The standard method is sorting the particles by depth and then rendering them with the blend equation glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this