RMS
|
Introduction
This tutorial demonstrates how to assign a custom light source shader to a
Maya light when using Pixar's RenderMan Studio release 2, 3.0.0 and 3.0.1. |
Listing 1 (shd_distant.sl)
Compile the source code and save the .slo file in a location convenient for use with Maya. |
RenderMan Studio 2.0 & 3.0.0Assigning the ShaderCreate a directional light source in Maya. Ensure the light is selected and then open the Attribute editor. From the Attributes menu select "Add Shadow Attrs" and "Add Custom Light Shader" - shown below. |
|
|
Click the "Use Depth Map Shadow" checkbox - figure 3. The "controls" for the attributes will be displayed at the bottom of the editor - figure 4. |
|
|
Checking the Deep Shadow PassTo confirm a shadow map pass will be generated open the "RenderMan Controls..." window, available from the main RenderMan menu, and choose View->Pass Settings Tree. You should see "DeepShadow" - figures 5 and 6. |
|
|
As a result of adding the shadow attrs the RenderMan for Maya (RfM) plugin will, at render time, generate a deep shadow pass rib file. The name of the map will be prefixed with the name of scene and the name of the light, for example, a typical (relative) path might be, renderman/SCENE_NAME/data/0001/SCENE_NAMELIGHTNAME_DeepShadow.001.tex Assigning the Custom Shader
Click on the checker box beside the "Custom Light Shader" text
field. The attribute editor will display a RenderManLight tab. Browse and
select the
Referencing the Deep Shadow TextureIn the "shadowname" text field enter the following TCL command. [passinfo [subst $OBJNAME]_DeepShadow filename] Be very careful not to accidentally add white space before or after the outer square braces. At render time the TCL expression will be evaluated and the full path of the shadow map will be assigned to the "shadowname" parameter. For example, LightSource "PATH_TO/shd_distant" "RenderManLight1" <OTHER PARAMETERS> "string shadowname" ["PATH_TO/LightShape1_DeepShadow.001.tex"] Specifying the TCL Expression in the Shader SourceTo avoid burdening a lighting artist with the chore of entering a TCL expression in the "shadowname" parameter it might be useful to assign it as the default value. |
shd_distant.sl (modified)
|
RenderMan Studio 3.0.1Assigning the ShaderCreate a directional light source in Maya. Ensure the light is selected and then open the Attribute editor. From the Attributes menu select "Add Custom Deep Shadow Map" and "Add Custom Light Shader". |
|
|
Do NOT check the "Use Depth Map Shadow" checkbox - figure 10. The "controls" for the attributes will be displayed at the bottom of the editor - figure 11. |
|
|
Click on the checker box beside the "Custom Light Shader" text
field. The attribute editor will display a RenderManLight tab. Browse and
select the
Referencing the Deep Shadow TextureIn the "shadowname" text field enter the following TCL command. [passinfo rmanDeepShadowPass filename] Specifying the TCL Expression in the Shader SourceTo avoid burdening a lighting artist with the chore of entering a TCL expression in the "shadowname" parameter it might be useful to assign it as the default value. |
shd_distant.sl (modified)
|
© 2002- Malcolm Kesson. All rights reserved.