Easiest (best) way to define different roughness witha color map?

Beginner question. So I have diffuse color map (mask) and depending on the color I want different roughness or metalic value etc. I saw the docs about layered metarials and material functions, but I wonder if there is an other way since i don’t want completely different materials, but just some difference.

2nd question: (I might make a new question for it if doesn’t get answered here) i wonder If there is a way to define materials with a color map(mask) where I don’t just use the absolute values of the different RGB channels, but have colors like pink, orange, light and dark green etc and I could use the different colors as different masks. Sry If my explanation is not the best.


Hi mzprox -

Beginner Answer - Assuming that your color map has no overlapping map sections, you could use IF statements added together to define the values of roughness and metallic, so for those settings it would be 6 IF comparisons, 3 added together for Roughness and 3 added together for Metallic. (Info on If is here.)

2nd Answer - This question sort of has the same answer. Again, Assuming that you are dealing with “pure,” no dither or anti-aliasing or overlapping colors in that map, you could compare your map to a Constant 3 value assigned to that color in an IF statement to get a result. This is not perfect as a texture that is not saved as Alpha-unmatted will have edge errors in this method.

Thank You -

Eric Ketchum

it answers my first question, thanks.
About the 2nd I1m not sure, but if i had to use IF comparsions it would be quite complicated.