When you have model with several repetitive object like windows, blocks and rails, GLTF not optimize it anyway. And you can get 100mb+ model as output. We need a loader for .b3dm, .i3dm specifications or some array optimizer.
The problem is not the format here, glTF (along with other non-CAD-specific formats) supports reusing objects throughout a scene and — if created efficiently — will not duplicate that data. Whether your file has been created efficiently or not I can’t say, as you haven’t shared details to examine further.
But if you load a file with thousands of objects, in any format, that means thousands of draw calls and your performance will be bad. This requires optimizations like merging the objects, which again is independent of the format you are using.
So we can compress such data, receive it on a client, merge all details (decompress), and draw in one gpu call. Because often bottleneck in channel bandwidth and not in clients gpu.
I’m happy to help you optimize a model, given enough details (e.g. an example model) to do so.
I cannot help you create a new loader for the formats above, though, and I would point out that .b3dm
uses glTF internally to efficiently store model data.
Thanks for your help as I understand you are contributor. Also thanks for your great gltf-viewer I am use it as a validator for everyday work. I created this topic for several reasons
- wanted to raise the issue about b3dm/i3dm loader in Three.js community
- actually was intrested about my results with compressing CAD models
I am used different techniques and actually quite happy at least with meshes
- at first I add decimate modifier with angles, because in CAD models we have a lot of flat surfaces
- export with mesh draco compressor
After that my 90mb fbx model compressed to 15.7mb, but when I merged I get incredibly small result in 3.0 mb. After that I started to think that optimizing appears only inside objects but not in all scene. Am I right?
Maybe I am just not familiar with blender and don’t know how to merge meshes with different textures.
Here little bit similar topic about textures but with much worse result, at least for me. Seems like I am not get how to use GLTF properly.
If you have lots of meshes in the scene, Draco compression will be less effective than if you have one big mesh. So getting a smaller file after merging them sounds normal to me. Or is something wrong with the result?
After that I started to think that optimizing appears only inside objects but not in all scene. Am I right?
I don’t understand this part, could you explain more? Draco optimizes each mesh independently, if that’s what you mean. Draco does not affect animation or texture data.
I think what you want is to create a texture atlas here, but I don’t know enough about it to write a good tutorial. It would be cool if someone in the threejs/Blender community knows more!
No, results with mesh compression is good at least for one mesh.
Draco optimizes each mesh independently
But one big mesh smaller in 5 times. 15mb vs 3mb, in this test I used CAD model without textures.
Actually quite big difference, I wonder why draco thinks that we don’t have similar parts in different meshes in one gltf scene. Probably it is not possible by algorithm, but we always can imagine that one scene is one big mesh, that can be decompressed in lot of meshes. I need to create an issue in gltf/draco repo.
I think what you want is to create a texture atlas here
Yes, be able to create texture atlas it good skill, I need to learn it, because GLTF forcing us to do it right now. It’s too easy to shoot in knee with gltf shotgun.
Yes, be able to create texture atlas it good skill, I need to learn it, because GLTF forcing us to do it right now.
This is pretty universal — meshes with different materials can only be merged if their materials can be merged, and that means texture atlases. I do wish there were more, and easier, tools for creating them.
Some work on 3d-tiles / i3dm / b3dm is going here: https://github.com/NASA-AMMOS/3DTilesRendererJS
If you interested you can support it with like and reviews.
Some work on 3d-tiles / i3dm / b3dm is going here: GitHub - NASA-AMMOS/3DTilesRendererJS: Renderer for 3D Tiles in Javascript using three.js
If you interested you can support it with like and reviews.
Heh, that’s from me It’s still in progress but we’ve open sourced the work so far and I’ll be continuing development with the features we need for visualizing our processed terrain output as we lead up to our upcoming mission.
Feedback and more example data is definitely appreciated! Feel free to contribute, too. I’d like it to be able to be generally usable for displaying any 3d tiles data eventually. A Unity implementation from my peer is available here, as well: GitHub - NASA-AMMOS/Unity3DTiles: A 3D Tiles implementation in Unity