Okay, I think I want a shader that lets me recolor things on the fly, kind of like if I were using a color fill layer in Photoshop with the Overlay or Hard Light blend modes set with variable opacity. I know about changing the base color of a model, but that doesn’t quite have the effect I’m looking for. The problem with changing the base color is that the texture it’s multiplying uses it as the brightest color value when you’d ideally keep some white in the highlights and whatnot.
The textures are supposed to be designed so that the midtone is a middle gray (RGB 127 127 127), the highlights are brighter, and the shadows are darker. The selected color needs to be blended with the texture in such a manner that the middle gray regions adopt the color at its full value, the darker regions darken the selected color, and the highlights brighten the selected color (up to a pure white or a much lighter shade of the selected color).
To complicate things a bit more, the texture needs an alpha channel of sorts that only defines the areas that the selected color is allowed to change. (Picture a car as an example–the glass, headlights, grill, tires, and whatever shouldn’t be touched, so the texture alpha would mask out those parts and only allow the paint to be changed.)
The reason I’m thinking about that is because the application I’m working on is looking like it would need to use a lot of textures, and if I can remove the need for including duplicates in all possible color schemes, then I can cut down on the number of textures needed by simply recoloring a much smaller set of base gray textures as needed.
I read the ShaderLab documentation and came to the conclusion that because I didn’t really understand much of it, then obviously I’m not ready to get into writing shaders. :lol:
In the spirit of learning to walk before I run, can anyone recommend some good books or online resources that I can use to better understand how shaders work and how they ought to be written? Bonus points if those books/online resources explain things to me like I’m a slobbering idiot.
Thanks!