Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Help Wanted Synchronising displacement & color

Discussion in 'Shader Graph' started by spicymuffin, Apr 9, 2021.

  1. spicymuffin

    spicymuffin

    Joined:
    Jan 18, 2020
    Posts:
    4
    Hi! I am new to shader graphs in unity. I was trying to make this energy shield that pulsates and displaces its faces using the sine of time.
    Here is my "code" that generates the displacement map over time using a gradient texture:
    upload_2021-4-9_15-28-57.png
    the gradient:
    upload_2021-4-9_15-30-21.png
    The displacement map is basically scrolling "ray":
    upload_2021-4-9_15-31-49.png
    Now I thought of overlaying a color over this ray and essentially synchronizing the color and displacement:
    upload_2021-4-9_15-38-5.png
    For some reason when the ray is sampled through object-space normal color and displacement desync. When the ray is sampled through view-space normal everything works.

    Here, a youtube video I uploaded demonstrating it:


    What am I doing wrong? Any help is greatly appreciated. Thanks! :D
     
unityunity