Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

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:
    19
    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:
    19
    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