While rendering with Mental Ray I’ve been using puppet’s shader pack called shaders_p .
Now, I’m trying to become renderman user, so I need to write my own universal shader.
What was great in puppet’s shader pack is that it has an awesome feature - ability to output a pass with 3 separated z-Depth channels. One for directly visible objects, one for objects in reflections and one for objects in refractions.
How can I implement the same thing in RSL?
Specifically:
- Calculate the length of a ray from back side of object with refractions to the objects visible in this refractions.
- The same thing with reflections. Calculate the length of a ray from the point where some object is reflected to the point which is reflected.
- Multiply primary Z channel with transparency so that transparent areas of an object won’t affect color of something that’s behind it. Like it’s shown here.
- Also, is there a way to measure the length of a ray inside refracting object? It would be nice to be able to create kind of volumetric coloring inside dielectrics without actually using volume shader.