PPV Material: measure max depth of scene in cm?

WidescreenEnt
Fri, 24 Sep 2021 20:08:46 +0000
Rendering

I have built a Post-process material to render a depth pass. (This way preserves motion blur and DOF, others do not.)
I’m using the DepthFade node, which has a Fade Distance input to define the maximum size of the fog measured from the camera.

The Fade Distance determines at what depth the 0-1 range of shading will be applied.
I’m currently using an input variable to define the Fade Distance. This takes a lot of trial and error to set correctly.

I’d like the material to measure the maximum depth of the scene, or the maximum distance between objects in the scene in cm, and plug that result into the Fade Distance. I’d probably multiply it by a variable so I could adjust it to taste.

How do I do this? I haven’t been able to figure out how to get the max measurement or the max Scene Depth in cm so I can use it as the Fade Distance.

Thanks in advance for help.

1 post - 1 participant