GLTF material.emissiveStrength is not exported (though imported)

Hello!
I’ve noticed that Babylon’s GLTF-importer respects the KHR_materials_emissive_strength extension and scales material.emissiveColor[BJS] by emissiveStrength [GLTF].

On the other hand, Babylon’s gltf exporter doesn’t seem to utilize the extension which results in PBRMaterials using emissiveIntensity looking different in 3rd party software (Blender).

@RaananW Should we consider emissiveIntensity [BJS] to be the same as emissiveStrength [GLTF] and add it to the exporter and probably use it instead of scaling emissiveColor in the importer?

1 Like

CC @sebavan (PBR) and @bghgary (glTF)

EmissiveIntensity is not something we should export but more a material tweak/debug way of removing emissive channels without changing its own values. It does not have proper equivalent everywhere.

For GLTF we export emissive strength as being the max channel of the current emissive color if it is superior to 1.

1 Like

So the main problem here is that the material “tweaked” this way stops being compatible with other software. In our project we exposed the emissive channel in the following way:
Screenshot from 2023-02-06 20-10-05
And the intensity is also there as it is a typical way to do this in 3D software.

I don’t really understand the reasoning behind not exporting it. E.g. Blender having these settings:
Screenshot from 2023-02-06 20-19-56
produces the following gltf-output for materials and feels perfectly fine with this:

    "materials" : [
        {
            "doubleSided" : true,
            "emissiveFactor" : [
                1,
                1,
                1
            ],
            "extensions" : {
                "KHR_materials_emissive_strength" : {
                    "emissiveStrength" : 2
                }
            },
            "name" : "Material.001",
            "pbrMetallicRoughness" : {
                "baseColorFactor" : [
                    0.800000011920929,
                    0.800000011920929,
                    0.800000011920929,
                    1
                ],
                "metallicFactor" : 0,
                "roughnessFactor" : 0.5
            }
        }
    ],

glTF to Babylon is not a 1:1 mapping, so some information will be lost. In this case, Babylon doesn’t have an emissiveStrength property corresponding to the glTF. That information is lost after importing a glTF with this extension. Round tripping glTF through Babylon isn’t currently something to rely on. There are many different scenarios where the exported glTF structure will be different from the imported glTF even if no properties were changed going through Babylon. The rendering should be the same though where possible.

Thanks for the explanation.
Still going back to emissiveStrength could you please explain me why BJS’s emissiveIntensity can’t be directly translated to this property?

It is mainly an arbitrary choice not to. Nothing technically prevents it.

But If we were to match it on export, it would be weird to not also transfer the rest of the intensities like:

  • directIntensity
  • environmentIntensity
  • specularIntensity

And unfortunately those have no equivalent at all so we preferred to factor the value in the emissive color which is not bound to 0-1 in babylon

1 Like

Ok. Thanks. That’s reasonable I guess.
I’ll stick to the pre-export workarounds then.

1 Like