View Full Version : shadows as an output channel

02-27-03, 09:54 PM

I'm new to renderman and maya to renderman and I'd like to know how is it possible to render some channels separately like shadows, diffuse for using in compositing later on. I know the backplane and ratcollector method but what about self shadowing. I know in mayaman there is an output variable __shadow wich write an image with shadow at each pixel.


02-27-03, 10:35 PM
Well, I don't know how much programming you want to do or if you need an automatic solution. You can render different channels (color, specular, shadows, diffuse, etc.) using output variables (read RAT documentation about this).
Lets say you want to have a separate pass for specular, then you create an output variable called spekular (use your favorite name) like this in your shader:

surface yourshader(float Ka = 1,
float Kd = 1,
output varying color espekular = 0; ) /* check the words output varying here */
your shader stuff here
Oi = Os;
Ci = Os * yourstuff;
espekular = Ks*specular(Nf,-normalize(I),roughness) ; /* plastic specular */


Then in your RIB you need to declare the output variable(s) of your shader:

Declare "spekular" "varying color"

And ask the renderer to create another image file:

Display "+spekular.tif" "tiff" "spekular"

Here's a link to an answer Larry Gritz wrote some time ago about shadow matting:


Titus Maledetto.

[Edited on 27/2/2003 by titus]

03-01-03, 05:05 PM
many thx titus

I knew this forum is the best around. Your reply and Larry's comments realy helped me a lot; job done, many thx again.


03-07-03, 10:45 AM
Very great tutorial Titus !
Thx for the job !