From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Videos

Vimeo album

Basic Idea

Fire is a common natural phenomenon and as such deserves a place in a good 3D modelling software package.

My system aims to provide a simple, flexible and efficient way of simulating and rendering fire inside Blender. The main idea is to break down fire into individual flames, which show the physical behaviour of hot gas clouds moving in an external wind field and render them using a volumetric material. To my knowledge this method was first implemented for production in 2002 by DreamWorks for their movie Shrek (original paper). I adapted and modified this approach to better fit the existing tools and features in Blender.

Several other attempts to simulate and display convincing fire effects in Blender have been made, which all have their pros and cons:

Fluid simulation
This is a very general approach, which can create physically correct and very detailed simulation of the behaviour of gases and liquids (i.e. fluids).
The main problems are lack of artistic feedback (data has to be precalculated to see results) and scalability (large fires need huge amounts of time and disk space and thus become impractical)

Here are some fire effects done with Blender's smoke simulator ("gas simulator" might be a more appropriate name):
* Flame thrower
* Torch
Procedural textures
Relatively quick way of "faking" fire by using turbulent textures and emissive lighting. While possible to create with very simple and reliable methods, it is not very flexible and/or controllable (mostly produces flames in one direction).
The most advanced application of this technique i have seen so far can be found here:
* Procedural texture fire

In contrast, the main advantages of the new method are

  • Controllability
    Using force fields and colliders, an artist can easily influence the behaviour of flames. A wide range of fire types can be created by modifying parameters, such as flame temperature and turbulence. Since Blender 2.5, all such values can be animated over time, which allows to change the behaviour and appearance of fire on the fly. The behaviour of each flame, while being turbulent and pseudo-random, is completely repeatable, so no unpleasant surprises have to be expected.
  • Visual feedback
    Each flame is displayed in the realtime 3D scene view in Blender to allow feedback and corrections without having to wait hours for the result of a calculation. Even with very large fires it is possible to precalculate to a disk cache, so the resulting fire can be watched in realtime before rendering.
  • Modularity
    Being based on particle systems, several other effects regarding fire could be easily coded and/or linked to the flame particles, such as smoke, sparks, burning/melting, light, sound, etc..
  • Efficiency
    Large scale fires, like burning buildings or even cities can be simulated with little space and time requirements. Big fires can be cached to disk to allow smooth realtime playback.

However, it also has it's limitations, which shall not be kept secret:

  • Range of effects
    While a full-blown fluid simulation can create about any hot gas effect existing in the physical world, this system is only really suited for open fire of standard burning materials. For example it is not feasible to create an explosive fireball or other high pressure gas effects. For these kind of things the fluid simulation works much better.
  • Accuracy
    The simulation of fire by individual flames with restricted interaction only produces pseudo-physical behaviour. While it creates a convincingly looking fire, it cannot completely realistically generate the small-scale details like a fluid solver.