Reyes Shading

Reyes Shading

Reyes shading in RenderMan for Katana follows the same general concepts discussed in the Shading Workflows document. RfK has its own set of GP Shaders derived from the RMS GP Shaders used in RenderMan for Maya.

Using the RMS Shading Suite

For those unfamiliar with RenderMan Studio, earlier versions relied on the convenience of generating the source code of the shaders based on the network of connections created by the user. This allowed the user to create any type of shader that they wanted based on the available raw materials. The RMS shaders provided for Katana have been designed to work with a network of co-shaders. The building blocks are already compiled and communicate with each other through a fixed communication protocol. By doing this, and providing the appropriate connection points, the flexibility of the code generation system has been combined with the notion of pre-compiled shaders.

If we take RMSGPSurface as an example, we can create a complex material just by connecting a few shading nodes together. Let's say, for instance, that we want to create a sphere that looks like porcelain with a metallic glaze in a checker pattern. We can create this look in the following manner:

  1. Create a new PrmanShadingNode.

    Double-click on the node to bring up its parameters and choose RMSGPSurface from the Node Type menu.

  2. Create a new NetworkMaterial node and select surface from the prman section of the terminal type dropdown. Then connect the out port of the PrmanShadingNode to the prmanSurface port of the NetworkMaterial.

  3. Assign the NetworkMaterial to your geometry as you would a Material.

This procedure will result in a simple, porcelain-like surface material on your geometry.

Now, let's take advantage of the co-shader network capabilities to map a checkerboard pattern to the parameter that controls metallic reflections.

  1. Create a new PrmanShadingNode.

    Bring up its parameters and choose RMSChecker from the Node Type menu. (RMSChecker is a simple procedural texture shader that generates a checkerboard pattern.)

  2. Connect the out port to the metallicCo port on your first shading node. The black of the checkerboard acts as a mask indicating which parts of the surface should be metallic.

This procedure now has established a co-shader connection between the metallic parameter of the RMSGPSurface and the RMSChecker pattern. When the shader is executed on the surface it will query the floating point value for the metallic parameter, which will cause the RMSChecker shader to execute and return the correct value.

This same procedure can be repeated to map any number of parameters on the RMSGPSurface shader. The most useful shader that we provide for mapping these parameters is the RMSFile shader. This shader allows you to connect texture maps to the different connection slots on the shader. The file node will support both traditional texture maps and atlas textures produced via Mari and/or MudBox.

For more information, please consult the RMSGPSurface documentation; all of the GP shading and lighting concepts discussed in the documentation apply to RMS for Katana as well as RMS for Maya.


RMS for Katana Shading with Slim

images/pony.png Slim provides a full shading authoring environment that can generate pre-compiled shaders for use in Katana, giving you access to many more procedural patterns and more sophisticated network authoring than is currently possible in Katana. The basic workflow for using Slim with Katana involves authoring shaders in Slim and then setting your $RMAN_SHADERPATH environment variable to include the directory containing the compiled shaders. Once properly loaded they become available in the list of shaders accessible through the prmanShadingNode and the Material node. A default user interface will be generated on the fly when the shaders is found and loaded by Katana, but if you wish to provide a better UI you will need to author a .args file for the shader.

slimtoargs

The command line tool slimtoargs will provide you with a starting point to author the .args file, translating the Slim meta data in the .slo file into a basic .args file.

To use slimtoargs, simply pass the input .slim or .slo file and the output target .args file.

slimtoargs testshader.slo testshader.args
  • NOTE:

    Currently slimtoargs doesn't properly capture the closed state of collection when it is making pages in the .args file.


Adding Custom Shaders to RMS for Katana

Custom shaders are discoverable by RfK in the same manner as they are for other plugins. As long as an RSL shader and its .args file are located in one of the paths indicated by RMAN_SHADERPATH that shader will be available. An additional shader path is used by RfK starting with RPS 19: RIX_PLUGINPATH. This path is, as you may guess, for the discovery of RIS plugin shaders.

Args files are standard Katana .args files with a few extensions that are RenderMan-specific. Please see the Args File Format Guide for information on writing and intepreting .args files.