Material Masks help

Hey guys, i need some help with material blueprints :c

This is my UV

This is a mask that i created

I saw some tutorials but i cant do this right…

I want this colors sections separately to be manipulated, its possible to do it? if yes, any tips?

Thanks !!!

You can do this through materials using lerps and different channels from your mask. Then simply use constant 3 parameters to manipulate the color values in the desired masked areas. Plug the red channel in the alpha slot of a lerp for example. The black of that particular alpha corresponds with input A, while the white corresponds with input B. Multiply the desired masked area by a constant 3 parameter, and then plug into another lerp until you get all of your masked areas setup.

Hello, first of all thanks for your help!

Now… im having some issues completing what you tried to say, this is my setup:

But isnt working like i want,
i want the red to be Roughness and the green to be metalic and specular, but for some reason they are affecting each other.

Thanks again

Multiplying the Lerp outputs is unnecessary i think. If you really need it do the multiplying with a float before connecting the red(and green) channel to the alpha input of the lerp.

So i have this:

The Red and blue both have different roughness values.

But now i want the green to be metallic but isn’t working like i want

So in the end what i want is:
Red and blue with different roughness and green (only green) to be metallic.

Thanks again !!

Check out this Material How - To about Masking as it has a lot of pointers in it.

Also if you are storing different masks in the RGB channels of Textures you can just plug your Metallic Texture into the Metallic slot. What you have is not wrong, it’s just more complex than you need it to be.

So i disable the sRGB and set to Linear Color, now im doing some tests, so why if i connect the red channel to the roughness slot i got this:

Everything is inverted… i just want the red to be roughness

Ok here are some screen grabs of a material where I use masks to assign different color and pbr values to specified areas. As has been mentioned, you don’t need to multiply the Lerps, simply plug them into each other until you don’t need anymore, then plug the last one into the material’s diffuse input. The second image shows how you can use the same masking method for pbr. Hope this helps.

The backwards roughness is an easy fix. Just go into Photoshop or whatever it is you use and invert the red channel. To do this in Photoshop I would just select the red channel in Channels pallet and then use CTRL + I on the keyboard to invert what is there. Then export, re-import, and BAM you should have your Roughness the right way round.

The next part will send us a bit down the rabbit hole because it deals with Linear Space and Gamma Space and those can be a bit hard to wrap your head around at first. So with that I am going to try and give you the a version that only touches on the high points as there is way more to the subject that I can cover here. With that out of the way, What is Gamma Correction? well super high level, Gamma Correction came around because not all displays are the same which means that the image you are trying to make might not look the same everywhere it is viewed. Gamma Correction address this by raising the luminance values of the image you made to make up for any shortcomings the display you are viewing it on might have. This way when viewed the image will look the way you intended it to.

You can see this for your self in UE4 if you just check and uncheck sRGB on a Texture. When sRGB is checked the Texture will be bright, gamma corrected, and when unchecked it is rather dark, non -Gamma Corrected. Disabling Gamma Correction, or turning off sRGB, on Roughness and Normal Textures is needed because those Textures store values instead of just color information. The values that these Textures store are then read by the Material to do things like offset the way the surface normal is displayed(Normal Mapping) or control how much light and object can reflect (Roughness). If you Gamma Correct these values you will be changing their information and you do not want to do that because the information is already correct.

So do you need to disable sRGB on your Roughness? No you do not have to, it will still work but it will not be PBR correct and if you are trying to do anything that uses photorealistic images you will not be able to match the value correctly. So in the end I would always go with disabling sRGB as it is the correct way to do things with a PBR implementation. But remember disable sRGB only on Textures that are used as Masks or Normal Textures.

wow guys i realy did it:

Thanks SE_JonF your example was amazing!!
Thanks Sam Deiter thanks for your explanation… i really didn’t know about the sRGB, i really appreciate it!!

Next step its to emit yellow light, thanks again!!

Sweet glad to see that you got it working. As you will soon find out, Texture Masking is insanely powerful and something I use all the time.

Glad you got it to work Ivo. =)