We wanted volumetric emission involving fire in our scene. This led to a number of ideas - Solar system with glowing Sun, Lightning, Northern lights etc.. But when we asked ourselves - What is it that has fire and looks pretty great at the same time? The answer was simple - fireworks. While growing up, we would play with sparklers - a handheld firework that burns slowly while emitting sparks, flames. Sparkler is quite intriguing among all fireworks, thanks to their secondary sparks (highlighted in feature 2)

Some pictures of sparklers that motivated us in this direction are as below,

Behind the scenes

The most important element of a sparkler is it’s spark. We modeled a simple spark by volumetric rendering of a cone. Our volume integrator finds the entry and exit point of the cone and computes the radiance by ray marching. We form a group of sparks by adding more instances through matrix based transformations. We wouldn’t want the image looking too uniform and dull now, do we? So each cone is specified to have it’s own emission/flame color and density.

A carefully crafted the scene is built while adding randomizations factors for flame/spark size, color, density, and orientation. As a holder for fire sparks, we add a lambertian material cylinder as stick. It reflects the light emitted by the fiery flames. Some minor details such as adding inversely oriented sparks at places, or sparks flying in the air add an element of liveliness to the scene. Some highlights of the scene are,

Spark as an emmissive cone

Demonstration of simple spark by volumetric rendering of a cone. Note the variation of brightness at base, edges and tip due to ray marching

Secondary Sparks

Group of sparks that originate at the end points of first level sparks are unique to this kind of fireworks and crafted using affine transformations

Illumination of sticks

Sparkler sticks are glossy (phong) near flames and diffusive(lambertian) through the length

Step size variation

Based on the density specified for the spark, the number of steps in ray marching is varied, thus producing varied brightness of flames

Instancing of Sparks

We reduce memory footprint by geometric transformations of few flames for efficient rendering

Controlled randomization

We use normal distributions for rotation angles so that primary flames (which have secondary sparks) point upwards. We use uniform random distribution for other randomizations - spark orientation, length, density etc..

Background distant lights

The background has emissive spheres that simulate distant (blurred) light sources