Based on the first-in-first-out principle, vertices are stored in a new array called ``New Vertex List'' in the order in which vertices fall in the bounding sphere’s radius. This re-ordering is necessary to prevent the mesh from spawning fire from random vertices. As they are added, each vertex is assigned the following attributes and saved in a data structure called ``Mesh Propagation Data'':


  1. Mesh Vertex – The world space position of the vertex

  2. Vertex Temperature – The initial room temperature of the vertex. Its range is set to begin between the ranges 24 to 33 degrees Celsius. This temperature drives the color of the flames through a material node called “Blackbody”.

  3. Vertex Fuel – The starting amount of fuel for each vertex. Its range is set to begin between the ranges 80% to 120% of the mesh’s overall fuel amount. This allows variations in the rate at which flames die out.

As vertices are added to the New Vertex List, the system runs the thermodynamics calculations at every Event Tick. At each event tick, operations relating to each vertex and its parent mesh are run in sequence:


  1. Spawning fire – Each vertex in the order in which it is added (First-in First-out) to the New Vertex List is checked to see if it is burning or burnt. If either states are false, the vertex’s temperature value is incremented. With each iteration, the vertex’s temperature continues to rise. As soon as it reaches the Ignition Temperature value or above, a particle emitter is spawned at the vertex location. Once spawned, the vertex’s state is changed to burning and its fuel value begins to reduce. The type of spawned fire is determined in the IA class’s constructor.


  2. Following the spawning of a fire emitter on a vertex, the vertex's state is updated at each event tick. The following describes the various state updates:

    • State check - Vertex is checked to see if it has not burnt out. A vertex is flagged as burnt out when its fuel is zero or below zero.

    • If it has burnt out, the particle emitter attached to the vertex is removed from the system to clear memory space.


    • If it is still burning, the vertex's temperature is incremented at each event tick. The temperature of the vertex affects the color of the flame.


    • An actor (interactive mesh) that is on fire has an invisible ray-trace box surrounding it. The actor actively checks to see if its own ray-trace box is overlapping ray-trace boxes belonging to other meshes. Two actors with overlapping ray-trace boxes indicate proximity between them and that their vertices can ignite each other. Once a vertex is on fire, it constantly checks for vertices belonging to other actors. The vertex with the closest proximity will catch fire. Both the ray-trace box size and the minimum ignitable distance between two vertices can be set by the designer. If there are no meshes within ignitable range, fire will not propagate to other meshes.

  3. Once an actor (mesh) has caught fire, it is subjected to material degradation. This will be elaborated more in the next section.

As the bounding sphere grows, it checks to see which vertices on the scene mesh, stored in the ``Original Vertex list'', are coming within its radius. The bounding sphere continues to grow until it envelops the entire mesh’s bounding collision box.

In the visual demo, an actor class called an ``Interactive Actor’’, hereinafter referred to as IA, was created to contain a script that runs the propagation and also allow the designer to assign a mesh, surface type information, material/texture and essential thermodynamic properties. This self-contained actor class allows a mesh to interact with fire.


The IA accepts user input with a click of the left mouse button. When an IA is clicked, it cannot be clicked again. While an IA object can in reality be set fire in multiple locations, implementing it posed technical challenges. Thus, a constraint was imposed to simplify the propagation system by allowing only one source of propagation per IA object.


Using the mouse input, two hit results are extracted, namely, “Location” and “Hit Actor”. The location refers to the position of the mouse click at world space and the hit actor is the IA object (or the 3D mesh) the user clicked. This hit actor is stored and referred to as “Scene Mesh”. The scene mesh’s vertex positions are stored in an array called “Original Vertex List”. The system computes the closest vertex to the click on that scene mesh and stores that single vertex’s position as “Source Vertex”.


















At this point, an invisible bounding sphere is spawned at the location of the source vertex. This bounding sphere’s radius is incremented by a value called Sphere Increment, which set in the IA class constructor. The rate at which the sphere increments at every system tick is determined by the Ignition Delay value. Objects which catch fire easily have higher values for the Sphere Increment & lower Ignition Delay.  This means more vertices are engulfed by the Bounding Sphere at a faster pace. On the other hand, a lower Sphere Increment value with high Ignition Delay results in a slower pace of vertices catching fire. Together, these two values simulate the aesthetic “feel” of objects catching fire and burning, either slower or faster.

After the initialization, an object is ready to be interacted with. Interaction is via a user input, e.g. left mouse click. The location of the mouse click is stored as the source point for fire to spread throughout the object. Following the mouse input, there are two operations are carried out:


  1. Two invisible expanding spheres, first one called bounding sphere and a second one called cooling sphere are spawned at the source point

  2. A ray trace box enveloping the object checks for overlapping ray trace boxes belonging to other objects of the same class. The use of the cooling sphere is explained in section 3.5 under Material Transitioning.


During the first operation, the expanding bounding sphere checks for vertices falling within its radius. Using a First-In-First-Out approach, the enveloped vertices are added to a data structure array list called “propagation list”. Each element in this propagation list contains the location of a vertex, corresponding vertex temperature and fuel values, a particle emitter component, and two Boolean states to check if a vertex has been triggered to spawn a fire emitter and if the vertex has burnt out. Each element in the array list is also a propagation data as it tells the system where to spawn a fire emitter and what to do with it. The invisible sphere continues to grow until all the object’s vertices have fallen within its radius and been added to the propagation list.


In the second operation, the selected object’s ray trace box checks for any overlapping ray trace boxes other objects of the same class. Any overlap means that there is an object within range for fire to spread to.


At every frame interval, the system checks if there is an element added to the propagation list. If there is a new element, it spawns a particle system component (fire emitter) and adds it to corresponding data structure element in the propagation list. The vertex is also marked as triggered. Once added, at each frame interval, the vertex temperature value is incremented while the vertex fuel value is decremented. The vertex temperature contributes to the color of the flames while vertex the fuel value determines how long a flame will continue to burn at the vertex location. When the fuel value reaches zero, the vertex is marked as burnt and the particle system component is removed from the data structure to free allocated memory space.


A burning vertex constantly checks the distance between itself and the vertices belonging to the objects with overlapping ray trace boxes. Basically, it is checking for the closest vertex of the closest mesh. The closest vertex has to be within a certain distance for it to catch fire. If not, the mesh remains unscathed. If the closest vertex falls within the specified distance, that vertex is ignited and the whole process of propagation is repeated. See below for a bird’s eye view of how the propagation script works.

Propagation System

© 2018 by Sanath Shekar.

This site was designed with the
website builder. Create your website today.
Start Now