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.
  2. Dismiss Notice

Question How to create distortion wiht depth test

Discussion in 'Shader Graph' started by Bordeaux_Fox, May 28, 2020.

  1. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Hello,

    I'm currently adding some distortion effects to my shaders by using the scene color node with a normal map.
    But I'm not satisfied with the results since the distortion also takes objects before the mesh into account.
    I'm using HDRP. So what's the best way of getting rid on the artefacts showing by red arrows in the image? I already setup some nodes to get the scene depth.
     

    Attached Files:

  2. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Bump, anyone knows if it is possible? I saw a lot of different shader graph examples (like water shaders, distortion shaders). All of them have the same kind of problem: The distortion also affect objects in the foreground.

    Basically what I need is the HDRP Unlit Transparent Distortion Shader, just as a "Lit" version.
     
  3. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
  4. binoman

    binoman

    Joined:
    Sep 29, 2016
    Posts:
    13
    I have the same problem!