Sunday, 10 February 2013

Renderman Shading Language

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.

Sunday, 20 January 2013

Testing Secondary Effects

In studying how soap bubbles burst, I discovered that when it happens the bubble breaks into much smaller molecules. I have done a test in Maya to see if I could recreate this phenomenon. I did this using the black and white gradient from the previous tests as an nParticle emission map with the paricles emitting from the dark areas of the gradient. This would make it look as if the particles are being emitted as the bubble is bursting. The results of this test can be seen in the video below.


Maya Bubble Burst Secondary Particles Test from Mickey Bowen on Vimeo.






The idea for this test came from a video by Youtube user "Joseph Sohby". However, the video he made is not in English but I just watched what he did and tried it out myself. He also used particles to drive a lattice deformer on the bubble geometry, which is something I am also planning to try.


Wednesday, 16 January 2013

SOUP Dev - Cage Node

I have recently discovered a set of nodes to extend the functionality of Maya called SOUP Dev from soup-dev.com. One of these nodes which I have become interested in trying out is the Cage node. This node takes two pieces of geometry, one which acts as the clipping boundary and the other which gets clipped. Which ever part of the geometry falls outside of the boundary gets its polygon faces deleted.

I thought this node may come in useful for creating the effect of bubbles bursting, which I intend to test further. But for now, here are some of the examples which the SOUP Dev provide.




Saturday, 17 November 2012

Plateau’s Laws

I have recently been looking into some principles of physics known as “Plateau’s Laws”. These laws were introduced by Belgian physicist “Joseph Plateau”. These laws state the following:-

  • Three bubbles intersecting must always do so at angles of 120 degrees. These are known as “Plateau Borders”.

  • Each Plateau border intersects in fours at one point at approximately 109.47 degrees.

  • Soap film surfaces are entirely smooth.

  • The mean curvature of the soap film is constant on every part of the film.

I also found a blog on WordPress called “WeWantToLearn.net” which has an article discussing these laws and applying them within a program called “Grasshopper”. This is a graphical algorithm editor integrated inside another 3D program called “Rhino 3D”.

Sunday, 11 November 2012

Another Test (Take 2)

I have carried out the same test as before, but this time with a higher particle count. This was done by using a higher poly sphere. I decided to do this because after meshing the first one, I noticed that the mesh turned out a bit too blobby, which I didn’t feel looked good enough. Another thing I noticed was how the particles were being meshed. When I meshed the particles created by using the “Fill Object” command, it meshed around the particles. When I meshed the particles created at each vertex of the polygon sphere however, it not only meshed around the outside of the particles but also on the inside as well. This could pose a potential problem in terms of shading the bubbles. The reason being because of the fact that bubbles are of course transparent, which means that the inner mesh would be visible when rendered.



I also meshed the second attempt and I’m more pleased with the results of this one. However, I still need to play around with the output mesh attributes in Maya a little bit more.


Maya Bubble High Particle Count from Mickey Bowen on Vimeo.

Maya Bubble High Particle Count Meshed from Mickey Bowen on Vimeo.

Wednesday, 7 November 2012

Another Test

I have done another test in which I attempt to recreate the effect of a bubble bursting. The first step of this process involved the use of a Python script which was written last year as part of a class exercise for my Scripting for Animation module. This script takes a user specified piece of polygon geometry, looks at each vertex in turn, gets its position in world space and places an nParticle at each vertex. I ran this script on a polygon sphere in Maya, to recreate the objects form with nParticles.




Next, I created a gravity field and applied it to the particles, set its volume shape attribute to "Sphere" and positioned it around the particles. I then checked on the "Volume Exclusion" checkbox, so that gravity would only have effect on the particles outdie of the sphere volume. Finally, I created a radial filed, set its volume shape to "Cube" and key framed its translation and scale so that it moved through the particles causing them to scatter.



The final result can be seen in the video below:-



Maya Particle Bubble Burst Test from Mickey Bowen on Vimeo.

Sunday, 4 November 2012

Bursting Bubbles

I have been looking into how soap bubbles burst. I have discovered this is caused by a phenomenon called "Surface Tension". This is where a liquid surface has resistance against an external force. This is what gives a soap bubble its form. I have also researched into a principle called "LaPlace's Law". This law states that the larger the radius of the vessel (in this case being the soap bubble), the larger the surface tension needs to be to withstand the internal pressure.


I have also tested an idea for simulating the effects of a bubble bursting in Maya. I created a simple polygon sphere primitive, assigned it with a blue Blinn shader, assigned a black and white ramp node into the transparency attribute of the shader and animated the position of the colour sliders of the gradient.




Maya Bubble Burst Test from Mickey Bowen on Vimeo.

I found a video by a Vimeo user by the name of "Scubedio" in which a bubble bursting is simulated using Realflow 2012.

Soap_Bubble from scubedio on Vimeo.