Use glossiness in metal-roughness mode

Hey, babylonjs forum!

Recently we changed from Specular/Glossiness to metal-roughness mode in supporting with gltf pbr material extension KHR_materials_specular

We used microSurfaceTexture for glossiness In Specular/Glossiness mode, and now the microSurfaceTexture not work because it’s not Specular/Glossiness mode.

So Is there any texture channel for glossiness in metal-roughness mode, or how to inverse a roughness map to a glossiness map(maybe oneminus) like the Sketchfab:

image

Hi,
I’m not 100% sure (that there hasn’t been any improvements from v7) but, from what I know, I don’t think you can achieve glossiness using the ‘basic’ PBRMetallicRoughnessMaterial. There’s no channel for that. The PBR specular/glossiness and the metallic/roughness are two different materials/pipelines using a different approach. You could go with just the standard PBRMaterial. You would have a number of options/channels there to set-up glossiness (i.e. a clearcoat or a microsurface texture).

Thx for your answer.

We are using standard PBRMaterial and if roughness, metallic or metallicTexture is not null, the standard PBRMaterial will be in metallic mode.

PBR document shows the microsurface texture is a channel for roughness in metallic mode and for glossiness in specular mode.

The microsurface texture represents the roughness channel in metallic mode. if there is no channel for glossiness in metallic workflow, And we know the glossiness is just inverted roughness, so is there any other approach to inverse the roughness map as glossiness map?

Not sure if there is an “Invert”. I see there is an option in Texture constructor for “invertY”. Would that work?

Worst case, could you readPixels() on the texture then generate the inverse as needed using MAXVALUE - pixelValue on whichever channels are relevant?

We do not support a metal/gloss workflow, you could use NME or material plugin to create your own workflow ?

Yeah, we are planning to use material plugin to render glossiness.
It’s a little difficult for us :laughing: we are thinking to get microSurfaceTexture and then negative it in fragment shader refer to three.js discussion. But in babylonjs fragment shader we don’t know how get microSurfaceTexture channel.

That’s a good idea. Maybe we can try it.