4

What is the simplest way to save my Depth color mode Texture Render. Can it be done without using replacement shaders on my camera?

It seems like most of the work is done just setting the color mode to depth on a camera with a render target. Previewing it on a material, it looks perfect. I feel like it should be trivial to save it out but, then again my knowledge of the render buffers aren't up to snuff

I can know you can create a Texture2D and use ReadPixels to copy a active render texture with standard rgba color but, I am having issues figuring how to do it with just the depth.

If I am understanding Depth Textures correctly they are 32bit single channel? But, ReadPixel only works on RGBA32, ARGB32 and RGB24 texture formats. When I save it out as a png using ReadPixel I just seem to get a gray image

  • Possible duplicate of [Convert RenderTexture to Texture2D](https://stackoverflow.com/questions/44264468/convert-rendertexture-to-texture2d) – Ruzihm Jun 07 '19 at 04:28
  • 1
    Not duplicate - saving depth data, not colour data – BenClark Sep 04 '20 at 17:09

0 Answers0