View Full Version : Renderman Shader/Usebackground

11 November 2005, 06:20 AM
I have a question regarding writing a renderman shader. I am very new to shader writing, so please forgive me if this problem has a simple solution, I hate to waste someones valuable time.

I'm looking for something similiar to Maya's Usebackground shader or matte opacity. Wondering if its possible to create the same functionality in a renderman shader. Im looking to have an objects RGB output black, and its alpha channel black as well. Its the equivalent to moving everything (sliders, attributes) in maya's usebackground to the left. I hope my description is making sense.

Its possible my confusion stems from not completely understanding mathematically how an alpha channel is generated during render time and my lack of knowlege about RSL.

I was unable to locate any information in renderman for directly manipulating alpha values. Is this possible? I did notice that "imager" type does have access to some type of "alpha" attribute for pixel values. Could this be the correct direction to go? I still feel like this should be designed as a "surface" type shader. If so, is there way a to get RGB values and somehow keep the alpha channel, but just fill it completely black?

Thankyou for your time, if I missed something while searching for information please forgive me.

11 November 2005, 11:03 AM
What you want it a holdout matte. You need to add the RIB statement:

Matte 1

just infront of your object. The easiest weay to do this in Slim is put this into a RIB box and attach it to your object.

You cannot do this in a shader.


11 November 2005, 11:06 AM
In prman, micropolygons are composited using their alphas to generate the final pixel colour. One micropoly cannot affect another's value, which is what it would have to do to make a "use background" shader.

The proper way to do this in renderman is to use the command

Matte 1

If you're using mtor, just put that in a RIBBox and attach it to your object. It'll still run whatever shader is attached, so make sure you attach something very simple (but not transparent, or it'll have no effect)

EDIT: Dang simon, beat me to it!

11 November 2005, 12:36 PM
Thankyou both very much for the prompt response. This does precisely what I was looking for. Thankyou again for your patience and time.

CGTalk Moderation
11 November 2005, 12:36 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.