[Bf-committers] fire simulation

Lukas Tönne lukas.toenne at googlemail.com
Fri Jan 8 10:02:16 CET 2010

> +1

Thanks a lot, a thumbs-up from you is a great motivation :)

> I found very interesting your proposal and while the current
> simulator and volumetric rendering could achieve very cool fire effects I
> think a dedicated simulator will be much more artist friendly and usefull,
> so go ahead! is a very nice project.

Yes, these two simulators would cover different kinds of combustion:
while the smoke simulator is best probably suited for large and highly
turbulent gas clouds, the fire simulation is designed for burning
_objects_, i.e. a constant, slow release of gaseous fuel (usually
above a solid surface). It's very difficult to achieve the desired
effect on a large scale with a grid-based fluid simulation, since the
resolution would have to be incredibly high in order to depict
individual flames. On the other hand, making large explosions and the
like is best done with a fluid simulation.

Some more design considerations:
- I would like to use particle systems as input for flame simulation:
    * Each particle emits a flame. (Not all flames need a particle
though, for when a flame reaches a certain height ("persistent flame
height"), it may flicker and split off a free, non-particle flame,
which quickly dies away as it uses up it's fuel.)
    * When a particle dies, the emitted flame also dies (which means a
depletion of local fuel supply)
    * Particle size determines flame fuel, i.e. translates to flame
size and temperature (have to figure out the details here)
    * It might be useful to allow a custom mapping from particle props
to flame props
- The "domain" for the fire simulation is different from fluid
simulation domains, because it doesn't use a fixed grid like fluid
simulation. A nice side effect is that flame simulation is not limited
in space! The domain object will just provide a relative coordinate
system for the fire, i.e. all source and obstacle motion will be
defined in relation to that object.
- Any object with a particle system should be able to emit flames on
another objects. AFAIK the fluid simulations simply take into account
all objects in the same layer with a inflow/outflow/obstacle modifier,
right? I'm not really happy with this kind of system though, because
layers should be logical groupings and not simulation related. I think
i saw some commented-out lines with "fluid-groups" or so - is that a
planned feature? If so, it could be generalized to "simulation groups"
in which all objects are allowed to interact with each other (also for
fluids). Comments?
- I made a first test for rendering flames, using point density
texture filled with particles along the flame filaments:
(http://img97.imageshack.us/img97/7067/firetest001.png). The use of a
point sample buffer for the texture instead of directly accessing
texture values from the filament buffer is necessary because
    a) it is (probably) more efficient to access a bvh tree than to
evaluate the filaments every time (which involves some nasty function
evaluations and iterative procedures for finding spline distance,
    b) in order to apply turbulence to the flame density, one would
have to integrate the turbulence function, which again is expensive
and tricky.

So much for the design. My next step will be implementing flame
emission from particles. After that i'd like to implement the filament
simulation and then rendering to get something to show off ;)

More information about the Bf-committers mailing list