Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question DepthTexture not rendered on second camera on Android

Discussion in 'Image Effects' started by ewoudwerf, Dec 16, 2022.

  1. ewoudwerf

    ewoudwerf

    Joined:
    Mar 19, 2016
    Posts:
    13
    I'm using two cameras, the second camera I use for post processing effects and need to retrieve the Depth Normal Texture.

    My camera setup goes as follows:
    MainCamera.depthTextureMode = DepthTextureMode.None;
    SecondCamera.depthTextureMode = DepthTextureMode.DepthNormals;

    The problem is, that inside my post processing shader, _CameraDepthNormalsTexture returns the view of the main camera, not the second camera (and it is not even the depth normals from the main camera, just the standard view)

    The weird thing is, this only happens on Android, both inside the editor and on my phone
    On other platforms it works fine

    I'm using the built-in render pipeline in Unity 2021.37f1.
     
  2. ewoudwerf

    ewoudwerf

    Joined:
    Mar 19, 2016
    Posts:
    13
    I seem to be experiencing a similar issue on Xbox, only this time it only happens during runtime and instead of the standard view it produces a very distorted texture to _CameraDepthNormalsTexture