atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.21k stars 241 forks source link

How to get triangles and materials count before load? #403

Open orangeagain opened 2 years ago

orangeagain commented 2 years ago

Describe the solution you'd like Wanna get triangles and materials count in glb file before real load, because we want to determine the impact on performance to decide whether to continue loading. Did glb file record those information? Did this function alreadly in code?

atteneder commented 2 years ago

Hi,

Thanks for reaching out. This does not exist yet but it should. I'd say this is related to or a duplicate of #147, which is about calculating the overall memory usage beforehand.

Unfortunately I cannot give a timeline. Help is welcome, obviously.

Thanks

yosun commented 1 month ago

any update

atteneder commented 2 weeks ago

Not really, sorry.

Typing out the method that calculates the triangle count is not that complicated.

What's a bit more complicated is to separate the JSON parsing stage from the rest of the loading process. You'd need that separation though in order to get said data before actual resources are allocated.

yosun commented 2 weeks ago

it helps to understand if the mesh the user wants to load might not be feasible given triangle count or memory requirements - instead of simply crashing.