Jump to content
  • Advertisement
Sign in to follow this  
GreenCode

How do games make fire and smoke effects?

This topic is 2595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

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.


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.

http://developer.nvidia.com/node/105

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!