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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

HDRP Trouble with order of distortion shader

Discussion in 'High Definition Render Pipeline' started by lnm95, May 26, 2021.

  1. lnm95

    lnm95

    Joined:
    Feb 2, 2019
    Posts:
    8
    I make a water and have some issue with distortion order. I have two shaders (shader graph): color and distortion. Next I create two objects with same mesh and apply shaders. Distortion object have some offset to be placed under color object.

    I tryed next variants:

    1: As is. Trouble: Color object override distortions.

    2: Color object replaced* to custom pass. Trouble: object not receive SSR (look like without reflections).

    3: Distortion object replaced* to custom pass. Trouble: just not work.

    * - object layer disabled in camera culling mask, and created custom pass volume with need layer.

    ** - under distortion I mean master-node-lit distortion option https://docs.unity3d.com/Packages/c...h-definition@10.2/manual/Master-Node-Lit.html

    Any ideas how fix SSR in second variant or make correct distortion order? Or anything else?

    WaterTroubles.png
     
  2. lnm95

    lnm95

    Joined:
    Feb 2, 2019
    Posts:
    8
    Still can't found how correct use distortion option. Maked same effect by using hd scene color node. But that also not perfect, because using lit shader and so have incorrect lighting on evening.
     
  3. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    868
    Hi, sorry but it is a bit hard to follow what you are doing in particualr as you seems to have a cusotm pass, so I provide information in case it can help

    We have two type of distor effect:

    - one we name Refraction: (Lit Refraction for example) and one we name Distortion.
    Order is as show on this diagram: https://docs.unity3d.com/Packages/c....0/manual/images/HDRP-frame-graph-diagram.png

    when you sample HDSceneColor in shadergraph you are in the Refraction case.

    In Refraction case you case there is transparent object that are render in the pre-refraction pass (based on the rendering pass) and only those are visible though refrcative object (i.e object sampling HD Scene color), other regular transparent object will not be visible through it.

    hope those information can help.
     
  4. lnm95

    lnm95

    Joined:
    Feb 2, 2019
    Posts:
    8
    The diagram really helpful, thanks. As I understand now the Distortion better use for some heat effect or something like, because it work after Transparent pass. And yeah, I already done wanted effect with HD Scene color.
     
  5. binoman

    binoman

    Joined:
    Sep 29, 2016
    Posts:
    13
    I also have similar issues with distortion depth. When I use it it effects all objects that hit the same pixel, regardless of the depth of the object.
     
  6. UrbanNuke

    UrbanNuke

    Joined:
    Jun 11, 2019
    Posts:
    13
    The same thing. Have you found a solution?