Basic Texture Projection

Using the MTOR Coordinate System to Create Planar-Z Projections. 



Projected textures can be blurred and deformed, and still stick to the surface.


Introduction  - Creating Projections


Projection techniques can be used to apply 2D textures onto 3D objects. There are a variety of different ways to map a projection, but all projections require a point in 3D space to define the origin of the projection. MTOR uses objects called coordinate systems to define the influence of projections. (For more info about using coordinate systems refer to MTOR Coordinate Systems under the Shader Concepts section.)

In this lesson, we'll cover the basics of using coordinate systems to set up planar-Z projections. 

The creation of a projection requires two things:

  1. A MTOR Coordinate System placed appropriately in the Maya scene. 

  2. A shader attached to an object intended to receive the projection. The shader must reference the name of the MTOR Coordinate System. 


The basic model without a projection.


Creating A Projection


1 -  Open the Scene for the Projection


For this example, we'll project a texture on a simple subdivision surface. Open the scene: mtor/ scenes/ kitty-projections/ kitty.ma

(Where are the scene files?)

In our simple model, we'll be projecting a face onto our model. To do this, we'll create a MTOR coordinate system. We will use the coordinate system to place the projection onto the model.


The model is a polygon cube, converted to a subdivision surface.  The top vertices have a corner hardness.


2 - Setting up a MTOR Coordinate System #1


We're going to create a coordinate system that we will place in front of the model to project the image of the face. 

Renderman -> New Coordinate System

The coordinate system has arrows visualizing its coordinates. Note the positive Z direction is defined by the blue arrow in the image, and this should be pointed in the direction of the projection.

Place the coordinate system in front of the object, as in the image.

Now fit the coordinate system snugly around the area that will have the face projected onto it, which is easy to do using the front view. 

Our coordinate system was given a  width/height ratio of 1 to 1.2 to allow easy calculation of image resolution. You may scale yours similarly (or use the pre-made coordinate system already provided).

Here the coordinate system (green square) is placed in front of the object, with the Z direction pointing towards the object.


3 - Setting up a MTOR Coordinate System #2


Later, when we attach a shader to the model, we'll need to refer to the name of the coordinate system. Importantly, the name of the shape node is required.

We can make things a little easier now by renaming the coordinate system's shape node to something easier to remember. Here we'll change the name of the shape node from  “mtorCoordSysShape” to: “faceView”, using Maya's channel box.


The coordinate system is now placed precisely, 
& renamed to “faceView”.


Renaming the Shape node


4 - Create a the Shader


Next, we'll create a shading network with Slim to attach to the object. This shading network needs to do a couple things. 

  1. First, it must define a texture to project onto the face. 

  2. Second, it must define how that texture is projected, referencing the Shape node of the coordinate system. 

To begin creating the shader, open the pre-made Slim palette.
RenderMan -> Slim -> Show Palettes

This command opens a palette. This is where you'll build the Slim shader for the object. 

 


The Slim palette (ignore the default items)
 

Next we'll create a Blinn and plug in an image.

Next create a Blinn surface shader.
File-> Create Appearance-> Blinn


The palette with a new blinn shader


5 - Add a Texture


Now we'll add a texture to project onto the object.

Open the Blinn in the Appearance Editor, by double-clicking on the "Blinn" in the pallete.

With the Blinn open (as seen on the right), connect an image file to the Surface Color parameter. We can connect an image file by switching the parameter's provider from "internal" ( )  to "connection" (  ) and then selecting "Image File" from the color pull-down menu (). Go ahead and do that now. 

 


The Blinn shader with an Image File attached

 
Open the Image File in the Appearance Editor by clicking on the "ImageFile" button. ( )

With the Image File now open, open the file picker by clicking on the file picker icon ( ) and select "kat.tif.ccu.tex" from the rmantex directory.

Luckily for us, this texture has been converted to Pixar's efficient texture format. Remember you must convert the textures you make (like tiffs) to Pixar's format. To learn more about this simple step refer to Working with Textures.

Now we'll attach a Projection manifold to the Image File. To create the connection, select Projection from the Manifold pull-down menu.(

 

Select the texture & connect the Projection manifold


6 - Define the Projection


  
Now that we've attached the Projection in the previous step, we can configure it.

The default settings are all good. We want a planar-Z projection. Now we must connect a manifold to the projection where we will refer to the MTOR coordinate system. 

Now we'll attach an Surface Point manifold to the Projection. To create the connection, select Surface Point from the manifold pull-down menu.(

  

Connect a Surface Point

 
Now open the Surface Point in the Appearance Editor, like we did above. 

Next enter the name of the MTOR coordinate system's Shape node into the Space field. This step is very important, as it defines where the texture is projected in the scene.

The shape name is "faceView." Use the following syntax:
[coordsys faceView]

