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.