I think I found a bug where adding a PBR Material to a mesh and then exporting it to GLB
caused the material to be removed from the exported file. If I switch the material to Standard
it works fine.
Here’s the playground:
It is because PBRSpecGloss materials are not supported for export, you could use either a PBRMaterial or a PBRMaterialRough one to ensure your export works fine (a warning is emitted telling the mat is not supported in the console)
Thanks, that clears things up. I should have checked the log. Are there plans to support it?
Ping @Drigax and @bghgary for the plan
I don’t believe there are currently any plans to support it. Feel free to file a feature request.
Currently no plans to support KHR_materials_pbrSpecularGlossiness for export, but that can always be changed given enough demand for the extension.
Thanks for the info you guys. We can get around the issue by serialising materials separately.
Hi, we are using BabylonJS to render fabrics. Now we want to export our scenes to GLTF/GLB which is working fine so far. There are some effects in fabrics which can be approximated very well using the SPEC/GLOSS workflow. Therefore it is absolutly necessary for us to keep our data in that workflow. So my question is if there is any realistic chance to see the export of GLTF/GLB to support the KHR_materials_pbrSpecularGlossiness extension? And even further. Could the import than support SPEC/GLOSS as well without converting it to METAL/ROUGH?
Thanks so far! Gabriel
This is a good question for @bghgary
Import (e.g. glTF loader) already supports spec/gloss. I’m a bit hesitant to add export support for spec/gloss as this extension is being deprecated by the Khronos 3D formats working group in favor of the KHR_materials_specular extension (which is still in PR).
For fabrics specifically, using spec/gloss is somewhat of a hack. You might consider using KHR_materials_sheen extension, but again it’s not merged yet (but it is very close). You can see an example here.