vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
482 stars 77 forks source link

Validation causes very long loading times and `Validation = Skip` does not help #245

Closed BoyBaykiller closed 3 months ago

BoyBaykiller commented 3 months ago

I was trying to load a converted glTF model from the newly released CoD Caldera data set.

It takes SharpGLTF 55 seconds to load the file with Validation = Skip. Turns out of all the time is spent in this validation step (the model has 152.563 nodes): https://github.com/vpenades/SharpGLTF/blob/c71bf2c536348569772dc469f81bf07cd23b865c/src/SharpGLTF.Core/Schema2/gltf.Scene.cs#L93-L97

After commenting it, loading time went down to 1500ms! I decided to also disable validation here and that brought it down to 1050ms.

I'd be nice if Validation = Skip does not perform costly validation, or perhaps no Validation at all.

vpenades commented 3 months ago

I'll look into it.

Btw, what tool are you using to convert from USD to glTF ?

deccer commented 3 months ago

We used Blender's USD Import and GLTF Export. Be aware exporting might take "ages"

source usd is this one caldera/map_source/prefabs/br/wz_vg/mp_wz_island/map_airfield/airfield_grounds.usd