I’m trying to composite an image from two render passes to try to combine outlines (and maybe other effects) with the main image render. I’ve corresponded a bit with one of the developers, and I’m getting closer, but I’m still not quite getting it to work. Here are the hints I have so far:
- Use the existing scripted rendering example to generate one or more outline images (there are different methods that can be combined)
- As one part of this, modify the addOutLineIDsToMaterialsProperties() function in the OutlineGlobals.dsa script to set each node (object in the scene) to have a different Color ID
- Write an imager shader that takes the outline image(s) as uniquely named parameters and composites them with the render (I know how to do this part with Shader Mixer).
- In the script, set the image input properties on the imager camera to the outline file(s) before you execute a newly added “standard pass” at the end
Here are the parts I don’t know how to do. If anyone could point me toward documentation—new, old, examples, RiSpec, whatever—I’d really appreciate it!
1 - To set the newly created OutlineColorID property in the materials of each node, I have in mind to add a line inside the k loop that looks something like this:
Here, i is the node number. I’m not sure about oMaterial.setFloatValue or its parameters, though. Should I be using oColorIDProp instead?
2 - Assuming I have a Shader Mixer camera that can layer the images, and it is the active camera, how do I assign the parameters of that camera to the appropriate filenames generated previously from within this script? Or should I not be using Shader Mixer, and instead write that part of the imager in the script?
Thanks in advance for any pointers!
1. For this you want to:
a. Get the Materials from the node
b. Find the property (findProperty should work for this)
c. Set the value of the property (setColorValue() is probably what you want unless
you changed the property to a float property in which case SetValue is what you want)
2. For this:
a. Name the images properties you want to set for your camera something original using the
properties tab in shader mixer
b. Get the active camera
c. Call find property with your original name from step a
d. Set the image on the property
e. Render final pass