Sample Gradient results in a broken (pink) shader

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:

Can someone try this to see if the issue is on my side?

Same on

  • 2019.3.0a7
  • 2019.1.4f1
  • 2018.3…
  • 2018.2…
  • 2018.1…

only works if you use 2 color in your gradients

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!
:slight_smile:

Hi, do you have a link to your bug report to upvote it? I’m having this issue too.

Found such a solution:
In the file GradientShaderProperty.cs you need to add .ToString (System.Globalization.CultureInfo.InvariantCulture) so that it displays in the format “0.0”, not in “0.0”

very good, xAvatarchikx… that solved it for now… thanks!.. :slight_smile:
hope unity fixes that soon