I’m encountering optimization problems after exporting a scene from Unity (as FBX) and converting it to GLB using Blender. Upon importing the scene, I noticed over 300 draw calls and my CPU usage stays around 90%. The scene consists of 58 regular meshes, with the rest being InstancedMeshes, according to the Babylon.js Inspector. Despite this, I can’t seem to reduce the draw calls to 58.
Is there anything specific I should check with InstancedMeshes to lower draw calls?
I also tried merging meshes that share the same material, which brought the draw calls down to about 30. However, this caused performance to worsen, both in terms of FPS and CPU usage, compared to the original scene.
I believe there was some problem during conversion or export. The solution is to process the file with GPU Instancing.
So, I upload the GLB to https://glb.babylonpress.org/, checked GPU Instancing box, then saved optimized file. That’s all
The problem with your file is that almost all instances have a different matrix determinant than their source. This is a problem because it force babylon to change the winding order as the faces are going in the opposite direction so instancing cannot happen.
this happen when using negative scaling for the instance compared to the source (like source.scaling = 1,1,1 but instance is 1,-1,1
I see, thank you! I did not know anything about this winding order. Also that’d be great if we could add this information to the IntancedMesh docs in babylonjs site.