Search Unity

Question Sample Gradient results in a broken (pink) shader

Discussion in 'Shader Graph' started by Barrelrolla, Jun 6, 2019.

  1. Barrelrolla

    Barrelrolla

    Joined:
    Jun 2, 2019
    Posts:
    2
    Hi!
    I've been playing around with Shader Graph and I wanted to make shader that changes color over time and attached a Sample Gradient node to the Albedo with a time node. With the default white to black color everything works as exepcted, but when I change the white color to any other color the preview in shader graph works, but when applied to a material, the material becomes pink. Also some errors appear in the shader inspector, but they don't mean anything to me.
    I'm interested in what causes this so I can avoid it in the future.
    Here are screenshots:
    works.png worksnot.png
     
    unity_BuCg_LCrXDEUjg likes this.
  2. Barrelrolla

    Barrelrolla

    Joined:
    Jun 2, 2019
    Posts:
    2
    Can someone try this to see if the issue is on my side?
     
    unity_BuCg_LCrXDEUjg likes this.
  3. Fernando-Ferreira

    Fernando-Ferreira

    Joined:
    Nov 9, 2015
    Posts:
    13
    Same on

    - 2019.3.0a7
    - 2019.1.4f1
    - 2018.3...
    - 2018.2...
    - 2018.1...

    only works if you use 2 color in your gradients

    upload_2019-7-6_16-49-8.png
     
    unity_BuCg_LCrXDEUjg likes this.
  4. rejome

    rejome

    Joined:
    Sep 28, 2013
    Posts:
    1
    Hello,

    This is due to an issue during the generation of the shader on systems with "," character as decimal.
    The values used in the Gradient end up in a function but, as the values are generated like "0,25" instead of "0.25", the compiler is lost in the number of arguments passed to the function...

    I used the "Report a bug" feature to raise the issue.
    Wait and see!
    :)
     
    unity_BuCg_LCrXDEUjg likes this.
  5. ju_my

    ju_my

    Joined:
    Mar 7, 2017
    Posts:
    23
    Hi, do you have a link to your bug report to upvote it? I'm having this issue too.
     
  6. xAvatarchikx

    xAvatarchikx

    Joined:
    Aug 17, 2012
    Posts:
    69
    Last edited: Sep 13, 2019
  7. bucho2

    bucho2

    Joined:
    Jan 3, 2016
    Posts:
    13
    very good, xAvatarchikx... that solved it for now... thanks!... :)
    hope unity fixes that soon