Invert Alpha Channel Math?

I am trying to invert an alpha channel of a texture but the math seems to be coming out incorrect using a OneMinus. Is this a common problem? Does an Alpha channel us a different range than R, G, B?

I’m inputting the alpha into the roughness of a material, does roughness require a different range over base colour?

Thanks.

You cant get the best result if you plug the roughness map directly into roughness input. Try using it as the alpha of a Lerp node, then set the values within that Lerp for min. and max. roughness. This way you wont even have to invert the texture since you can just switch the input of the values as you wish.

Thanks for your support Jacky, I tried Lerp but it produced the same results. I think I might have gotten to the bottom of it though, I’m not sure when or if the gamma correction is applied in the process of calculating the map. I spoke to some friends and got some advice to try and Power0.45, OneMinus then Power2.2 to essentially remove gamma correction, invert the texture then add it back on again. I’m going to try it when I get home and fingers crossed it gives me accurate results.

Well, I managed to almost get an identical result. But the solution was incredibly strange and honestly have no idea whats going on.

I had to add a Power 0.55 then invert the result with OneMinus. I have no idea why I have to use a power of 0.55 as that doesn’t fit onto any known gamma value.

Is it possible I could also be causing problems with incorrect Photoshop settings?

Can you show us the textures and your material setup, and what exactly you want it to look like please?

So both textures where imported with SRGB ticked, one was inverted in Photoshop, the other was inverted in the material editor. Both using an output of Alpha and both previewing the result of what is going into the Roughness channel.

The reason I’m striving to get the math perfect is because PBR relies heavily on very fine values. I want to make sure those values are spot on. I know I could simply author my Roughness inverted, but its not the way I’m used to working and have a lot of art already created with it the other way around from UnrealEngine.

Well, i’m by no means an expert, but let me explain how i’d manage my masks and the basic material, and hopefully it’ll be helpful to you.

The first thing i’d do is store the metallic and roughness maps in red and green channels of a single texture. All you need for roughness and metallic is values between 0 and 1 so you can store and get those in a single channel for each. Then use Lerp to mask the minimum and maximum values you want to have for each map and input, and that’s pretty much it. Later on you can multiply and Lerp more masks to get more details if you like.

I’m still not sure why you are trying to invert the alpha so feel free to head to the forums to get more perspective on this. Not everyone checks AnswerHub so you may find more experienced people lurking around there.

Yeah I think I will re-evaluate how I’m going about breaking up my maps. Thanks for all the help guys!