# Is there a way to make a true pixel / scene depth?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-make-a-true-pixel-scene-depth/1268847>\
**Category:** Rendering\
**Tags:** unreal-engine, Rendering, Blueprint, question\
**Created:** [August 22, 2023, 2:06pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-true-pixel-scene-depth/1268847 "2023-08-22T14:06:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drakonexdev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Drakonexdev](https://forums.unrealengine.com/u/Drakonexdev)\
**Post date:** [August 22, 2023, 2:06pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-true-pixel-scene-depth/1268847/1 "2023-08-22T14:06:33Z")

</div>

I’m trying to make a special type of vision, the intention is to have the characters vision only be black and white, and the visibility of objects to be based on linear distance, at the closest distance it will appear white, farther away it will appear gray, and at the end of the distance it will be true black, so you can’t distinguish anything beyond maybe 10 feet

I’ve used scene depth and pixel depth to limited success

To explain what I’m facing:

Scene depth and pixel depth are camera based, rather than world position based, and this creates problems when looking around because things with fade in and out in the center of the screen because the edges of the screen read a different depth

If I haven’t worded my question well enough I’d be happy to answer further questions

Also, I did find this reddit post which does illustrate my issue a little better, but I’m not able to understand what they’re talking about enough to do it myself

[https://www.reddit.com/r/unrealengine/comments/4ni4ea/fixing\_pixeldepth\_to\_provide\_actual\_distances/](https://www.reddit.com/r/unrealengine/comments/4ni4ea/fixing_pixeldepth_to_provide_actual_distances/)

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/1/2b1b4b939924f8165e0cad89c6384e56d3624fa3.png)  
actually I’ve realized the video from the post doesn’t accurately represent my issue, here is a better representation:

This is my current setup looking left to right,

When I look to the left.

 ![Boolean - Unreal Editor 8_22_2023 10_09_49 AM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/1/46109acf990d41738f51fa21b01bed7e60e89334.png)

When I look to the right.

 ![Boolean - Unreal Editor 8_22_2023 10_09_54 AM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/0/2906dc82da3f2acb3f742f3864582eff147d8385.png)

and when I look directly at my rectangle I can’t see it, but as shown above and below if I look to the side I can see it in the sides of my vision, this is the only issue I have with scene and pixel depth, and I’m really hoping for a solution to this.

 ![Boolean - Unreal Editor 8_22_2023 10_09_58 AM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/9/7c9bc481e230de8a1c9fa39b78971c6eaf7b959e.png)

also scene depth is bugged and doesn’t work correctly in the editor as show below

 ![Boolean - Unreal Editor 8_22_2023 9_47_48 AM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/d/8cd34e81842a250ef5e8403c57f619eeacfc0f5e.jpeg)

Edit: the deleted posts below were all the separate screen shots because I didn’t have the permission to put multiple into one post until now.

---

<div class="post-metadata">

**Author:** ![StarScream\_83](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/starscream_83/32/487170_2.png) [@StarScream\_83](https://forums.unrealengine.com/u/StarScream_83)\
**Post date:** [January 22, 2024, 7:05am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-make-a-true-pixel-scene-depth/1268847/6 "2024-01-22T07:05:08Z")

</div>

> [@Depth to World Position](https://forums.unrealengine.com/t/depth-to-world-position/315962):
>
> Hi, In a post process material, what would be the best way to get the World Position of a pixel rendered in the CustomDepth GBuffer? I tried CameraPosition - (CameraVector \* CustomDepth.r), but the result is obviously wrong. Thanks.
