Open kfarr opened 1 year ago
I've noticed that objects combined into one glb (like dividers.glb) can use the same material map (in case of dividers.glb it's a atlas_colors_diffuse.jpg). And if we save each object as separate glb, then this map is saved in each .glb. i.e. the size of each .glb file increases. So far I have found this option: using the CesiumGS tool gltf-pipeline (https://github.com/CesiumGS/gltf-pipeline), we can save objects in .gltf (or .glb), while saving only the texture map separately, without bin files. Then the structure will be like this:
barricade.gltf (.glb)
bollard.gltf (.glb)
flowers.gltf (.glb)
...
atlas_colors_diffuse.jpg
each object from dividers.glb (barricade, bollard, flowers, ...) is stored in a separate file (with bin data inside) and one common .jpg file with material map is used. I checked with test 3DStreet scene, it works but judging by the network tab in the browser, it loads the texture map for gltf every time for each model and even several times for some reason for each model. But this is not a problem if the browser caches the file. I can ask on the three.js forum about the practice of using the one material map separately for several different gltf/glb files. But I think that this is normal, for this the gltf format has such an opportunity. I have studied this format before
Hi @Algorush thank you for this writeup. Let's pause this ticket of separating objects for now as it is a lot of labor overhead for small benefit.
objects like dividers.glb https://github.com/3DStreet/3dstreet-assets-dist/blob/main/objects/dividers.glb
are 1 glb with many files within that need to be extracted https://github.com/3DStreet/3dstreet/blob/main/src/assets.js#L196
this causes problems it uses a custom component to load the parts sometimes parts with multiple materials have problems other 3d viewers like modelviewer don't support this and can't properly display individual models any perceived benefit from download time or file size saving is offset by the time to deal with combined models
instead each model should be its own file (glb compressed draco)