Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate objects, no longer combine them #44

Open
kfarr opened this issue Mar 1, 2023 · 2 comments
Open

separate objects, no longer combine them #44

kfarr opened this issue Mar 1, 2023 · 2 comments

Comments

@kfarr
Copy link
Collaborator

kfarr commented Mar 1, 2023

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)

@Algorush
Copy link
Collaborator

Algorush commented Mar 15, 2023

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

@kfarr
Copy link
Collaborator Author

kfarr commented Mar 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog (Not Ready)
Development

No branches or pull requests

2 participants