Shader override passes in RfM 2.0
Maya’s render layers have bugs. There, I’ve said it.
Some of our Renderman scenes had been losing their render globals tabs because of the bug, and because I love a challenge I decided to see if I could circumvent the Render Layer system and create a pass with a shader override -a task I would normally accomplish with a Maya render layer. RfM 2.0 supports Maya render layers and can set layer overrides for most prman nodes and attributes, but not for the render globals so it calculates each pass for each layer. If you have a subsurface object and an environment light in the scene be prepared to wait awhile while you raytrace occlusion or color bleeding for your characters’ subsurface pass. This sort of defeats the purpose of making separate passes. The solution? Make your own custom Rman pass.
Create a new Final pass, call it whatever you want. On the Pass Settings tab, add the following attributes:
Expand Surface Shader
Custom Shading Group
Uncheck Expand Surface Shader and add a shading group to the Custom Shading Group attribute; add a shader. If need be, attach a current shading group node and connect the SG message to the rman__torattr___customShadingGroup attribute – make sure to show hidden nodes before you do this in the relationship editor. Here’s the shader I sometimes use:
surface occlfunction(float samples = 256, maxvariation = 0.02)
{
normal Ns = faceforward(normalize(N),I);float occl = occlusion(P, Ns, samples, “maxvariation”, maxvariation);
Ci = (1 – occl) * Cs * Os;
Oi = Os;
}
Not so fast there, you’re not out of the woods yet. I used occlusion as an example here primarily because it’s a pass that you need to invoke ray tracing for, where your other passes you might not need it on. You’d think that just adding a “ray tracing” attribute to the occlusion pass your just created would be enough to make the pass render correctly, but it will error out with a message that ray tracing needs to be on. Set it on in the globals and add the ray trace attribute to your beauty pass and uncheck it. Seems a little backwards, but your scene will now render its passes correctly, and only trace those passes that you check it for.
Lastly, be careful using the command “delete unused nodes” in the hypershade; any shaders you’ve assigned directly to Rman passes will be deleted.

Renderman for Maya’s does have some shortcomings though; for example a custom pass will still receive shadows from objects that aren’t rendered, though you would expect them to not be affected by invisible objects.
1 Comment
Jump to comment form | comments rss [?] | trackback uri [?]