As part of my tool, I intend to write a shader to replicate the effect of thin film interference which as previously mentioned is one part of a soap bubble's appearance. To help with this, I have bought a copy of "The Renderman Shading Language Guide" by Rudy Cortes & Saty Raghavachary.
Rudy Cortes is a shader writing TD who has worked on such feature films as:-
- The Day After Tomorrow (2004)
- Sky Captain and the World of Tomorrow (2004)
- The Ant Bully (2006)
- Meet the Robinsons (2007)
From what I have read so far, the book contains various mathematical operations, such as the dot product. This is used in shading to calculate the light contribution from the scene lights onto the surface shader.
"If the two vectors are parallel and point towards each other, the angle between them is 0, and the dot product returns 1 (cosine of 0 - 1). If the vectors are perpenduicular to each other with an angle of 90 degrees between them, then the dot product will be 0 (cosine of 90 = 0)." - The Renderman Shading Language Guide (2007) by Rudy Cortes & Saty Raghavachary - Chapter 5: Math for Shader Writers.
The way it works is the x, y and z of two different vectors are multiplied together respectively and then all added up together.
The dot product notation is written as two vectors with a dot in between them.
For example:-
v1 = [1,2,3]
v2 = [4,5,6]
v1.v2 = (v1x * v2x) + (v1y * v2y) + (v1z * v2z)
v1.v2 = (1 * 4) + (2 * 5) + (3 * 6)
v1.v2 = 4 + 10 + 18
v1.v2 = 32
I also intend to research further into the details of how light works in terms of refraction and reflections etc.