Now attach the shader to the Maya object. In Maya, select the Maya object. From the Slim palette, right click on the "Blinn" shader in the palette and select:
Attach

You can also view the shader network (as seen on the right) by right-clicking the "Blinn" shader and selecting:
Call Graph -> Graph Children

  

Refer to the coordinate system "faceView" 
 


The shader network we built


7 - Render the Image


You're ready to render. The rendered image should look similar to the one on the right, with one exception. There is no bump (which we'll get to in a minute), but this is how basic project works!


One Image File projects the color image.
Another projects the bump.

  
As an added exercise, create the bump yourself. Use the file called KatBump.tif. This texture needs to be converted. You'll want to create and attach a Displacement shader this time: 
File-> Create Displacement-> Simple

Or to make things easier on yourself, just open Final_kitty.ma and see how we did it!

Tip: To try it yourself use the network on the right as a guide. For extra credit, connect both the Blinn and the Displacement Shader to an Ensemble. Then attach the Ensemble to the object. 

That's it!

What follows are some workflow issues.

 

Here's the Displacement shader…attach to an Ensemble


Creating Images for Projection


 
Of course, projecting pre-made textures is just one step in the texturing process, generally the last step. Those pre-made textures have to come from somewhere, and it turns out that coordinate systems can play a helpful role in that process. 

The tricks to creating good texture for projection are: creating an image map that conforms closely to the topology of the surface and then placing that image precisely onto that surface. A coordinate system allows us to control just that.

A coordinate system can be set up in front of a model and then used as a camera, to render an image relative to the coordinate system. This image can be taken into a paint program, painted, and then projected back onto the model, using the same coordinate system. This method works well to texture models, although a production model will generally have a number of coordinate systems surrounding it.


1 - Creating Projection Image


The coordinate system as a camera! We can take a rendering from it. Paint that render in our favorite software paint package, and then project back onto the model with uncanny precision.

Here the steps of the workflow are exposed.


2 - Set Up Coordinate System as a Camera


First, open the "Display" tab of the RenderMan Globals. To set up a coordinate system as a camera, enter the name of its shape node in "Camera Name". In this case, "faceView" is the name we renamed our shape node. We'll enter that as the camera. 

Next define a "Display Resolution" for the image that will be rendered. In this example, the coordinate system has a 1:1.2 ratio so a good resolution is 300 x 360. 

When rendered, the image renders from the perspective of the "faceView" coordinate system. This results with this image.


 
 


  Coordinate System render
with scene lighting


3 - Using Ambient Lighting


When rendering images to paint, sometimes it is helpful to use flat, ambient lighting. With this technique, the colors of the rendered image will appear as absolute RGB values, which becomes especially useful for precisely matching colors or patterns in a 2D paint program.

To set up ambient lighting, in Maya, hide the regular scene lights, so their light won't affect the scene. Next create an ambient light with a Maya ambient light value of "1" and an ambient shade value of "0". 

Render this image and save it. Much better! 

After that's accomplished, hide the ambient light and restore the scene lights. Clear the Camera Name field to and set the Display Resolution to 0 x 0. 

Next paint on it. 


 


Coordinate system render 
with ambient lighting.


4 - Paint Face in 2D Paint Package


Open the rendered image in a 2D paint program, and paint a face for the color map. Use an alpha channel to mask out non-essential elements of this texture. 

Create a bump map. Black areas will render flat and white areas will bump.

With these map saved, they can be projected back onto the model.

 


   The color map.             The bump map. 

The color map 
masked with an optional alpha, if needed.


5 - Project Image Maps Back to Model


Next take your painted textures and project them back onto the object, using the methods shown above.


The subdivision cube with texture maps, color and bump.


6  - Summary


Coordinate systems are helpful for texturing a 3D model with 2D image maps.

Coordinate systems can be used to define the projection of 2D texture maps, but they can also be used as cameras, to render perspectives of models for painting. 


Projection Note- Tips & Tricks

Tips and tricks for working with projections


Note A  - Streaking Artifacts


Here the image map has been moved to the side of the head specifically to show the artifacts caused by streaking when pixels falloff the edges of objects. 

The image map appears rougher as the surface falls off from the projection, since each pixel stretches to cover a larger area, thus reducing the resolution.


In the zoomed imaged the “streaking” caused by pixel falloff is evident. 


Note B - Creating textures that stick when deforming


There are two methods to create sticky textures, textures that will move with a surface as it deforms. 
The first method freezes the texture vertex information. Do this by selecting the object and then invoke this command: 
Renderman> Vertex Variables-> _Pref:Freeze
This command creates a node which stores the data for the texture placement and the texture should now stick when the geometry is deformed.
 


Textures stick and don't fall off.


Note C - Slim Shading Networks


For more info on building projections into shading networks, take a look at the projection recipe under the Shader Design section.


 

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