At first, the opacity of the material needs to be determined to calculate the refractions and internal reflections. After all that happens however, the opacity needs to be set back to 1. This way when the renderer gathers all the Ci's and Oi's from the materials the glass won't look oddly transparent after being refractive (left sphere) rather than simply being refractive as glass is meant to look (right sphere).
The ball on the left has a "surface()" function for the primary diffuse calculations while the right ball has the "diffuselighting()" function.
I initially used "surface()" instead of "diffuselighting()" so that when the shader compiled it would compile as a surface shader and not a co-shader or displacement shader. If it did not compile as a surface shader Houdini would not read the color information properly and do either just the displacement or nothing at all. Rather annoying.
I continued using the "surface()" function in testing because I did not have to have the lights extraordinarily bright. Once I got into more complicated shaders, I had to start using the "diffuselighting()" function so that the renderer would recognize the specularlighting() function.
The basic displacement function is:
public void displacement(output point P; output normal N)
//initialize m_shadingCtx variable just in case it had been used before
//assign m_hump variable based on wavelet noise
exampleVariable = something_To_Make_It_Change_Like_A_Map
//displace based on m_hump
Which creates the sphere on the right. If the last "m_shadingCtx->init();" is omitted, the shader turns into a toon shader like the one on the left! Hooray for experimentation!
Site dedicated to my works done implemented in Houdini and rendered in Pixar's Renderman.
It includes comparative renders, hand written rib files, animated custom shaders, a scene with a custom coded iridescent shader, as well as a list of complications that I've run across in using Houdini and Renderman together.
The Maya Pattern Animation tab describes my process in creating a project with seashells that are procedurally generated with a python script based on a formula by Deborah Fowler. This is then implemented in Houdini and rendered with Renderman. The beauty and caustics layers are rendered in Renderman. All of the shaders are Renderman shaders. I scripted an iridescent shader which allows the artist to have complete control over the color, reflectivity, added noise, as well as facing ratio towards the camera so that they could control how much of the colors are seen. Below is a better quality video of that project.