Search Unity

Resolved Depth difference in world units

Discussion in 'Shader Graph' started by illinar, Aug 10, 2021.

  1. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    EDIT: Nevermind! My mistake. I added multiplier to the depth, it caused this behavior.

    How can I get depth difference between screen and fragment (buffer and currently drawn pixel) in world units so it is not dependant on distance from the camera?

    I see everyone doing water edges this way:

    upload_2021-8-10_14-58-44.png

    But the result looks very different at different distances.

    CorrectLook.jpg

    Incorrect Look.jpg

    In Amplify editor I think that depth difference was constant.. What can I do to achieve a consistent look? Manually adjust for distance?
     
    Last edited: Aug 10, 2021