Iman Sadeghi 's Homepage

Welcome to Iman Sadeghi 's Advanced Appearance Modeling Course Project Homepage!

This is the first project for CSE272 "Advanced Appearance Modeling" taught by Prof. Henrik Wann Jensen in Fall 2007.

1.Project Description
The goal of this project is to model the appearance of Soap Bubbles. A soap bubble is a very thin film of soap water that forms a sphere with an iridescent surface. To achieve a photo realistic rendering of soap bubbles and in general thin films one has to consider the wave-nature of light and the interference between different wave-lengths.

First I start by some rendered images and then I will describe some technical details.

2. Rendered Images:
First I let you decide which one is a photograph and which one is my rendered image:


OK! I hope you chose my rendered image as a photograph! :-)
The answer is that image to the left is a photograph [2] and image to the right is my rendered image.

Lets see some more images before we start:




3. Technical Details:
3.1. Modeling
Bubbles have this interesting property that wherever they touch each other it should be 120 degree angle. Also the surface of the bubbles is always a portion of some sphere. [1] With some simple math one can find out the radius of the sphere which forms the boundary of two (and in general n) number of bubbles:

The result is simple:

I made the phisically based geometry of my bubbles in Maya. The fact that "when you have to intersecting bubbles you can look at them from the side to see the intersection as a straight line" made the modeling process much easier for me. For having 3 attached bubbles I had to consider 6 spheres and 9 sphere-sphere intersections. These are some snapshots from Maya in the process of making my three joined bubbles


3.2. Rendering
A soap bubble is a very thin film of soap water that forms a sphere with an iridescent surface. [2] For rendering soap bubbles and in general thin films one has to consider the wave-nature of light. As shown in the Glassner's Notebook [1] the relation between the outgoing light intensity and the intensity of incoming light can be calculated by:

Where Rf is the Fresnel term and theta is the refracted angle, w is the width, no is the ... and lambda is the wave length. Since the outgoing light depends on the wave length we will get all those pretty colors on the sphere.

By plugging this formula and accounting for the Fresnel term you will get a bubble but something is wrong with it. It is just perfect! Usually, bubbles are thinner at the top and thicker at the bottom. Adding this effect is necessary but not sufficient. At the end I added Perlin noise to the width of the bubble to make it more realistic.

Fresnel Bubble - Perfect Bubble - Final (Noisy) Bubble

If you sample only Red () Green () and Blue () light. You will capture the appearance of the bubble almost correct but for making it more photorealistic one has to sample the visible spectrum and integrate over all the wave-lengths. For converting Spectrum values to RGB I converted the Spectral values to XYZ color coordinate and then I converted the XYZ to RGB. I rendered my bubbles assuming that the incoming light from all directions has all the wave-lengths in the visible spectrum. At the end I tried the light from the sun (D65) as well to see of I can get more realistic images. Here is the results for my three-joined bubbles:

RGB - Spectra - D65

And for tons of bubbles:

RGB - Spectra - D65

Also check out my rendered sun glasses:

Sun Glasses

4. More Images!
I also tried different environment maps but I like the first one the best.

Environment maps are form: Light Probe Image Gallery

4. Having Fun!
Just to see what happens I rendered these cool bubbles!

Bubble Bunny - Bubble Dragon

[1] Andrew Glassner’s Notebook: Soap Bubbles Part I & Part II
[2] Wikipedia