Custom depth and large scenes

Hi,

You’re correct in saying that in general a precision issue occurs due to large scales, as distant objects have less floating point precision.

According to this thread CustomDepth defaults to roughly 100,000,000 wherever there are no objects with Render CustomDepth Pass enabled.

So the combination of precision loss on the large scale, and the value defaulting to not max float most likely is the culprit.

Because of this, pixeldepth that goes > ~100,000,000 units results in it disappearing.

A couple things could be tried to remedy this, adding a bias to custom depth, or checking to see if custom depth = 100,000,000 and filtering it out.

Another option could be to potentially use Custom Stencils, but I’m unsure if they would fit your project’s needs.

Please let me know what you think, thank you!

Regards