NTU-CSIE Rendering Final Project
-Soap Bubble Material-
ID : B97902080
Name : Ke-Wei Chen
Environment : 217 workstation
About The Theorem
About the "rainbow" color on the surface of soap bubble,
it is because the interference of rays, which is brought by the thin thickness
of the soap bubble's membrance. Besides, different thinckness will generate different
color, the main reason is that when a ray go through the membrance and reflect from it,
the wave will have phase difference, and the effect has something to do with wavelength of
the mix ray. Some paper provide formula and algorithm  to compute the reflection intensity from
soap bubble, which is the function of wavelength and thickness.
After solving the rainbow color of bubble surface, I observe the realistic bubble
, a soap bubble has both reflection and transmission, but we can ignore the refraction because the
thickness of membrance is just 50nm ~ 1200nm. Therefore, we can simplify the transmission term.
Finally, we have to produce the noise just like wood grain, and make it be thickness map. So, I use Perlin Noise to generate it.
Implementation with PBRT
First I create a new material, which is similar to glass, but I set the refraction index of
specular transmission to be 1.0. Besides, I create a new BXDF called "SpecularInterference" to replace the
specular reflection. In SpecularInterference, I set the thickness and implement the interference formula.
In the formula, I use the function "Fresnel" and "Noise"(perlin noise) to modify the intensity.
Actually, I have some trouble when implement the formula. Because it only record RGB spectrum in PBRT,
it do not save the wavelength of mix ray. So, I use some naive method to avoid the problem, that is, I use
wavelength (700.0, 546.1, 435.8) to estimate the (R, G, B) wavelength, and modify it by some tricky method.
above is a spectrum distribution with blue light, and there is some paper transform RGB to spectrum distribution,
but I did not implement it :(. Besides, I have no time to implement the geometry of bubble. It is a pitty!
Glass without refraction
My bubble with uniform interference
My bubble with perlin noise
Some funny result with another model
 Glassner, Andrew. Soap Bubbles: Part 2. IEEE Computer Graphics and Applications, Volume 20 , Issue 6, Pages: 99 - 109, Year: 2000
 "CIE 1931 color space", Wikipedia, http://en.wikipedia.org/wiki/CIE_1931_color_space#Definition_of_the_CIE_XYZ_color_space
 Fresnel Equation