Import glTF file with the material sheen extension is not enabled by default

In glTF file, the bottleexport_baked_material sheen extension is enabled by default, Then loaded in babylonjs engine.

Tested in babylonjs version 7.18.0, sheen is enbaled by default

Tested in babylonjs version 7.24.0, sheen is disabled by default

Is this a feature or bug? Here is the PG

cc @bghgary

The root cause is the asset is missing the extensionsUsed property defining what extensions are used in the glTF. The glTF validator gives a whole bunch of severity 0 issues relating to this.

      {
        "code": "UNDECLARED_EXTENSION",
        "message": "Extension is not declared in extensionsUsed.",
        "severity": 0,
        "pointer": "/materials/0/extensions/KHR_materials_specular"
      },

I’m not exactly sure why it was enabled in 7.18.0, but it’s probably due to an issue with the inspector turning on all the glTF loader extensions even if they are not used, which has been recently fixed. cc @ryantrem

We’ve been making improvements to allow JS chunks to be downloaded lazily only when needed, and this includes scene loaders and glTF loader extensions. This means we now only load glTF extensions if they are listed in extensionsUsed. It’s also true that inspector used to force enable all extensions, and we changed this to not happen by default. In fact, now the flags in inspector are more overrides to disable extensions that would otherwise be used. If they aren’t listed in extensionsUsed, they still won’t load, even if inspector toggles them on. If it is useful to be able to force enable an extension through inspector, we could see about changing this behavior.

1 Like