Class 3: MTOR

What is MTOR?

MTOR is a Maya plugin ($$$) which translates Maya scenes (minus Maya shaders) into RIB. Slim, a visual RMan shader creator UI, lets you assign RMan shaders to Maya geometry. MTOR's generated RIB references these Slim-generated shaders (instead of Maya's).


Load the MTOR .so/.mll/.dll file(s) using Maya's 'plugin manager'. This would create a new 'RenderMan' menu under the Maya 'Render' menu bar (where Maya's own rendering menu resides). All RenderMan rendering is handled via items in this RenderMan menu. No need to hand-edit RIB files or shaders!

Once you load the plugin, you can use the 'RenderMan' menu to render via PRMan.

Load this test scene to do a basic render.

Render using PRMan:

Next, do the same render using Maya's renderer:

Note that the results look pretty identical overall:


Be sure to consult the extensive docs on MTOR/Slim on an ongoing basis.
Below, we look at six facets of MTOR.

Particles: rendering using custom attrs

It is easy to export (to RIB, and from there, to a shader) any custom attr you attach to any Maya object. Just make sure the attr follows an established naming convention for RIB export. Eg. if you want your attr to be called myCustomAttr, you need to call it rmanFmyCustomAttr on the Maya side. The 'rmanF' prefix signals to MTOR that this attr needs to exported. The prefix also gets dropped on export. Likewise, rmanV and rmanS are prefixes needed for vector and string attrs respectively.

In Maya, create a particle object, and animate it as usual. Create a per-particle float attr called 'rmanFvisc', and assign a creation expr. for it like so:

rmanFvisc = rand(0,1);
Next, write a shader that will make use of the 'visc' attr that will be available on a 'varying' basis:
surface visctester(varying float visc=0)
{
  Ci = color(visc,visc,visc);
}
Compile the above shader, and assign it to the particle object. Render. You should see each particle be shaded with a unique grayscale value..


Here is a sample Maya scene and a shader to illustrate this idea. Note that in the shader that accesses our custom attrs, those attrs MUST be declared to be 'varying'.

In Maya, we're creating a particle expression to feed values to rmanFcustomAttr:

Let us create and compile particleRen.sl:

Now that we have a particleRen.slo which is our compiled shader, we need to attach it to our Maya particle object.

As an aside, if you render the particles w/o attaching the shader that processes the custom attr, you get this:

Back to attaching our new shader.. First, create a new Slim palette:

Import particleRen.slo into it:

Attach particleRen.slo to our particle geometry:

Render!

Note that the above rendered image looks different from the first render we did, without creating/attaching our particleRen shader..

This is a Pixar doc. page that explains the variable naming scheme.

Rendering curves

NURBS curves in Maya can be rendered as RenderMan curves. This is quite useful for creating hair, fur, grass, etc. In order for a curve to be exported by MTOR, the curve needs to have an extra attr called mtorCurveWidth and a good value set for it.

Here is a sample Maya scene containing a simple curve with an mtorCurveWidth attr.

The key to rendering curves is that they need to have an extra 'mtorCurveWidth' attr attached to them:

You can use mtorFuzz, mtorFur and mtorUltraFur that ship with MTOR/Slim to create and render curves in PRMan. See the RAT docs for more info.

Blobbies ("metaballs")

Blobbies are great for modelling globs of fluids. With MTOR you can create element (primitive) blobbies and then combine their influences (fields) using operations such as 'Add', 'Subtract' and 'Multiply'.


Here is a sample Maya scene containing a pair of blobbies.


To create blobbies:

Following are snapshots for the primitive creation, grouping, op specification and blob-coloring steps:

This is another simple blob scene..

Subdivision surfaces

Subdivision surfaces offer the modeling flexibility of polys and smoothness of NURBS.. Subdivision surfaces are smooth surfaces created from [subdividing faces on] polymeshes. The surfaces can contain holes, edge creases and sharp corners, so it is a great choice modeling characters (eg. Geri, in Pixar's Geri's Game short).

Mesh for Geri's head:

Edge creasing on Geri's hand (fingernails):

Geri, full:

Here's how you would convert a Maya mesh to a PRMan subdiv:

Edges on a subdiv poly 'cage' can be creased; likewise, corners (verts) can be pinched. These operations permit precise features on a surface.

Here is a sample Maya scene with a subdiv. surface, and here is another.

CSG (Constructive Solid Geometry) objects

Set theoretic operations of union, intersection and difference can be used hierarchically to build up complex geometries.

To create CSG, you'd first create 'primitives':

Once you have primitives, you can do Boolean ops:

This is a simple CSG scene.

Arbitrary clipping planes

A clipping plane can be positioned anywhere on a surface in any orientation, to enable cutaways.

Here's how to create a clipping plane:

This is a simple scene with a cutting plane.