- Make a new geo container
- Click on the gear to go into edit rendering parameter interface
- Filter the options by "rib"
- Add RIB Archive under Pixar's Renderman
- On your geo node, enter the file name into the newly added RIB Archive field
With Renderman in Maya, one is able to change a texture map or an attribute based on the name of the object it is applied to. In Houdini, this is done on the material node by adding local overrides. The user can alter any attribute on the chosen shader based on a group or on a stamped copy number.
Be careful when changing texture maps. These are passed in a strings rather than floats or integers so proper formatting is key: `"/path/to/file/filename" + number + ".tex"` Now the user can alter the number so that filename1.tex, filename2.tex, and filename3.tex are all accessible by the same shader and material node leading to quicker render times! Reference photos This is really a fake translucency shader meant to be applied to a single sided surface. The real challenge is forcing the directlighting() function to use the reversed normals. In the old style of coding, one could just say: Ci = Os * Cs * (diffuse(nf) + diffuse(-nf) * surfcolor); Meaning that the final color (Ci) is the apparent opacity, apparent color, and the diffuse of the front face added to the diffuse of the back face multiplied by the surface color. At first I was switching the normals within the directlighting() function and something just wasn't working with the diffuselighting() call to get Ci. After playing, the reverse of the normal was put in the displacement() function, the normal place to initialize normals to the shader, with the following lines of code. The normals were changed as well as the shading context, that holds the information for the material and object, were also inverted. N *= -1; m_shadingCtx -> m_Ns *= -1; Then came the brute force way of getting the lighting information. After gathering a list of lights, the light color and direction was returned from a modified plausible light shader. The modifications to the basic plausible light shader were to force it to return the color and direction of the light. This worked, but did not show shadows. Eventually I went back to trying the default method of lighting (directlighting()) to try and figure out the path between the material and the light to generate samples for shadows. I did not figure out the path because calling directlighting() returned shadows and translucent light information! float doReverse = 0; displacement(point P, point N) { if (doReverse) { reverse normals; } else normal normal initialization; } surface ( color Ci, Oi ) { frontColor = directlighting(); doReverse = 1; this -> displacement; backColor = directlighting(); Ci = backColor + frontColor; }
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.
Renderman has a way of programing shaders in RSL, by using classes. This allows a displacement shader to be in the same file as the surfacing function and for physically based shaders. I've been exploring these new shaders within Houdini, because Houdini is more fun than Maya. I found that I had trouble writing my shaders correctly because I did not understand how the renderer, the material and the light were working together to make the surface color. Plausible Constant The constant shader is just one constant color across the surface. It never has to access the light and therefore has just one constant color. Plausible Diffuse The plausible diffuse shader adds shading to the surface. It is like a lambert shader in that there is no specular or reflective quality. The material’s surface() function can be substituted with the diffuselighting() function without too much of a difference. The difference in the rendering can be seen here. The material’s diffuselighting() function asks the light to generate samples for the diffuse color and the shadow and those are saved as the Ci and outputed by the material. Plausible Specularity The plausible reflective shader is essentially like a blinn in that you may control the specular highlights and reflectivity of the object. The reflectivity is referred to as “indirect specular”.
The diffuselighting() and specularlighting() functions work by layering their Ci returns on top of each other: diffuse, reflection then specular. The material actually gathers the sampling information in that order, diffuse, indirect specular and direct specular. This was essential to know in order to separate out the controls for a softer reflection versus specular. As with most things in Houdini, this is a simple check box. Go to Edit -> Preferences -> Rendering and check the "Pixar's Renderman" check box. This opens up all the shaders and settings for Renderman. If you are newer to Houdini and/or Renderman, I suggest unchecking "Mantra" so that you don't get confused. To convert .slo shader files to something Houdini can read, use either Cutter (downloadable at www.fundza.com) and set up your paths and preferences or use the terminal and convert the .slo file using the prepackaged script. Type into the terminal window after navigating to where your shader is: slo2otl.py -l myshader.otl myshader.slo Then you will install the digital asset library into your hip file by going to File -> Install Digital Asset Library and all of your shaders will be accessible through the shop. Create a normal light in the network view by hitting the tab key and typing "light".
Make sure you have created your light shader in the Shop network, mine is called "plausibleSunlight1". Add your shader to the light material and control all light attributes except for position within the shader. This is for Houdini. It turns out that you can very easily map a shader attribute to a null object's position in reference to a point on the object. You could use this for making frost grow on an object. Pass in the object's name as a string, "/obj/null1". Measure the distance from the point to the origin of the null. // Makes a point in object space, not Make a ramp based on that distance to change whatever attribute. influence = smoothstep(0 + rampSize, radOfInfluence, d); If you are having difficulties getting the null or whatever object you are using to be recognized by the shader, check the name you are passing in. The easiest way to do this with a null is to check the only default checkbox in the render tab which allows the null to be written to a rib file. Then force the ROP to create a disk file and search the disk file for that string name.
Also note that when entering the name into the field in the shader, double quotes are unnecessary and will break your render. Just enter the name of the object: /obj/null1 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). |
Categories
All
Archives |