Search Unity

Create a RenderTexture with depth information using HDRP

Discussion in 'High Definition Render Pipeline' started by KonxB, Feb 25, 2021.

  1. KonxB

    KonxB

    Joined:
    Aug 2, 2020
    Posts:
    1
    Hi everyone
    I need to create a RenderTexture using a second camera on my scene, where depth is coded into the color (black being close, white being far). I know how to do this the usual way, but I have no idea how to do it on a HDRP scene since you cant use OnRenderImage() for the camera shader.

    I tried using a Shader with ShaderGraph using the Depth node, but this would also change how the first camera renders the objects.

    1. How can I create a RenderTexture with Depth information on HDRP?
    2. How can I use a ShaderGraph shader only on one camera ?