Skip to main content
gamedev.net
🔒 Locked

rendering fire

Started by TheMatrixXXX Jun 13, 2002 at 3:21 PM 4 replies 1.6k views
Original Post
TheMatrixXXX
TheMatrixXXX
does anyone know how to render fire in opengl? i searched the net but i didn´t found anything. can anyone tell me some physics on fire particles? thx for your help --=[[TheMatrixXXX]]=--
--=[[TheMatrixXXX]]=--
gBit
gBit
Think about how fire used to be rendered in DOS. What I have seen being done is a TFirePixel struct with x,y,heat values. These particles have a life, and when they get too high, they fizzle (colour fade) and die. Now all you do is randomise waves of these particles with varying height (within a small range) and a ''level'' of heat. Then you make them rise and fall according to your random() function''s wishes. Of course, this was all in dos, put OpenGL does support rendering of pixels. It should not be too much of a problem for this effect. Although, doing fire ala Quake 3, Unreal, and such, that will require a totally different approach. In 3D though, all you do is add a z value to take the particle approach. I hope this helps!

#define
________#define
doctorsixstring
doctorsixstring
A lot of games just use an animated texture (or animated model) to render fire.
TheMatrixXXX
TheMatrixXXX
thx for your answers but i want to create a particle fire effect (mostly just for fun and not using it in my engine). do you know some urls where i can find some algoritms to render the "form" of a fireplace for example? the color is no problem this already works but i don´t get the form of a flame. thx

--=[[TheMatrixXXX]]=--
uNiQue0815
uNiQue0815
i don''t know an algorithm to simulate the shape of a real fire - don''t know if there is one...

you can create god looking fire by making a normal particle-system that emits particles with random speed/direction/heat, and put one or more attraction points into or above the flame (you can simulate a pretty good looking candle-flame with this). maybe you can find settings / parameters for the p-system and attractors that lets it look almost like a real fire...

you can also get cool effects by randomly throwing bigger particles into the flame and maybe rotating the particle-texture. there are lots of possibilities. you should play around with settings & try lots of things out... maybe on your way to realistic fire, you''ll discover new cool-looking effects

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.