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

No-jitter models loading #63

Closed
sdumetz opened this issue Jun 21, 2024 · 4 comments
Closed

No-jitter models loading #63

sdumetz opened this issue Jun 21, 2024 · 4 comments

Comments

@sdumetz
Copy link
Member

sdumetz commented Jun 21, 2024

Reducing renderer jitter on model loading would enable loading smaller models seamlessly in a (yet to be developped) dynamic LOD system.

Using WebGLRenderer.compileAsync() from THREE r161 (#27098 seems to reduce the initial blocking time by half for a given model, without much effect on other metrics.

Additionally, WebGLRenderer.initTexture() does drastically reduce upload freeze for models with large textures and low (ish) vertex count, especially if it is able to load textures through multiple frames.

@sdumetz sdumetz added this to eCorpus Jun 21, 2024
@github-project-automation github-project-automation bot moved this to Triage in eCorpus Jun 21, 2024
@sdumetz sdumetz moved this from Triage to features in eCorpus Jun 21, 2024
@sdumetz
Copy link
Member Author

sdumetz commented Jun 21, 2024

Detailed test results. Tests were made with dev build in standalone mode, mean of 3 runs. Looking for the sum of [Violation] 'requestAnimationFrame' handler took <x>ms reported during object loading. Results should be considered accurate within ~10% of their value.

Model / Test Delay (mean)
10M Vert. 5*2k tex.
- initial 1380ms
- compileAsync 814ms
- initTexture 796ms
- compile+init 804ms
25k Vert. 1*8k tex.
- initial 675ms
- compileAsync 480ms
- initTexture 74ms
- compile+init <50ms

Both model were purposefully chosen quite large to better show the performance bottlenecks. We see that it's possible to largely speed up texture loading but large geometries will stay a problem unless we find some additional optimizations.

The geometry limit is not that much of a problem because keeping the vertex count below the 1M (arbitrary) limit is easy enough in most cases.

@sdumetz
Copy link
Member Author

sdumetz commented Jun 21, 2024

Running the previous tweaks on large multi-model scene, we go from there :

Image

To there

Image

Which is better but shows how an unoptimized model is unlikely to load seamlessly.

Ensuring a serialization on renderer.initTexture() seems to help a bit : It makes intuitive sense as models loading in parallel might otherwise try to init their textures during the same animationFrame. load time improvements were however not clear enough to be sure about this.

Compressing the scene's larger models into 2k maps (from 30MB total size to 15MB) still yields some delayed frames which tends to indicate some other source of contention to uncover.

Some of this contention seems to come from the environment map being loaded more than once.

@sdumetz
Copy link
Member Author

sdumetz commented Jun 28, 2024

@sdumetz
Copy link
Member Author

sdumetz commented Jan 8, 2025

@sdumetz sdumetz closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: features
Development

No branches or pull requests

1 participant