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

Writing gltf file (ModelRoot.Save) is slower after updating to version 17 from version 15 #53

Closed
AhmedMakhlouf opened this issue Jun 18, 2020 · 6 comments

Comments

@AhmedMakhlouf
Copy link

Saving a specific gltf file (55MB) takes 2.3 mins using version 15, writing the same file in version 17 took 5 mins (with or without WriteSettings.Validation)

@vpenades
Copy link
Owner

hmmm.... 55mb is quite a lot.... could it be possible to share the model? or send it to me privately?

@AhmedMakhlouf
Copy link
Author

I can share it with you privately

@vpenades
Copy link
Owner

I can reproduce the issue, and I've found the problem happened between version 15 and 16... I'll continue investigating...

@vpenades
Copy link
Owner

vpenades commented Jun 18, 2020

Okey, this is what I found so far:

  • The current development branch (master) has the SkipValidation fixed, so, if you're in a hurry, you could clone the repository and compile it, at least until I release a new version of the library (in one or two weeks)
  • The increased load/save time seems to be due to some more strict hierarchy validation checks. Given that there's 40.000 nodes in the scene (wow!), it makes sense it takes a while to traverse the whole tree.

I'll see if I can add some optimizations to the validation code... but I guess you want to load/save fast, which can be solved with the SkipValidation in the next version.

BTW, the model is very slow to render, checking the contents I've noticed it uses thousands of materials, and many of the share the exact same properties (color and metallic).... you could improve the rendering performance by reusing the same materials on multiple meshes.

I don't know how you're building your model, but, if you're using SceneBuilder's toolkit, you can let the library find shared materials by NOT setting the MaterialBuilder's names. If you leave the material names to null, the library will be able to find matching materials and reuse them.

@AhmedMakhlouf
Copy link
Author

AhmedMakhlouf commented Jun 21, 2020 via email

@vpenades
Copy link
Owner

vpenades commented Jun 22, 2020

Version 18 is up.

In my tests, the load/save operations with your file are down to 1 minute.

Without validation, just a few seconds.

Let me know if you have any other problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants