Metallic / roughness texture in PBR class

once you set the texture , both roughness and metallic properties become scalars of the texture values.

setting “useMetallnessFromMetallicTextureBlue” to false will change nothing because it will read from red by default as per the docs.

Ideally you just need to create metallic/roughness texture with all white in the red channel , then the scalar will behave as you are expecting it to behave as if there was no texture.

This is a bit of a bummer having to always doctor the textures for expected behaviour. I myself have crossed this path and just coded some hack in my system to get around it. Someone posted aboutthe same sort of issue recently and I shared my code I used. My code was created to basically be able to just set a roughness texture from an external texture load as if the material supported just roughness. The code then created the combined result texture expected by the material class , and just pushed all white into metal channel.

hth ( ps , honestly I think they should at least add two properties to the pbr material in relation to this , to tell it to use the texture for both or not. eg roughnessScalarIgnoreTexture:Boolean , metallicScalarIgnoreTexture:Boolean. Both default to false , so then the engine continues to function as always , so backward compatibility is not affected , but now there is control to tell either scalar to behave as if there was no texture , so a metallicTuxture can now be only a metallic or only a roughness texture )

2 Likes