You’re right, the PBRSpecularGlossinessMaterial material is not handled by the exporter.
Maybe it’s expected (because the spec has deprecated it in favor of the metallic workflow?) because PBRMetallicRoughnessMaterial is explicitely tested but not PBRSpecularGlossinessMaterial, so I will let @Drigax answer this one.
I spent some time looking into this, I think this originally broke when we deprecated the PBRSpecularGlossiness and PBRMetallicRoughness materials in favor of a unified omni PBRMaterial.
Currently we don’t provide conversion from the old material to the new material, and seemed to break the old export pipeline from what I currently gather.
Going to open some issues to track this…I definitely think we should provide some ability to convert from the legacy material model to the new one…
Actually, the 2 specgloss/metalrough are meant to be simpler version following the gltf naming convention as the main mat auto switches workflow depending of what has been filled in.
everything in the end goes through the pbrBaseMaterial and the conversion should be straightforward at this level.
They are not deprecated but more suited to ppl creating materials via code for their simplicity (only one workflow and not all the options).
The Khronos 3d formats working group and PBR Next technical subgroup have been considering discouraging the use of the KHR_materials_specularGlossiness in favor of using KHR_materials_specular once the WG submits it for ratification and it gets ratified. Both extensions, by definition, are not part of the core spec.
Both KHR_materials_specularGlossiness and KHR_materials_specular are implemented in the Babylon.js glTF loader. The latter is marked as experimental.
For the exporter, there are a few options:
Export KHR_materials_specularGlossiness extension in the glTF.
Export KHR_materials_specular extension in the glTF.
Convert specular/glossiness to metallic/roughness via a lossy algorithm.
Or we do some/all of them and let the user choose.
@aWeirdo I don’t know what your scenario is, but if it’s possible, the best course of action is to use metallic/roughness workflow at the source. Then you won’t have any issues.
Thank you for the explaination, that makes more sense now.
Ideally i would like to export the materials, either as extensions(optimal) or converted.
But i can also settle for a exposed/static convertion tool which i could use on import rather than export.
In the end i just need a method to handle these materials so they’re not lost in the process