Rendering/Shading Project 4
Because the process for the T&L on the scene itself largely remains the same as the previous 3, and since most of the shader itself is code, we’ll look at the aspects of working within Renderman for Maya (RfM) with my sample shader and scene as context.
Compiling and Importing a Shader:
Once you have a coded *.sl file, you must compile it using the “shader” command. This is as simple as calling the program with the name of the file after it like “shader file.sl”. The file it outputs will be a .slo file with the name of the shader defined within the .sl file (not necessarily the name of the .sl file itself) which you can then pull into a RfM node. In my case, I will be using a combination of a displacement and a surface shader to create a look like a shiny coat of paint that is chipped away.
To pull in a Renderman shader, you use a Renderman shader node which RfM creates an entry for in the Hypershade window with the rest of your materials. Here is an example of the attribute windows of the two shaders I used, followed by another earlier one that has a varied opacity:
The attributes are empty when the nodes are first created and the “Shader” text box right under the Material Sample must have a valid .slo file loaded before it reads and presents the proper attributes. My surface shader has several fields to control color of the paint and the underlying surface while my displacement shader controls how much to displace and how much of the surface should be chipped.
Linking Surface, Volume, and Displacement Shaders:
Using a Renderman displacement shader at the same time as a surface shader is the same as it is in Maya normally–one must link the displacement shader into the “displacement shader” attribute of the Shading Engine. To make this link, from the Hypershade window, hold right-click over the surface shader and select “Graph Network”. From here, drag the displacement shader into the work area and use the connection editor to connect the “displace” attribute to the “displacementShader” attribute:
The same process can be used to link a Volume Shader to the Shading Engine as well. With all that complete with some tweaks of the attributes of the shaders, applying it to the object, and adding some lights and shadows we can see a sample of the shaders:
The Scene:
The scene used is #18 from the same site:
http://www.3drender.com/challenges/
I applied the shader from before to the robot’s main body. For the rest of the scene we should keep in mind that we can’t use the mia_material_x we’ve relied on for the earlier projects as they were MentalRay nodes. However, we can still get results by tweaking the render settings of RenderMan and setting up some environment lights.
First thing to do in a scene like this which will have plenty of reflections (for me, at least) is turn on Ray Tracing in the render options:
Also, I wanted global illumination effects because RenderMan’s color bleeding looks very good so at the bottom if you hold right-click in the text box next to “Environment Light”, you can create a environment light directly. Here’s an example of my environment light attributes I set up for the scene, of which most important is the shadow type change to “color bleed” and the sampling mode to “sampled”:
Another important thing to do is set up shadows in the scene. RenderMan will work with standard Maya depth map shadows (though I am not sure about Ray Traced shadows) but I prefer the RenderMan custom shadow attributes. To access these attributes, with a light selected under the lightshape tab, click the “Attributes” dropdown menu right above the tab listing and you will see “RenderMan” at the bottom of the menu. Hover over this and you can see “Add Shadow Attrs” as well as “Create Custom Shadow Map”:
The new attributes will be appended to the very bottom of your attribute listing, under Extra RenderMan attributes. The DeepShadow shadow type is generally better as it allows for a few extra features such as transparency. NOTE: Right under where the “Create Custom Shadow Map” option was is “Create Custom Deep Shadow Map”. From what I was able to tell, custom deep shadow maps are extremely expensive and not recommended until final render if you must use them.
Finally, when you are mostly done with your scene and are ready to do a full render, you should turn down the Shading Rate in the render options menu for a higher quality render:
This option usually defaults to 5.0, but 1.0 to 0.5 generally works from my experience. However, the extra time taken for a lower shading rate seems relatively small so turning it all the way to 0.1 or just rendering all the time at 0.5 might not be too much of an issue depending on your scene and setup.
Here is the end result of my scene:
About this entry
You’re currently reading “Rendering/Shading Project 4,” an entry on Boqian's DPA Stuff
- Published:
- April 28, 2010 / 5:39 PM
- Category:
- 607 - Rendering/Shading, Uncategorized
- Tags:










No comments yet
Jump to comment form | comment rss [?] | trackback uri [?]