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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Hue-Shifting shader with texture support.

Discussion in 'Shaders' started by okarad, Aug 19, 2022.

  1. okarad

    okarad

    Joined:
    Sep 14, 2018
    Posts:
    5
    I want to make a hue-shifting shader like in this gif but i can't seem to figure out or understand how to do it at all.
     
  2. okarad

    okarad

    Joined:
    Sep 14, 2018
    Posts:
    5
    Ended up solving it myself:
    Made a shader with a hue shift slider and added a simple script to the gameobject.
    Code (CSharp):
    1. public Material mat;
    2.  
    3.     void Update()
    4.     {
    5.         mat.SetFloat("_HueShift", Mathf.PingPong(Time.time, 6));
    6.     }