Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug [URP] Depth texture doesn't work

Discussion in 'Universal Render Pipeline' started by yonatanab1, Aug 5, 2022.

  1. yonatanab1


    Sep 9, 2018
    the "depth" field just doesn't work for me.

    I tried downloading urp asssets that use it such as water shader but they all return a smooth color.

    I also tried making water through an official tutorial but it's depth effect also doesn't work.


    I made sure to enable depth texture in the urp asset settings, and downloaded post processing and enabled it on the camera settings but nothing works for me.
    What should I do?
    I will share any needed details.

    [I am using Unity 2021.3.0f1 LTS + Latest Universal version available 12.1.6.]
  2. alexpana_


    Mar 5, 2017
    Add some cubes in the scene to overlap with the planes. The depth comes from other objects.
  3. Atilli


    Aug 31, 2022
    Same here,I had to turn off depth and uncheck Quality HDR for the Universal RP-High Quality asset
  4. CreativePrismStudio


    Nov 16, 2017
    I had an asset that used to work using a similar technique, but since updating to 2021.3.15f1, all intersection shaders (I've tried several tutorials and assets) just don't work anymore. I've toggled Depth Texture. Can anyone help?

    Attached Files:

  5. georgeq


    Mar 5, 2014
    I'm also tried the same tutorial in Unity 2023.3/4/5 and 6, but it seems to only work on the Scene View, it doesn't seem to work on the Game View. An odd behavior I noticed was that the Depth Buffer only seamed to work on the Game View when the Shader Graph windows was docked, undock Shader Graph or close it and the Depth Buffer stops working. Then accidentally clicked the pause button and all at the sudden the Depth Buffer worked even with the Shader Graph window closed, so that gave me an idea: I used to dock Shader Graph in the same cluster as the Scene View, but just for testing I docked it on another cluster, and this time the Depth Buffer did not work, why?... It seems it only works when the Scene View is either hidden or closed. Maximize the Game View so no other window is visible; Depth Buffer works, restore it to normal size; Depth Buffer doesn't work. Close the Scene View; Depth Buffer works, open the Scene View, Depth Buffer stop working...

    So... watch the tutorial again and notice he never has the Scene View and Game View visible a the same time.