Best way to optimize 3D objects saved as gltf

Hi all, I’d like to know what’s the best methods and procedures to optimize 3d objects for babylon (at the end I’ve to use oculus browser on quest2).

For now I’ve applied this optimization for every objects:

  1. decimate the geometry mesh with blender
  2. join all different mesh in one single mesh (but I’ve one draw call for every material used in the mesh)
  3. baked all the material in one only texture material (blender): now I’ve only one draw call for the object, but the render is not so good.

I’ve only four optimized objects in scene now, but the GPU of the Quest is running at 4 (maximum level), even if after optimization the FPS is between 70 and 90.

What do you thing about this?
How can i go farther with optimizations?
Thanks
Frank

1 Like

Big texture sizes are always hard to process.
Still, from your description it is not clear what it the main problem - geometry or textures.
Is it possible to share your model to have a look?
Also, you may try to optimize your model online here - https://glb.babylonpress.org/

2 Likes

You can use https://gltf-transform.dev/ for texture and geometry optimization.
The problem could also be a collision, if you have it.
I don’t know what is your scene looks like but this could also be helpful Babylon.js docs

1 Like

Hi all, thanks for the help! In this link: https://drive.google.com/file/d/1VVMW-13Bq1ifX0uzdzW-Fh44LeWrW-t0/view?usp=drive_link the blender file downloaded for free from cgtrader, before and after my optimizations. Please tell me if I’ve made the right optimizations and help me to optimize it more.
See you soon.

No access to the link, you need to make it shareable.

Ok, try now please.

Still cannot open the “after” file in Blender.
As for "before’ file, it is easier to find a similar (but better) house at Sketchfab, than to correct all strange things which were done there, like 4 365 740 faces in the model. Even 2 MB is too much for such a small house :slight_smile:
So, from my opinion there is no sense to waste the time trying to correct poorly done models, it is faster to find another ones which may be better.

Hi Iabris, “after” file in Blender is made with Blender 4. I understand your sugestion to using well made 3d art, but anyway, could you open my after file and give me your opinion?
I’ve decimate the meshes, I’ve join the meshes into one, I’ve baked the materials…
What else do you suggest?
Also here the final glTF file: casetta_piccola09.zip - Google Drive
Thanks

There are several options for textures.

  1. Resize to 1024 and convert to webp format. There are some artefacts on thin lines, though.

  2. No resize, convert to webp format. The file size is smaller, almost no artefacts

  3. No resize, convert to KTX UASTC format. The file size is slightly bigger, no artefacts, VRAM reduced to 16 Mb from 64 Mb.

As for geometry, you may try some optimizations as shown here, with quite good results.

I did all tests online here - https://glb.babylonpress.org/
For more settings and possibilities one may use GLTF-Transform CLI - Command-line quickstart | glTF Transform

1 Like

Thanks Iabris!
There is some good tutorial about GLTF-Transform CLI ?
And what about freeze meshes, not pickable, not interactable and other Babylon settings? I’m a bit confusing… What are the best parameters to use for optimize rendering mesh in Babylon for quest 2 VR?

As for GLTF-Transform CLI and other model optimizations - here is the very good guide: 3D-Formats-Guidelines/KTXArtistGuide.md at main · KhronosGroup/3D-Formats-Guidelines · GitHub

For the scene optimization - there is a lot of tricks which one may use. Most of them are collected here - Babylon.js docs
You may start with Performance Priority Modes and see what will happen :slight_smile:

1 Like

Thanks for all! I’ll give it a try!
See you soon

1 Like