UnityGLTF not using Roughness map from Metallic Alpha or Green I Blue channel

This may be more of a UnityGLTF question but here goes: When using UnityGLTF/PBRGraph, does the Roughness-Metallic map slot use the alpha of the imported texture or the Green/Blue channel of the texture as in either case the roughness doesn’t appear to be working. In the screenshot attached, the bottom most mesh is using a Unity URP Lit material with the metallic/roughness texture in the metallic map slot, Roughness source set to Metallic alpha.
The other 2 meshes above it are from UnityGLTF and GLTFast imports with that same texture, one is using a custom applied material of UnityGLTF/PBRGraph with that same metallicroughness texture applied. I verified the roughness isn’t working by changing the URP/Lit>Metallic Map - roughness source to ‘albedo alpha’ in the screenshot with the red arrow in
image.png
image.png

Original Post on Discord

by user 103054507105067008

I noticed this as the model in Needle is using roughness correctly when exported in a local or production build, just the Unity viewport/scene view is not using roughness which produces inconsistency

by user 103054507105067008

Minimal repro here > @herbst🌵 let me know if I should open a git issue for this on UnityGLTF https://drive.google.com/file/d/1MwKph6opyHkW7X-SvkLBfsGjO6t9bYDG/view?usp=share_link

by user 103054507105067008

Evidence that the roughness isn’t being applied

by user 103054507105067008

Raised a git issue with GLTFast about it too as it happens with their importer https://github.com/atteneder/glTFast/issues/555

by user 103054507105067008

Not sure I understand the issue here. The gif is from URP Lit, right?

glTF always uses ORM format, I believe that’s explained as part of the tooltip of the map too

Do you mean that conversion feature is missing when converting to the PBRGraph shader?

Note that when you have a roughness map and put the roughnessFactor to 0 that means you want the map to be ignored. Make sure roughnessFactor is 1 when you use a map.

If the material is generated with roughness factor, how can I change it?

by user 103054507105067008

You mean it’s imported this way from a glTF/glb? But you’re changing it in the videos above. Sorry can’t quite follow

If it imports with both a roughness map and roughness set to 0, whatever you exported it messed up - or it has really been authored like this

When imported in Three.js in Needle using droploader the roughness pulls in fine

by user 103054507105067008

And when using Don McCurdy GLTF Viewer it looks fine just in UnityGLTF/GLTFast the roughness isn’t used so I’m trying to diagnose why it is inconsistent in Unity Loaders vs Three.js and Blender where it pulls in fine

by user 103054507105067008

I’ll post just the test model here in a moment

by user 103054507105067008

The model as GTLF + separate here, try it out in any web Three.js viewer and compare vs the UnityGLTF/GLTFast import in the roughness of it

by user 103054507105067008

I just meant if the imported GLTF file with UnityGLTF with its embedded PBR material has roughnessFactor at 0 by default despite there being a roughness defined in the GLTF file, do I have to always create and assign a new material just in Unity to fix that?

by user 103054507105067008

Nothing strange happening in the nodes in Blender either, I matched the layout and spec of the shader nodes in the Damaged Helmet GLTF sample file to be sure

by user 103054507105067008

You can see that exact zipped gltf+separate file in Unity using UnityGLTF vs Blender imported vs gltf.report imported

by user 103054507105067008

UnityGLTF PBR-Graph Shader Roughness-metallic map supports the alpha channel of the metallic map having the roughness but that isn’t what Blender exports to a GLTF, you can see here if I swap in this .Tif file in the repro project which is the Metallic with Roughness in alpha channel, the roughness works (Video: https://drive.google.com/file/d/1qqCuIKS9BobG-xtJkY33Yr2sYuVDqrVO/view?usp=sharing), whereas the Blender exported Metallic map that uses the RGB Green channel of the Metallic map for Roughness and the Blue channel for Metallic doesn’t work correctly. Is there a reason for this and why other GLTF loaders like Blender/Three.js/gltf.report support the Green and Blue channel for Roughness and Metallic on the metallic map?

by user 103054507105067008