Initially I had 2 different textures for a "green link" and "red link", but I knew that wouldn't scale well.
So I started looking at shaderGraph. I have some experience using Unreal's shader editor, and turns out it was indeed really similar.
What I needed to do was have a texture with each area I wanted to color, what way I could set each area with the color I wanted.
My first solution was to have a different texture for each color, with all 3 sampled by the shader and composed into the final sprite.
It worked. But, again, that little voice of "this won't scale well" kept ringing. Imagine needing 3 or 4 different textures for each object.
So after a quick google search for possible solutions, I decided to make each different color be defined on a different color channel of a main texture.
That way I only need a single texture for everything and I get to color all the sprites however I want in runtime!
Since I usually work *with* artists I don't usually get to mess with shaders all that much. I've dabbled on writing shader code over the years, but this is my first time actually using shader graph. It's pretty good, I'm impressed!
Now I only need to learn how to organize shadergraphs properly. This little shader is already a mess.
5 comments