The core set of functions provided by Slim can be used to generate a wide range of shaders which utilize many different 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 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. |
Special appearances perform unique roles and functions. These are generally MTOR concepts which provide an extra level of functionality for the user. These different special appearance types 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:
Adaptor |
Describe different appearance attachments for different rendering conditions. |
AOV |
Use Arbitrary Output Variables in a shader. |
Archiver | Automatically cache and reference portions of your scene graph. This can result in dramatically faster rib gens. Animated cycles can even be archived. |
Ensemble | Attach different shader types simultaneously. |
Map Generator | Map Generators allow the calculation of many kinds of arbitrary maps. |
RIB Box | Insert chunks of RIB to be added into the scene at different point in the RIB stream. |
SL Box | Insert custom shading language code into your shaders. |
TCLBox |
Define chunks of Tcl to be evaluated prior to the per-object RIB encapsulation of other shaders. You can initialize values referred to in parameter expressions of other appearances. |
The AdaptorDescription: There are a variety of adaptors for different appearance types. Adaptors allow you to attach different appearances under different rendering conditions, providing a system for selecting an appearance type based on an evaluation context. You can establish different shader connections under differing conditions. You might, for example, have different shaders for different lighting conditions. Available contexts are described under the Controller parameter.
Adapters are extremely powerful way to manage shader connections. The ordered list of conditions represent a simple program. The list is traversed from top to bottom and the resulting appearance is that associated with the first condition that matches the controller conditions.
Controller: The controlling variable against which Condition strings are compared. You can select from the pull-down menu:
Add Condition: Create a new adaptor connection. The double arrows return selected objects from the Maya scene. The pull-down menu describes the comparison algorithm. You have a choice of:
Using Adaptors: In our example, we have a context sensitive Ensemble Adaptor. Let's see how it works.
First of all, the controller is set to "Context." We can define the context of a scene in the context setting of the RenderMan Globals.
We have several Ensembles connected to this Adaptor, but which ensemble is attached to an object is determined by what is defined as the context in the RenderMan Globals. If the context is defined as "night" then Ensemble_0 will be used. If the context is "day" then Ensemble_1 will be used. If any other context is entered then Ensemble_2 will be used as its field contents, "*", will match anything. Notice that the conditions are evaluated in order, so if the third condition was moved to the top, it would always be attached since its field, "*", matches anything.
Conclusion: Now this adaptor can be attached to an object, and it's simple to assign different shaders for either daytime or night scenes. We don't need to create or delete connections. All that needs to be done is enter a new context. To get even more advanced, we can plug this adaptor into *another* adaptor, perhaps one set to "Object Name." Now imagine this: a single adaptor can be attached to all of the objects in a scene, and it will attach the appropriate appearance to each individual object based on the object name (attaching the hat shader to the hat, the jacket shader to the jacket). With the proper adaptors attached to the objects by name, the appropriate day or night version of a shader is then attached by the context setting.
Example Adaptor Shading
Network |
AOVDescription: This template allows you to use Arbitrary Output Variables in a shader. Note that, in addtion to Color (as seen in the illustration), users can define Float, Point, Normal, or Vector as well. AOV: Enter the name of your point AOV here. Note that this can't be an expression. input : Enter the input for the AOV here.
|
ArchiverDescription: Attach AutoArchive appearances to nodes in your DAG to cause all child nodes to be written to an external RIB Archive file and automatically referenced for final RIB generation. This can greatly speed up your RIB generation process if Laziness is enabled or if an object doesn't change over the course of a shot. Control:These parameters control how the archive is read. Read Method:Use DelayedReadArchive to allow the renderer to determine when an archive should actually be loaded. If you always want your Archive to be loaded, choose ReadArchive. Visibility: Controls the presence of the archive reference in various rendering passes. Motion Blur:Controls the motion blur attribute for the entire archive at the time the archive is included. If you wish to use the DAG node to move a rigid archive around AND you want motion blur, make sure this attribute is enabled. Writing: These parameters control how the archive is written. Base Name:The name to be prepended onto all RIB archive files. The default value $JOBNAME is the name entered in the Display Name field of RenderMan Globals. If you want to share auto-archives across jobs, you should enter your own base name here. Frequency: Controls how often you want to archive your objects. If your object is rigid, select "Once Per Job" otherwise select "Every Frame". Recylcing After: Use this setting to archive animated cycles. Laziness: Controls how often the RIB Archive is constructed. When Laziness is enabled, the mere existence of the target RIB file will prevent the construction of a new Archive. In this case, it's up to you to ensure that the existing Archive is up to date. Archive Contents: The selected components will appear in the Archived RIB. Base Light Handles: The Base Light Handle can be used to help prevent light handle collisions and only comes into play when archiving lights.
|
EnsembleDescription: An ensemble provides controls over many aspects of the RenderMan shading state, including important overrides for ray traced shaders. Note: both shader networks and regular RenderMan shaders (.sl .slo) can be attached to ensembles. The Ensemble's Ray Tracing Controls Rays
Sample Motion
Trace Displacements
Trace Bias
Max Specular Depth
Max Diffuse Depth
Irradiance Cache
Max Error
Max Pixel Distance
Cache File
Cache File Mode
Photon Maps
Shading Model
Estimator
Caustic Map
Global Map The Ensemble's General Parameters
Shading Rate
Shader Space
Scale
Cast Shadows
Cs
Os Displacement Bound
Displacement
Atmosphere
Light1
Light2 |
RIBBoxDescription: Enter arbitrary RIB here. You can associate the RIB with objects by attaching the appearance. You can also associate your RIB with a particular point in the RIB file by naming it appropriately. Special names are: declare, frame, world, frontplane, and backplane. Text in RIB boxes is automatically substituted using the Tcl subst command. This allows you to embed references to special global variables and to even include logical expressions. If your RIB snippet requires that square brackets be passed through to the RIB file: ["stuff"], you must escape them with backslashes: \["stuff"\].
You can embed your box of RIB within standard Tcl logical expressions. To cause your rib
to only be output during shadow passes, try:
[if {$ELEMENTTYPE == "shadow"} {
return "# your rib chunk"
}] |
SL BoxDescription: SL Boxes are a class of shader construction functions that allow you to define your own shading language code. SL Box templates are defined for types float, color, vector, manifold, and shadingmodel.
Parameters
Includes pxslRemap.h
Primvars uniform float gprimType = 1;
SL Code
You should save the results of your computations in the
The triangular widgets associated with Includes, Primvars, and SL Code
present small textboxes that allow you to edit these within the Appearance
Editor. The |
TCLBox
Description:
Enter arbitrary Tcl here. You can associate
the Tcl with objects by attaching the appearance. You
can also associate your Tcl with a particular point in
the RIB file by naming it appropriately. Special names
are: declare, frame, world, frontplane, and backplane.
Text in Tcl boxes is evaluated prior to the evaluation
of appearance parameter expressions. Here you can set
the values of global variables which you refer to in
the parameter expressions associated with other appearances.
|
Pixar Animation Studios
|