• Advertisement

Archived

This topic is now archived and is closed to further replies.

Procedural fire (modelling and rendering)

This topic is 5678 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

Now that clouds isn''t an issue anymore... A while back I more or less got fire working with a simple particle system and an exponential falloff texture. By varying the colors as a function of time I managed to get a pretty cool effect. However, I''m not satisfied with it Another approach I tried was using two orthogonal quads textured with a turbulence noise function. I believe that''s the approach used in Quake III. That gives a different look which is pretty cool, but still way too artificial. Right now I''m trying a hybrid model. I''m using a particle system with dozens of billboards textured with a procedural turbulence noise function. I''ll post the screenshots soon (once I get that perfect look). Does anyone here have fire implemented or knows of other implementations? Are there approaches that differ significantly from what I use? P.S. Yann will probably post screenshots that will make everyone''s jaws drop

Share this post


Link to post
Share on other sites
Advertisement
quote:

P.S. Yann will probably post screenshots that will make everyone''s jaws drop


Heh, first I need to find my old fire system within the depths of my harddisk, it''s been some time I haven''t done fire anymore...

Share this post


Link to post
Share on other sites
I don''t think that completely realistic fire is even possible in real time. I''ve seen some of the fire techniques they use as raytracer components and such, but those generally use 3-D voxel fields and calculate the dynamics using the Navier-Stokes equations. For realtime, you can either use procedural billboards or a particle system (or, I suppose, a hybrid as proposed above). However, a particle system is going to noticeably be a particle system, and the procedural billboard is going to have that distinct procedural look. I think the best thing we can do about this is to just say it''s "stylistic" and leave it at that. I personally don''t think that my procedural effect for fire looks a huge amount like actual fire, but it is recognizeably fire, and it doesn''t look too shabby, so I''m happy.

Share this post


Link to post
Share on other sites
Alimonster: now that''s a nice site, very impressive results ! Although I somehow doubt that it could be done in realtime (yet)... But I still downloaded the pdf

Good fire is very hard to make in realtime. I haven''t really done lots of fire stuff myself (just some candle-flame simulator, which turned out to be rather realistic, I''ll try to make it work again and post some shots). The standard way to do fire in current games is by billboarding or particle systems, as Mordoch Bob said. If you apply realistic fire animations (eg. filmed ones) on those billboards, it can actually look pretty good. But you still have the inherent problems of billboarding (either something is ''strange'' about the perspective, or you see this typical ''X-cross'').

There are other ways, though. An interesting way I tried out some time ago, is a volumetric approach. You all know this good old 2D standard fire effect, the blur-and-scroll-up one. You can extended this algorithm to 3D, and get a volumetric fire field. This can then be rendered using standard volume rendering techniques. The results are nice, but not really realistic. The pseudo-physical model beneath is just too simple to be realistic.

There are some very nice results you can get by using cellular automats. They create a pixel-based fire by applying a set of rules, and propagating the pixels that way. The effect is surprisingly good, esp. for turbulent torch-like flames. I have some source to this effect, I could post it on my website, if anyone is interested to play around with it.

Anyway, here is a link to the classic of all fire simulation papers by Jos Stam and Eugene Fiume: "Depiction of Fire and Other Gaseous Phenomena Using Diffusion Processes". It''s already rather dated (1995), but the principles are still interesting. On today''s hardware, it could be implemented in realtime (on a smaller scale). Here are some screenshots. As said, not that realistic either, but still interesting.

And if you want good non-realtime fire, then have a look at Digimation''s Phoenix. You can do amazing things with it, but it takes time to render...

/ Yann

Share this post


Link to post
Share on other sites
quote:
Original post by kill
Now that clouds isn''t an issue anymore...

A while back I more or less got fire working with a simple particle system and an exponential falloff texture. By varying the colors as a function of time I managed to get a pretty cool effect. However, I''m not satisfied with it



First clouds (water vapour), then fire... you''re not in the four-elements contest, are you?

Share this post


Link to post
Share on other sites
Shut up maaaaan. (Actually I could tell you, but then I''d have to kill you ) Also, you forgot, moving clouds - wind

Seriously though, if I make it by the deadline, it''d be great, if not, I''ll just continue working on the demo at my own pace. I''m not experienced enough to start something on my own, and so far the best way to get hired is to do something cool. Well, I''m trying to do something cool

Share this post


Link to post
Share on other sites
That pdf tells that they rendered the fire in ILM... Let''s suppose it''s not realtime on most computers

Anyway, I haven''t seen any good realtime 3D-fires yet, and therefore, I don''t know if there are any papers on it. Try using connected particles with shaded triangles. One could also create textures on the triangles during the fire... Haven''t tried it yet, I''d like someone to

Share this post


Link to post
Share on other sites
quote:
Original post by kill
Shut up maaaaan. (Actually I could tell you, but then I''d have to kill you ) Also, you forgot, moving clouds - wind



Ha! I''ve discovered your little secret
Stop asking anything to Yann right now!

quote:

Seriously though, if I make it by the deadline, it''d be great, if not, I''ll just continue working on the demo at my own pace.



Yes... always those deadlines...

Share this post


Link to post
Share on other sites
Aha !! 4 elements contest, hmm ? I wonder if I should participate and send in a little contribution of mine... *evil grin*

But seriously, 4E contest or not, lots of people seem to find this kind of stuff interesting, so what the heck

About that pdf: I had a closer look, and it''s definitely not doable in realtime yet. Their implementation needed up to 5 minutes/frame on a P4, so you''d have to speed it up by a factor of 7500 to get something more or less realtime... But the section I found interesting is the last one: how to compute nice fire colours from the spectral distribution. I always found it very hard to find good colours for my fire simulations.

