This tutorial is the first one of a series of tutorials about custom render pass creating with Maya 2013.This custom pass can be used with any compositing software like Nuke, After Effects and so on. Today I want to describe a very simple technique to create ID pass with a the Write to Color Buffer node.

To realize this tutorial I’m using Mental Ray rendering engine but, this particular technique is useful for any kind of rendering engine.

Let’s tart with the creation of some geometries in the scene. For this tutorial I’m using three polygonal spheres and I’ve assigned to any sphere a  mia_material_x_passes shader.

01

02

ID pass are very useful in composing step as RGB masks.

 

The number of ID pass can vary related to complexity of the scene and the separation of objects that you need to implement. A practicle example for a character, can be:

  1. ID 1 red color: all the skin shader
  2.     
  3.             
  4.     
  5.             
  6.     
  7.             
  8.     
  9. ID 1 green color: all dresses
  10.     
  11.             
  12.     
  13.             
  14.     
  15.             
  16.     
  17. ID 1 blue color: accessories

The same for all the rest of the scene.

At this time we can select Mental Ray as rendering engine and we can create a Custom Color pass, rename it “ID1” and activate “Use Transparency”, “Attenuate According to Transparency” flags, this can help us to manage objects transparency.

I create this pass as 3 channel pass without the alpha channel. To do this, select 3 inside the “Number of channel” option in Attribute Editor.

 03

04

Now create a “write to color buffer” node and rename it “id1red”, select “id1” in the Attribute Editor as Custom color option and select Red as color. Now the last step is to connect the shader to the write to color buffer. The field to connect are: “diffuse” from the shader and “evaluationPassThrough” from the color buffer node.

05

06

 

Take a rendering (remember to add the pass to current render layer) and look the id pass result using the load render pass menu ( FileàLoad Render Passàid1)

07

08

I’ll hope this tutorial can be useful for your daily work. In the next tutorial we’ll be covering Ambient Occlusion pass and some basics information about Python scripting.

See you!