From a SpriteRenderer or Image component, how do you set the main color of a shader made in Shader Graph?
I’ve written a very simple test shader (which you can see below), with a color property whose name and reference value are set to “_Color”. Yet, as you can see in the picture below, when I change the color value of a SpriteRenderer or Image component, the value isn’t changed. I’ve also tried “_BaseColor”, but this doesn’t work either.
I was thinking that it perhaps has something to do with a missing [PerRendererData] flag in the compiled shader, but I haven’t been able to find a way to mark a shader property that way in Shader Graph.
Does anyone know how to solve this issue? I feel like I’m missing something obvious, but I’m kinda stumped regardless.
For anyone else having the same issue, setting the material type to “Sprite Unlit” resolved the issue for me. Not sure what this option changes behind the scenes, but hey it works, I’ll take it.