/ Yann

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It looked to me like the paper was mostly the same method as in Fedkiw and Foster''s water modeling. Fluid solver with mass conservation via pressure, plus vorticity confinement, and implicit surfaces (for the water surface). Good results could be possibly obtained either by restricting to two dimensions, by modeling small fires (or at low accuracy), or by relaxing the mass conservation requirement. I do not understand why mass conservation should necessarily be very important for good looking fire, and think that a cheaper method (like adding a force according to the gradient of the divergence) could also give reasonable results. Of course, you''d have to experiment to see. But fire *should* be easier than water.

Share this post


Link to post
Share on other sites
I think their paper can be done in realtime with certain adjustments

1. Restrict to 2D.
2. Do a small resolution and use textured particles instead of pixels.

It won''t be AS good as their screenshots but it might be a nice adjustment to the particle system.

Share this post


Link to post
Share on other sites
Won't work in 2D. The problem is that their approach uses a volumetric fluid dynamic solver. It's almost impossible to restrain them to 2 dimensions, without either destabilizing them or getting totally unexpected visual artifacts.

The shape of the flame itself is created by pressure/flow convections in the 3D volume. If you remove one dimension, then you simply won't get the fire-shape anymore, because you'll be lacking the turbulences that created it in the first place. Real fire connot exist in two dimensions. And since fluid dynamic simulation is a physically based model, you won't get the expected results either, when restricting it to 2D.

The dynamically textured particles could be an interesting approach though. Remains the question on how to compute good looking dynamic particle textures (precalc ?).

/ Yann

[edited by - Yann L on June 5, 2002 3:02:15 PM]

Share this post


Link to post
Share on other sites
I''d compute one small texture with a turbulence function and modify it a little bit to look like fire. Then use that texture for all particles in the system. I am working on this right now.

Share this post


Link to post
Share on other sites
I just found the candle flame simulator I mentioned earlier. It''s technically incredible simple, but it still looks quite nice (IMO). Sometimes, you don''t need complex math to create good looking effects.



/ Yann

Share this post


Link to post
Share on other sites
I don't really like the way the flame looks... The candle however looks great, is it procedurally made or it's just a sprite?

After getting the basic particle system framework working and creating a fire effect, it became a matter of tweaking some values... I'm working on something else now, I'll get to tweaking everything a bit later.

EDIT: Here's a small screenshot of what I have right now.

Don't ask why it's in the middle of the sky and why it looks like that When it's animated it looks quiet good, and with a few adjustments it will look almost like a real fire.

[edited by - kill on June 8, 2002 5:34:44 PM]

[edited by - kill on June 8, 2002 5:36:00 PM]

Share this post


Link to post
Share on other sites
quote:

I don''t really like the way the flame looks... The candle however looks great, is it procedurally made or it''s just a sprite?


A matter of taste I guess The candle is a standard 3D object (and modeled in 3DSMax).

Share this post


Link to post
Share on other sites
I haven''t worked on fire for quite a while... although what I used to do was nothing compaired with what you guys are doing...

( although that candle flame looks too symmetrical )...

The only thing I was quite proud of was some particle explosion type fire I did for a 2D game I was making...



Try not to laugh...

Death of one is a tragedy, death of a million is just a statistic.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

hey ppl.. just dropping in..

(done in 3dsmax)
http://wind.prohosting.com/jonazdk/fakefire.avi

the colors suck.. but I like the motion.

Share this post


Link to post
Share on other sites
I was going to enter the 4 elements contest, but i got some other projects that need my time.

But i was thinking of a 3d implementation of the old 2d fire algorithm. In the 2d version you have to take the average of the surrounding pixels to get the current pixel color. (with some biasing to make it move upwards)

There is no reason you can''t convert that to 3d, but kind of voxel-ish.....

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

mmm.. forgot url tags.. trying again.. (don''t know if it works)

[url]http://wind.prohosting.com/jonazdk/fakefire.avi[/url]

anywayz.. it''s only 4000-6000 polys and could be done in realtime.

Share this post


Link to post
Share on other sites
quote:

although that candle flame looks too symmetrical )


Yeah, it's an old effect anyway

But I don't think it's the fact that it is too symmetric (in reality small flames are symmetric, if no wind disturbs them), it's because it is too 'massive'. Which is normal, since it's a 3D object. Perhaps by adding some kind of vertical motion blur, it could get better.

[Edit] Added some motion blur (see image). Hmm. still looks symmetric though. It looks different when the flame moves, a static shot is really a bit weird.

[edited by - Yann L on June 9, 2002 11:33:47 AM]

Share this post


Link to post
Share on other sites
Undisturbed candle flames are symmetrical.

The only issue I have with that particular effect is that in an actual candle the bottom part of the flame has a faint blue color, and is so faint that it''s in fact invisible at the very bottom. The effect, as it is now, looks like a waterdrop to me

Share this post


Link to post
Share on other sites
quote:

The only issue I have with that particular effect is that in an actual candle the bottom part of the flame has a faint blue color, and is so faint that it''s in fact invisible at the very bottom


Depends on the chemical composition of your candle wax

Well, in the end, it''s about fine tuning colour and opacity values. And it''s partially because of the black background, in an actual 3D scene you see it much less. In fact, I had to amplify the colour contrasts, otherwise the flame got too transparent.

Share this post


Link to post
Share on other sites
Still, you need a little bit of turbulence...

Share this post


Link to post
Share on other sites

  • Advertisement