That’s because you are loading the right handed GLTF scene into a left handed Babylon scene, so Babylon has to modify “something somewhere” (I think it’s a -1 somewhere in a matrix) leading to not being able to batch all the draw calls.
Add scene.useRightHandedSystem = true; just after scene creation, and you will see a single draw call.
I did instancing in OpenGL. how the different coordinate system can affect the batching process?
also, I am having the same problem. I wrote half of the game already and if I change the coordinateSystem, it will ruin the whole game. is there a way I can solve this problem without changing the coordinate system?
That’s because the side orientation of the master mesh is different from the side orientation of the children (instances), so Babylon can’t batch all the drawing in a single display.
What you can do is setting the parent of the instances to be the same parent than the master mesh: it is the parent of the master mesh that has a “-1” in the scaling matrix that leads to side orientation inversion. So, setting the same parent for the instances will make the master + instances share the same side orientation and thus a single draw call can be issued:
When lowerDrawCalls is true, you get 3 draw calls and when it is false you get 9 (the fan is made of 3 meshes).
Thanks for the explanation.
That makes sense. my instancing is working with the suggested solution but I also wanted to have different renderingGroupID for different instances. I realized I have to change the master mesh renderingGroupId to make it work. That’s not what I m looking for.
VertexBuffer doesn’t have a support for creating renderingGroupId which makes sense. How can I have different renderingGroupId working for different instances? Thank you for the support so far.
Rendering order is decided at CPU side and all batches needs to be single draw call. you cannot do much here. But I am employing the same solution you suggested. thanks a lot. B-)