Building Shaders


Table of Contents

Building Slim Shading Networks

Creating Shading Networks

Creating Connections

The Art of Shader Design

The Graph View Editor

Slim's Shader Arsenal

The Core Functions

Special Appearances

Special Case Names

Create Custom Solutions


Building Slim Shading Networks

Creating Shading Networks
A shading network can be built inside a Slim palette using Slim's core set of functions. There are a number of different categories of functions, each representing a different component of the anatomy of a shader. A function can be built into shading network by connecting it to a parameter of another function. To create a new shading network, select "Create Appearance" from the File menu in the Slim palette and make a selection from the list of available functions, an "appearance" of that function appears in the palette. Notice that the icons of shader networks are easily spotted in a shader palette, as their icons are more saturated than those of imported RenderMan shaders.

  

"Live" shader networks

  

Imported RenderMan shaders

Creating Connections
To create a connection to an appearance parameter, open the appearance in the Appearance Editor. Then, using the Property ("Gear") Menu, select a function to provide the value from list of connections.

This parameter's value is provided by an Internal Value, indicated by the yellow icon beside the name of the parameter.

This parameter's value is provided by a connection to another function, indicated by the purple icon beside the name of the parameter. The parameter's pair of sliders is replaced by a button that takes you to the function that provides the value for the parameter.

For a walk-through on how to create a shading network we refer you to the Crash Course in Slim.

The Art of Shader Design
The philosophy behind creating shaders with Slim is building shaders bit by bit, adding one small effect and then another, i.e. procedurally. Each Slim function performs a singular role. It is when functions are combined together that we can see interesting results.

Slim supports layered shaders. A Blinn can be layered on top of a metal surface shader. Layering adds a lot of potential to the types of surfaces that can be produced.

For a look at the concepts behind creating a shader see the Anatomy of a Leaf Shader.


The Graph View Editor and Shader Construction

The Graph View Editor allows you to visually display the connections in a shading network and perform interactive operations to that shading network. Shading networks can be edited directly through the graph editor. Connections between shading nodes can be created, broken, and otherwise edited. The graph editor sports some fancy features. For more information refer to The Graph View Editor documentation (located in the Using the Slim Interface section).


Slim's Shader Arsenal

The Core Functions

The core set of functions provided by Slim can be used to generate a wide range of shaders which utilize many special features of Slim. These core functions generally serve one particular purpose, like creating a simple noise or a pattern. The functions by themselves are not always useful and must be connected to other functions to obtain a meaningful result, but the atomic nature of functions affords a great deal of flexibility when it comes to assembling shading networks.

Attachables: The Four RenderMan Shader Types

Shading Models

Displacements

Lights

Volumes

  

Functions for Parameter Modulation:

Colors

Floats

Manifolds

Vectors

Environments

  

Shader types, like Shading Model, can be attached to objects in Maya, and are called “attachables”. However, colors, floats, and manifolds cannot be attached to Maya surfaces.

Typically a shader is built by first creating a shader type, like a shading model or displacement. Next, functions like floats and colors are connected to modulate parameters. Finally, appropriate manifolds are connected to define the colors and floats in shader space. 

Special Appearances

Special appearances perform unique roles and functions. These are generally MTOR concepts which provide an extra level of functionality for the user. Special appearances can provide a meta-level of control over scene management by supporting functionality beyond PRMan itself. MTOR supports these "meta concepts" and translates them for PRMan during RIB generation. For instance, in PRMan a single shader cannot contain surface, bump, and light shader information, but MTOR provides this functionality with the Ensemble, allowing multiple types of shader information to be attached to an object at once, instead of attaching each different shader individually. MTOR breaks down the Ensemble into individual connections during RIB generation. Here is a list of the special case appearances: 

Ensemble Different shader types (surface shaders, light shaders, displacement shaders, volume shaders, RIB boxes, and TCL boxes) can all be connected to an Ensemble. Additionally, either flattened shaders or shading networks can be connected. This way a single Ensemble containing multiple shader types can be attached to an object.

RIB Box The RIB Box allows chunks of RIB to be added into the scene at different points in the RIB stream.

Map Generator Map Generators allow the calculation of many kinds of arbitrary maps.

Adaptor Adaptors accept conditional connections which can based on several criteria, providing a powerful solution for large projects, especially when adaptors are connected to other adaptors…

Archiver An Archiver allows scene geometry to be stored and reused during a render, reducing the time of RIB generation. Even animated cycles can be archived.

TCL Box These allow TCL to be declared in the Maya scene.

Special Case Names

When shaders are given certain names which have special significance to MTOR they can be used to create special effects and scene optimizations. An understanding these special case names leads to absolute happiness and a fulfilled life. Simply select an appearance in a palette and name it one of the following to achieve the corresponding effects:

backplane

Use this to apply procedural shaders and textures as a background color. "Backplane" tells MTOR that an appearance should be attached to the special backplane geometry. Note that this will only have an effect if the backplane option is enabled in MTOR's RenderMan Globals window. 

frontplane

"Frontplane" signals MTOR that an appearance should be attached to the special frontplane geometry. Note that this will only have an effect if the frontplane option is enabled in MTOR's RenderMan Globals window. 

world

Appearances, like RIB boxes, atmospheric fog, and environment lights, should be named "world" when affecting the whole scene. "World" tells MTOR that an appearance should be output after lights have been defined in the RIB stream. This allows you to override any world-wide defaults, while inheriting the appropriate global lighting. 

declare  

"Declare" tells MTOR that an appearance should be output in the Declaration part of the RIB file.  This allows you to declare arbitrary RenderMan variable types, and is particularly useful with RIB boxes.

frame  

"Frame" tells MTOR that an appearance should be output immediately prior to the RiWorldBegin directive.  This allows you to  override any frame-wide options or attributes. Frame is particularly useful for RIB boxes with time specific contents.

Create Custom Solutions

And if Slim's arsenal doesn't include your particular weapon of choice, you can always develop your own custom fodder and plug it right into Slim.

One of Slim's most useful qualities is its extensibility, by providing hooks for you to write new custom functions. Perhaps you need some functionality that is missing from Slim's core set of functions. Well, write your own. This new function can be plugged right into Slim's UI, appearing with the rest of the colors, floats, etc. Through such customization, Slim can be fit to match your studio's proprietary shader development techniques and workflow.

A custom function is basically a template of RSL code. To develop templates you must be familiar with programming in both TCL and, most importantly, the RenderMan Shading Language (RSL). 

Writing Slim Templates
  • Extend Slim's core set of functions.

  • Slim templates are RSL functions with user interface and data hints.

  • Easily convert existing RenderMan shaders into useful Slim templates.

For further information about developing Slim templates we refer you to:
Writing Slim Templates and The ".slim" File Format.


 

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