# Custom Depth Value Outputs?

**URL:** <https://forums.unrealengine.com/t/custom-depth-value-outputs/452119>\
**Category:** Rendering\
**Tags:** custom-depth, unreal-engine, question\
**Created:** [July 12, 2019, 6:57am UTC](https://forums.unrealengine.com/t/custom-depth-value-outputs/452119 "2019-07-12T06:57:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Lumzdas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lumzdas](https://forums.unrealengine.com/u/Lumzdas)\
**Post date:** [July 14, 2022, 4:54am UTC](https://forums.unrealengine.com/t/custom-depth-value-outputs/452119/2 "2022-07-14T04:54:32Z")

</div>

Just had the same issue, thought I’d share my findings.  
After some trying it seems that the Custom Depth values are distances from the camera to the objects in world coordinates.  
The value “defaults” to some very large number (roughly 100000000, I wonder why) wherever you have no objects with `Render CustomDepth Pass` enabled.

To visualise the world distance, I dismiss any values above 500:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/c/45c2bd95f1ea006ad59ba617b7393ef83e5f7e37.png)

And get this (only the black pieces have Custom Depth enabled, and so become white when close enough):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/5/2e5a01a43cee38a4373c1e47e02e3903c8eff4f5.jpeg)

In the end, I just set the the constant in the `Subtract` node to 100000000 to get the effect I wanted - only objects with `Render CustomDepth Pass` enabled change the pixels. You can also remove the last `Min` node to retain world distances.

---

_[View the full topic](https://forums.unrealengine.com/t/custom-depth-value-outputs/452119)._
