How I can choose the needed color from texture?

I have seven color texture mask.
How I can choose the needed color from texture? Colors in my texture mask can be variously. I need select needed color from final mask, seven color min.

use just the RGB and their output in the material node
reference youre topology with seperate UV masks for those “continents”.

hmm… IF there are seven colors… what would be an optimal way to separate them in the material editor…

I would do some combination of multiplication and if nodes. Multiply R * G for example, and that value will be zero for everything except Yellow and White. This assumes all of your values are either fully off or fully on - this strategy won’t work for the orange color in that map, since it’s (1,0.5,0), so I’d use an if node to separate out those 0.5 values.

So I was rather bored and felt like goofing off.
Its far from perfect, and needs optimization… but its a start :stuck_out_tongue:

That Youtube video isn’t working.

Very odd, works fine on YT self: UE4 - SuperMask Material function WIP - YouTube

It’s working now, are you just clamping those particular colors? I wonder how much more expensive it is than doing using a 5 layer mask with RGBA.

Way I did is is very hacky/crappy.
Its almost always better to combine three alpha channels back into a seperate RGB channel though, alpha’s result in much bigger filesizes.
If I have some time I’ll see if I can make a very optimized one and see if its worth it complexity wise.

Finally had some time to optimize it, I’m sure there are better ways on doing this, and could be optimized even further… but hey :slight_smile:
Ill upload the file tomorrow or so.

Sorry for the massive delay.

That for RGBCMYK colors. Avoid the White color because is the sum of others.

If you need more colors, you can convert the image before to grayscale 0-255 and use the method explained by Ryan Brucks here: