Arnold Z pass vs Ray Length in Houdini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We've had some issues with Arnold's built in Z pass. It writes large values in dead space areas where there are no objects. I'm assuming it's just returning the depth value of the end of the clipping zone.
In the past we've solved this by creating giant spheres surrounding our scenes and set them to force matte the render so we get a value of 0 in the dead space. It isn't a great solution so I've been exploring an alternate approach.
In an AOV shader network, I know that creating a state float and setting it to Ray Length measures the distance between the camera and the objects rendered. In theory this should be the same value as the built in Z pass but I've noticed that it's off by some variable percentage. Something like 2-3 percent. The advantage to using the Ray Length is that I have access to it in the shader network and I can multiply it by another attribute to zero out the dead space.
I decided set up a test to compare the two. I created an attribute in Houdini to measure the distance between the origin of the camera and the geo rendered. It turns out that the Ray Length matches the distance attribute almost exactly, but the built in Z pass seems to be off.
So I suppose I have a multi part question.
1. Is there a way to zero out dead space in the built in Z pass (I'm assuming the answer is no)
2. Is there a way to bring in the Z pass into a shader network to fix it there. I tried a AOV read node but that didn't work, maybe that isn't its intended purpose.
3. If we use ray length instead of the Z pass, is there a way to make it mathematically consistent with the Z pass? Is it possible that the built in Z pass is less accurate than the Ray Length?