Using GLB instances results in a draw call for each instance, but Babylon exporter doesn't include texture

I have a scene in which I have about 80 instances of a 3D model that I made in Blender. Somehow, when I export this to .glb format, it uses an extra draw call for each instance, but when I export to .babylon format and use that file, it uses only one draw call, but no texture is used.

What could be the reason for this?
The .babylon file uses only 1 draw call and I really would like to use the .babylon format, but of course I need textures.

I must be doing something wrong when using the exporter? I clicked on ‘inline’ in the Textures/Materials option in the Babylon.js section in World Properties in Blender 3.3.1. Somehow the texture just doesn’t get added to the .babylon file. (606.1 KB)

I added the models in a zip file.

Somehow I’ve got it working now. I think it had something to do with removing the ‘Principled BSDF’ node in the shader editor in Blender. I followed an example on YouTube that said this wasn’t needed. When I leave this node as it is and adding an image texture to it , exporting to .babylon works fine now.

However I still wonder why using the same model , but as a .glb file (exported from Blender as well) results in so much more draw calls, while instancing the mesh.

You have to remove the parent of the Fence1 mesh:

Principled BSDF is supported in .glb.

I see. I think it’s very confusing that a different format export from Blender has such a different structure, but that’s not Babylon’s fault, I guess.
Can you tell why the setting of parent to null not necessary with the .babylon format?

I removed that Principle BSDF node and added the image texture directly, which caused the Babylon exporter to not include the texture. I’m just learning Blender, so I have no idea what I’m doing :slight_smile:

On the contrary, I think that that’s the point of different file formats :slight_smile:

The glb (or gtltf2) exporter in blender always adds an empty parent __root__ mesh to your scene. (red)
The babylon exporter does not. (purple)

Try it out yourself:

Every exporter has it’s rules and you can’t use any Shading tree node in Blender to create the material or on the other side the exporter requires you to use a specific Shader node to correctly export to the given format. Basically the Pricipled BSDF shader in Blender is the equivalent of the PBRMaterial in babylon.js.

Here are the docs for the glb exporter: