Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved URP - scene depth node in shadergraph not working on mobile

Discussion in 'Shader Graph' started by RyanTexture, Apr 18, 2022.

  1. RyanTexture

    RyanTexture

    Joined:
    Jun 10, 2020
    Posts:
    16
    Hi there,

    I am trying to recreate this intersection effect, but on mobile, however the scene depth node doesnt seem to work. instead of the color falling off when theres an object behind, the entire shader just displays white. will edit with screenshots.

    editor view :


    Mobile view:


    im using this video as reference (yes i know its a little old, but the effect works in the editor) :


    ive done a search but only got results for unity 2019. im using:

    Unity 2020.3.29f1
    URP 10.8.1
    Shadergraph 10.8.1

    Thanks in advance
     
    Last edited: Apr 18, 2022
  2. RyanTexture

    RyanTexture

    Joined:
    Jun 10, 2020
    Posts:
    16
    Im guessing that this has something to do with mobile shader precision settings, however i am unable to determine where i can change this. if anyone has any info about this, it would be greatly appreciated. solutions on google dont really help much at the present moment.
     
  3. RyanTexture

    RyanTexture

    Joined:
    Jun 10, 2020
    Posts:
    16
    update: changing the shader precision model in settings to "Use Full Sampler Precision by default" doesnt work...
     
  4. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,239
    If you've started out with URP project template, check if the "Depth Texture" option is enabled on the UniversalRP-LowQuality pipeline asset.
    upload_2022-4-21_17-29-33.png

    This is what's being used by default on a mobile device, whilst in the editor the UniversalRP-HighQuality pipeline is active, where you probably have the Depth Texture option enabled.

    When it's disabled, using the depth node in any shader yields the result you're now seeing.
     
    RyanTexture likes this.
  5. RyanTexture

    RyanTexture

    Joined:
    Jun 10, 2020
    Posts:
    16
    @StaggartCreations thank you very much for your insight. i think it solves the problem!