Background
Name is defined in GLTF spec as Any top-level glTF object MAY have a name string property for this purpose. These property values are not guaranteed to be unique as they are intended to contain values created when the asset was authored.
In some exported GLTF files, name can exist in both textures
and images
like:
"textures": [
{
"name": "MyTextureName",
"sampler": 0,
"source": 0
}
],
"images": [
{
"name": "MyImageName",
"uri": "data:image/png;base64,..."
}
],
When using Babylon.js internal GLTFLoader, the name of loaded texture is set like this:
And name of GLTF’s texture or image is lost.
Playground Example
The file is silghtly modified from BoxTextured.gltf from glTF-Sample-Models.
Proposal
Add an option, statically or instance-bound, to make GLTFLoader prefer to use original texture or image name as name of loaded texture whenever possible, which could has false by default to keep backwards compatibility with existing code.