Texture Merging when importing GTLF

I am wading through some optimization questions and had one I did not see documentation on.

Is there a built in way to, when importing multiple GTLF (or other formats) to prevent babylon from creating new, unique materials for each model that shares a texture, but instead instances existing materials and textures? So, different files, have the same texture / material (including names) so why not use the same material just instanced to optimize?

If no built in way exists, is there a way to override default mesh import to scan incoming models during loading and instance materials?

Beyond my naming convention is a mess, this shows what I mean, all those “no name” are the same texture… all the “Material #22”… ext… The same goes for my texture maps.

We cannot assume such optimization because you may want to control various materials later on (like changing a part color).
If an optimization has to append, it must be done either inside the DCC tools or afterwards by the developer.

Knowing your constraints, you can browse your meshes, get the common material and apply it to the right meshes

1 Like