3.10 The RenderMan Code Node
| 3.10.1 RenderMan Code Overview | ||
| 3.10.2 RenderMan Code User Interface |
3.10.1 RenderMan Code Overview
To shade an object, it is possible to attach a RenderMan shader node to it, and it is also possible to do nothing special, in which case 3Delight for Maya will translate the Hypershade shading network attached to the object to a human readable RenderMan Shading Language shader. Sometimes it is also nice to have a little bit of both; this is possible with the RenderMan Code node.
The RenderMan Code node is a utility Hypershade node provided by 3Delight for Maya that allows insertion of RenderMan Shading Language code in the Hypershade network. This means that it is possible to provide any Maya Hypershade node the result of any RenderMan Shading Language computation.
To create a RenderMan Code node, simply click on its icon, which is located in the General Utility section of the node list in the Hypershade.
Refer to the following rendering guidelines for examples on how this node can be used:
- Using Attributes to Export Primitive Variables
- Exporting Per-Vertex Attributes on Polygon Meshes
- Exporting Particle Attributes
3.10.2 RenderMan Code User Interface
When a RenderMan Code node is selected, the following gadgets are displayed in the Attribute Editor:
|
- ` Shading Parameters'
- This attribute lists the parameters for the node. This attribute will define node plugs and shader parameters for the node. Once defined, the Parameters panel will list the input and output plugs. To edit this attribute, click on the Edit in Text Editor button next to it. The parameters need to be declared each on its own line. The following parameters can be defined:
- ` type name'
- This will define an input plug of type type and name it name. type can be one of the following:
- float
- float2 Used for arrays of 2 floats
- float3 Used for arrays of 3 floats
- string
- ` output type name'
- Prepending `output' to a plug definition defines an output plug. See input plug definition for details about the type and the name.
- ` shader_input rsl_type name'
- This keyword is not used to define a plug for the node, but instead it will define a shader input parameter (i.e. a parameter that can be fed a value through the
RiSurfacecall). rsl_type is any legal type in the RenderMan Shading Language. When a parameter value is expected to change during the object shading, it is recommended to prependvaryingto the type name. The variable name is specified by name. - ` shader_output rsl_type name'
- This keyword is used to define a shader arbitrary output variable (AOV). rsl_type is any legal type in the RenderMan Shading Language. The variable name is specified by name.
- ` Shading Code'
- This attribute specifies the RenderMan Shading Language code that will be inserted in the shading network. To edit this attribute, click on the Edit in Text Editor button next to it. The code specified by this attribute will be put in a function where all parameters defined by the `Shading Parameters' attribute will be available. Additionally, standard variables such as
PandNcan be accessed with an external declaration. 3Delight for Maya also defines the variablesfloat ssandfloat ttwhen translating Hypershade shading networks; these two variables hold the texture coordinates generated and manipulated by the various Hypershade nodes. By default, this attribute contains a comment block that summarizes its usage. - ` Parameters'
- The content of this panel is generated based on what is assigned to the Shading Parameters attribute. It will list all the input and output plugs defined for this node, with gadgets relevant for the plug type.
3Delight 8.0. Copyright 2000-2008 The 3Delight Team. All Rights Reserved.