Hey! After looking through the examples here I achieved a solution that works for me.
I am using a greyscale texture mask with 6 different RGB values on it (0, 51, 102, 153, 204, 255). I want to grab each of these values and turn it into it's own B/W mask, where white is that value and black is everything else. I then use these masks individually to set a colour to each area.
Download link (was slightly too big for direct upload here): https://drive.google.com/open?id=1jAHy0 ... b-aSkPlcZvMy shader works by first grabbing everything of RGB value 0 and under and masks that out. I then increase my range for the next step, and subtract the previous mask to get my next mask.
A few things to note with my shader if you use your own texture:
- Shader uses the red channel of the texture
- Texture must be linear (disable sRGB in import settings)
- UV islands must have enough padding to avoid artifacts
I intend on using this technique along with other standard elements (metallic, roughness, detail maps etc) for my final shader which I might post in a separate thread once I've done. I've also moved the steps into a shader function to tidy up the layout, but I left it without it for my example so the flow is more clear.
Example using shader functionIf anyone has any tips for different/better ways I could do this let me know. And I hope this might be helpful for anyone trying to achieve the same result.