The frosted glass shader was my first attempt at writing a shader that other artists could use. It was written using the RSL2 extensions to the RenderMan Shading Language. Implementing a class based shader makes it surprisingly easy for the shaders (internal) instance variables to be shared by the methods that are called within the shading pipeline.
Frosted glass reference
User Controls: color, frost color, spec color, spec and reflective gain and roughness, internal reflections, index of reflection, displacement amount, and specific frost controls. The frost is based off of a noise pattern, with user controls, the amount of frost and at what space the frost is coming from.
By entering the name of a null (Houdini) node into the shader, the user can move the frost around. The animation above shows frost “growing” on the teapot. This was done by animating the radius of influence of the null node which is explained more here.
The ramp that is the change from glass to frost is also controllable and the influence does not have to be smooth, it can change from a straight edge to a noisy one.
For additional functionality I plan on allowing the user to input an image of their own frost. The frost is currently based on wavelet noise, controlled by user input, but it is still not completely under the user’s control.
There is also a test to see if the color was greater than 1, at which point the surface color was defaulted to white. It would probably be a better idea to have three separate if statements checking each rgb value and setting them individually because that would be somewhat awkward to have a white pixel where it should be red since the green and blue values were also changed.
By entering the name of a null (Houdini) node into the shader, the user can move the frost around. The animation above shows frost “growing” on the teapot. This was done by animating the radius of influence of the null node which is explained more here.
The ramp that is the change from glass to frost is also controllable and the influence does not have to be smooth, it can change from a straight edge to a noisy one.
For additional functionality I plan on allowing the user to input an image of their own frost. The frost is currently based on wavelet noise, controlled by user input, but it is still not completely under the user’s control.
There is also a test to see if the color was greater than 1, at which point the surface color was defaulted to white. It would probably be a better idea to have three separate if statements checking each rgb value and setting them individually because that would be somewhat awkward to have a white pixel where it should be red since the green and blue values were also changed.
Frosted Glass Shader |