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

FX/Glass/Stained Bump Distort to Shader Graph

Discussion in 'Shaders' started by Tino7, Sep 7, 2018.

  1. Tino7

    Tino7

    Joined:
    Apr 20, 2018
    Posts:
    1
    How to create Stained Bump Distort Shader in new unity Shader Graph?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    You can't. The new render pipelines don't (yet) support distortion, so it's not even really possible with hand written shaders either.
     
  3. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    466
    It's possible with some overhead.
    He can render the scene to temp render target and for fixing "image recursion" he can use follow code

    C#:

    Shader.EnableKeyword("DISTORT_OFF");
    camera.Render();
    Shader.DisableKeyword("DISTORT_OFF");

    Glass shader :

    #pragma multi_compile _ DISTORT_OFF
    .....
    //fragment pass

    #if DISTORT_OFF
    return 0;
    #endif

    Anyway I don't understand Unity logic. They removed "grab pass" and all waters/distortions/glasses effects does not work anymore.
    Remove the half of function and the preview!
     
  4. HummeL_AL

    HummeL_AL

    Joined:
    May 31, 2019
    Posts:
    10
    Yeah, this is a necropost, but i very need in this thread. Can I remake the FX/Glass/Stained Bump Distort now?
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    Yes. Do a google search for Shader Graph Distortion.
     
  6. schlenger

    schlenger

    Joined:
    Jul 13, 2016
    Posts:
    7
    Any news on this?