Final Project - Genie coming out of a Oil Lamp

Ramesh Balakrishnan
Kanishka Shrivastava


Our aim for this project was to render a genie coming out of a lamp, placed in a desert. The model for the lamp was based on the proposal image, while the desert texture was procedurally generated, and the genie was selected both for thematic aptness and the ability to demonstrate subsurface scattering.

Techniques implemented

Subsurface scattering

We followed the algorithm outlined in [1]. The steps involved are the following:

Uniform sampling of points on the mesh (Turk's algorithm)

Improved photon mapping for efficient generation of caustics

While pbrt does have support for photon mapping, the method implemented is generic, and was found to be quite inefficient for our situation. We added the following two improvements to the caustic photon map generation:

Volumetric effects of the oil

The oil/glass and oil/air interface together defined the volumetric extent of the oil. We model the oil as a homogeneous participating medium with in-scattering and attenuation effects. Since pbrt has support only for cuboidal shaped participating media, we had to extend it to support arbitrary shapes. The geometry of the oil was defined as a loop subdivision surface and we used an internal kd-tree to efficiently find intersections of rays with the mesh (this resulted in significant speedups). In the process, we also found a bug in pbrt - the image doesn't render properly (a large number of pixels are assigned radiance values of 0) whenever a volumetric medium coincides exactly with a primitve in the scene (in our case, the oild medium and the oil primitive itself). To get around this, we scaled our medium by a small amount.
Defining the oil as a volumetric medium contributed to making it look far more realistic.

Texture mapping for the sand

The sand texture was modelled using Perlin noise as follows: It took some experimentation to get the look of the sand right.


Genie and the Oil Lamp

Caustics: Detail


  1. A rapid hierarchical rendering technique for translucent materials.
    Jensen, Buhler. Proc. of SIGGRAPH 2002
  2. A practical model for subsurface light transport
    Jensen, Marschner, Levoy, Hanrahan. Proc. of SIGGRAPH 2001
  3. Generating Textures on Arbitrary Surfaces Using Reaction-Diffusion
    Turk. Proc of SIGGRAPH 1991