Hello! I’ve made a shader, which can change color of sprite using secondary textures:
And it perfectly works on objects, but how I can change color of tile using this shader? Just doing
Tilemap.GetTile<Tile>(cell).color = /*Calculated color, depends of spot where tile is placed*/
not works, it colors sprite as usual:
(something like that)
Just in case, this is how look like Color property in shader:
Unfortunately there’s no way to control how vertex color gets applied for SpriteLit / SpriteUnlit within Shader Graph. What it does is apply that color (the related node is Vertex Color node) but unfortunately it applies it automatically after your Shader Graph runs, whether or not you want it.
See here: Interact with SpriteRenderer color in ShaderGraph
Consider adding your use case to the discussion so the developers are aware that people want more control over this.
Resuming this after a year and half it still seems to be impossible to override the Vertex Color in Shader Graph?
Correct :(… You have two options:
- pre-divide by vertex color with your graph (so when later multiplied by vertexColor it’s been pre-canceled out)
- copy Sprite Lit from your Packages, manually modify its HLSL - but this loses access to Shader Graph
[mention|GT0NxMrd3UNN4r8VuGUreg==] Could you add this to your backlist? Plenty of people want the option to remove a single multiplication from Sprite Lit / Unlit so we can use Vertex Color more freely in ShaderGraph. A simple checkbox to toggle off the auto-application of vertex color would fix.