- Home /
Question by
CheesePlusPlus · Apr 28, 2018 at 02:49 AM ·
rendertexturedepth-buffer
How, in a C# script, can I get the camera's depth buffer as a Texture2D?
Essentially, I need to access each pixel in the depth buffer. If there's an alternative method to doing so without using Texture2D, I'd be open to using that too.
If possible, I'd like to avoid using actual shaders.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612161642im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
commandbuffer can't get depth buffer in forward rendering but correct in Deferred .Why? 1 Answer
Read depth buffer on the cpu 1 Answer
Copying depth from one RenderTexture to another 2 Answers
Is there a way to write to Deferred Depth from a command buffer in CameraEvent.AfterImageEffects? 1 Answer
How does _CameraDepthTexture work with Cameras that are using a RenderTexture? 0 Answers