Shaders and Palettes 101

Managing Shaders with MTOR
Tutorial 1



Import and attach shaders to plain Maya geometry.


Introduction


In general, when working with Maya and MTOR, Maya is used for modeling and animating, and MTOR is used for shading and texturing. 

One of the powerful features of RenderMan is its procedural shading language, in which custom shaders can be written, or created with Slim, to create many different types of textures and effects. 

With MTOR, any RenderMan shader can be loaded into a palette and connected to objects in a Maya scene. Partially for this reason MTOR does not try very hard to interpret Maya shaders, which is why it is always preferable to shade and texture a scene from beginning to end using MTOR. Problems are bound to arise when attempting to convert Maya shader set-ups to MTOR. (Note, however, that a combination of Maya shaders and hardware texturing can be used to roughly visualize RenderMan shaders inside the Maya UI.) 


Open this File:
For this lesson use this file from the project directory . . .
mtor/scenes/ladder-shadows/ladder.ma

(Where do I find the tutorial files?)


1 - Setting the Project location


Before opening the scene, set the project location. Ensuring that the project location is correctly set is the first step that should be taken when working with a scene. To do this, (from Maya):
File-> Projects-> Set

A window will open. For these tutorials, set the project location to the location of the project mtor (which should have been copied to your Maya projects directory, as described above).

MTOR will use the project location to place renderings and shadow maps. The project location is also used by MTOR to look for resources. 

Warning: Changes made to the project location in Maya do not immediately take effect in MTOR. MTOR can only update the project when a file is opened, or when a new scene is created. So it is important to set the project location before opening a file. 
Open the scene, but only after 
setting the project location. 

2 - Rendering a scene


   This scene, ladder.ma, has no MTOR shaders associated with it. Try rendering: 
RenderMan-> Render
   A couple windows should open. One will be the Alfred job queue, and the image should render into a new window. 
   Since the are no shaders attached to the scene, MTOR attaches default gray shaders to the geometry. 
A MTOR rendering of a maya scene.

3 - Adding a palette


Before applying textures to this scene, we'll need to import some shaders. There is a group of shaders created for this scene, and they are saved in a palette. To import a palette:
Renderman-> Slim-> Add Palette

The file picker will appear. Now locate and pick the custom palette. It should be located at:
/mtor/rmanshader/
Ladder_Masters.splt 

The palette should look something like the image on the right.

(Read about palettes in the  Using the Slim Interface section: The Palette Editor.)
  

External Slim palette with the scene shaders.

4 - Attaching shaders


To attach shaders . . .

First, select the Maya geometry to be attached to a shader. 

Second, select the shader to attach to the geometry in the Slim palette (clicking on a shader will highlight it). Now from the palette:
Appearance-> Attach

In order for this to work, both the shader and the objects must be active. 

Now check and see if the shader was attached correctly. First deselect all Maya geometry, next select the shader and pick:
Appearance-> Pick Objects

All objects attached to the shaders will highlight. Attach all surface shaders to objects in the scene.
 
A render with surface shaders 
but no light shaders.

5 - MTOR light shaders


RenderMan has a number of different types of shaders. Surface shaders are one type of shader that is used to describe geometry. Another type of shader, a light shader, can be attached to light sources. MTOR will interpret Maya light sources, but only to a limited extent. For more control RenderMan light shaders should be attached to the Maya lights.

Attach the light shaders to the light sources in the Maya scene. Here we'll use another technique to attach the shaders.

First, select a light source to attach a shader. 

Second, right-click on the light shader to attach to the light. A pull-down menu will appear. Select Attach from the pull-down menu. The shader should be attached now. Attach the other light shader to the other light source.
 
Lights can have shaders attached to them.

6 - Rendering the final image


Now that the surface shaders and light shader are attached, render the scene. 
RenderMan-> Render

The rendered image should look like something on the right.

 

Image with surface shaders and light shaders.

7 - Editing Shaders


Double-click on the keyLight. The Appearance Editor will open. This is where all of the editable parameters of the shader are displayed. All of these parameters can be adjusted. 

Change the light color. You'll notice that the render swatch (in the upper left corner of the Appearance Editor) doesn't update automatically. Click on the swatch, after making changes, to update it. 

Note: The parameters to the immediate right of the render swatch (Shading Rate, Object Size, Object Shape, and Frame) only control the render swatch for preview purposes and do not have any effect at all on how the shader will render in a scene.

Click on an "i" (info button) next to a parameter. A small description will appear. The info buttons will often have useful information about a parameter or shader. 

Render the scene to see changes.

(There's more about the appearance editor in the  Using the Slim Interface section: The Appearance Editor.)
 

The Appearance Editor

Next - Adding Shadows 


In the next tutorial learn how to make the ladder cast shadows.
Now save a version of the file, ladder.ma, as it can be used in the next tutorial.
 



 

Pixar Animation Studios
(510) 752-3000 (voice)   (510) 752-3151 (fax)
Copyright © 1996- Pixar. All rights reserved.
RenderMan® is a registered trademark of Pixar.