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

Bug Shader Graph Replace Color Works In Editor But Not Android Build

Discussion in 'Shader Graph' started by sk4433, Feb 14, 2023.

  1. sk4433

    sk4433

    Joined:
    Sep 4, 2017
    Posts:
    6
    Basically I have a shader that uses replace color on my sprite's shirt, pants, shoes, skin color, and hair color. I set the default original color values of the sprite in script ("_From") properties and then set a specific color using material prop block ("_To") properties.

    code1.png code2.png

    It works perfectly in the editor but when I build it onto android platform, the colors stay as the default colors of red shirt/grey pants. Strangely enough, the skin/hair color do change colors in the build. Also the debug statements show that the ("_To") properties work properly and reflect the changed values.

    pic1.png pic2.jpg shader1.png
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    Does it work in windows builds?
    Then we know if its a general build issue or android issue
     
    adamgolden likes this.
  3. sk4433

    sk4433

    Joined:
    Sep 4, 2017
    Posts:
    6
    On windows build, the shader works as expected. Seems to be an android issue.
    pic3.png
     
  4. sk4433

    sk4433

    Joined:
    Sep 4, 2017
    Posts:
    6
    How can I fix the android issue?
     
  5. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    1. Try the latest LTS
    1.1 If it still happens, make a bug report from your project, android is having some issues lately
    2. Either wait for a fix, rewrite the shader, or try other unity versions