View Full Version : RFM doesn't allow to use my AOVs [RSL]

01 January 2012, 12:12 PM
I'm trying to make my shader to output some AOVs.
Everything is fine as far as I use default names for my AOVs. Such as: "Ambient", "DiffuseColor", "DiffuseDirectShadow" etc.
But if I give them some non-standard name, RFM doesn't save corresponding file and gives me a couple of warnings.

The following code works just fine. RFM as expected renders the picture and saves additional image file for "DiffuseColor" channel.

surface My_Shader (
// ... some parameters here ...
output varying color DiffuseColor = 0;
// ... some more parameters here ...
// ... shader code ...

Now, the same code, but I have renamed my variable:

output varying color DRL_Diffuse = 0;

And after that for some reason RFM doesn't want to output this channel anymore.
It gives me this warning in script editor:

// Warning: (01/04 14:57) rfm Warning: R09044 Invalid declaration for display channel "DRL_Diffuse". //
// Warning: (01/04 14:57) rfm Warning: R09014 Unknown display mode "DRL_Diffuse". //

And official docs doesn't give me a reason for that:

R09044 Invalid declaration for display channel "%s".
The requested display channel had an invalid syntax, most likely arising from an incorrect inline type declaration. The channel will be ignored.

R09014 Unknown display mode "%s".
An unrecognized mode was passed to RiDisplay. If an arbitrary output variable was intended, it may be missing a proper declaration. If a list of DisplayChannels was intended, the DisplayChannel invocations may be missing or malformed. The renderer will ignore this display.

OK, maybe the reason is that I use .slim file with my shader, but I haven't defined output variables there. OK, let's add there a parameter corresponding to my variable:

parameter color DRL_Diffuse {
access output
detail varying
display hidden
default 0

But after I reload shader in AE, the following warnings appear in script editor:

// Warning: (01/01 15:12) rfm Warning: use of access keyword suggests a need to declare output in parameter type field //
// Warning: (01/01 15:12) rfm Warning: DRL_Diffuse SetValue parse error //

And the same problem appears when I render.

Is there something I missed? Do I need to define my AOV somewhere else (not only in shader file)?

P.S.: Of course, both AOVs are added in "Render settings" window, under "Passes" tab.

01 January 2012, 04:02 PM
You don't really need to include the AOV outputs in the slim template - unless of course you want the artist to select a value (such as an ID) for that output.

Just to clarify this is what your doing?

In the shader declaration you want to specify the AOV...

surface myShd (
output varying color __myaov = 0;

Then in the shader body you want to set the value of that AOV with something like this...

Oi = Os;
Ci *= Oi;
__myaov = color (1, 0, 0) * Oi;

Then in Maya under your pass settings you need to include the AOVs as an output. In RfM 4, open up the Renderman Controls window and set it to View>Pass Settings Tree. Select the Finals pass and go to the Outputs tab. Open the Add Channels/Outputs tab and go to Custom. Enter "color __myaov" (without the quotes) and click add. Now right click on your new channel and select Create Output From Channel.

In earlier versions for RfM, go to the Passes tab in the Render Globals, select the Outputs tab and click on the arrow next to the text field box where it says Output rgba, choose "custom" from the drop down menu and then enter "color _myaov" (again without the quotes). You can also do it this way from RfM 4, but using the other method keeps track of your custom AOVs and allows you to multi-select when adding and removing outputs.

Hope that helps.

01 January 2012, 07:16 PM
I did all you described exactly the same.
Except for 1 thing: in Maya, in RenderMan settings I was typing simply "myPassName", not "color myPassName". That 1 missed word was the reason of all that troubles.

Thank you very much, you really helped me a lot.

It's actually odd that there's no mention about specifying AOV type in RenderMan's interface itself.

CGTalk Moderation
01 January 2012, 07:16 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.