Hey Everyone,
I have multiple glb file about 120 in counts. Right now after compression my all files are about 200 mbs and taking 18 sec to load. I want to reduce the load time to about 5 to 8 sec max. I was thinking if we can remove materials from glb, load woth geometries only and download material separately one time and reusing them. Is it possible to reuse materials? Because in each house most of the glb have same materials. Any help would be worthy…
You can export the model without material
So while exporting to glb (blender) in data menue you can select material and export to none.
If you have limited material you can then map to the object by iteratimg them
One rough idea which comes to my mind is to add some type of code/number/uniquename to front of mesh to define what material to apply on it and then in js you can iterates through the scenes child and condition the name (substring of the name like first 4 char which define the type of material) and then map it with the material of your choice (meshStandard material for example with some specifi value)
Thanks for replying. I’m wondering will it brings my gpu usage and texture count as we are reusing materials?
Yaa but 120 model and then each model with different part and then renaming all looks a lot of time consuming task to me.
I guess there should be a better way to reuse the texture for sure
There is one more way
You can use uv unwrapping and baking techniq
So you can bake the texture on a big image of multiple objects but then again although its efficient but then you loose on properties of real time light calculations like mesh standard material
If you have 200 megabyte models, I doubt the materials themselves are contributing much to the overall size. it’s more the textures, and geometry that take the bulk of the space.
200 megs after compression still sounds impracticly large. What are you using for compression?
I am using gltf transform cli. Command I’m using gltf-transform optimize input.glb output.glb --compress meshopt --texture-compress webp --texture-size 1024 --weld false
These models were quite large actually a single model was about 33 to 40 mbs now each one is about 1.3- 1.6 mbs
From [33-40] to [1.3-1.6] mb, seems perfect for a 3D model, maybe it can get better with some Darco compression?
Compression isn’t the only way to reduce/optimize the loading time when it comes to web assets.
A Progressive loading strategy, do you need all the 120 models at once, should they be all visible at first render, loading only the models that are needed at time, can reduce the first loading (or at least the feeling of it).
An LOD approach, create a low-res version of your models (The once at the background, less important or far from the camera), then progressively load the full res version of each one.
Points of similarities, if your models share the same objects (textures, geometry, material…), you can put all shared objects in one model, set placeholders on the original models, then replace them once loaded.
Thanks fro your response, I also tried to use draco but it wasn’t helpful because of Draco’s compression i have distorted textures. Client is not interested in implementation of LOD so i have to stick when high res models. Other than that for help here is an image of current canvas
Here much of my houses have same textures over materials. I was wondering to load materials separately and then applying on these models
I may be mistaken, but the way I see it, you can export the hole scene as a single glb file, with many reused textures and geometries, the exporter will do a lot of optimization along with the gltf-transform and meshopt, you can also merge all the white houses into a single geometry since they share the same material.
I think this can be dropped to an ideal two digits glb size.
The surroundings and ground are single glb file while each house is an independent glb file