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 photorealistic 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.
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.
Let's see some more images before we start:
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:
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:
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.
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:
And for tons of bubbles:
Also check out my rendered sun glasses:
I also tried different environment maps but I like the first one the best.
Just to see what happens I rendered these cool bubbles:
[1] Andrew Glassner’s Notebook: Soap Bubbles
Part I &
Part II
http://www.glassner.com
[2] Wikipedia
http://en.wikipedia.org/wiki/Soap_bubble