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

feat: VRMUtils.precompileShaders #1554

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

feat: VRMUtils.precompileShaders #1554

wants to merge 3 commits into from

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Dec 10, 2024

This PR introduces VRMUtils.precompileShaders.

precompileShaders is a function to time slice the shader compilations to prevent the main thread from being blocked.

This function only supports WebGLRenderer at the moment.

Points need review

  • Is it nice to have in three-vrm?
    • We have a lot of stuff inside VRMUtils lately,,,
  • Is the signature name appropriate?
    • Related APIs: WebGLRenderer.compile(), WebGLRenderer.compileAsync(), WebGLRenderer.initTexture()
    • Candidates: precompileShaders, compileShaders, compileShadersAsync, precompile, compile, timeslicedCompile, timeslicedCompileAsync, prepareMaterials, prepareMaterialsAsync, ...
      • It seems this is the first time we expose functions or methods that return Promise other than loader plugins.

`precompileShaders` is a function to time slice the shader compilations to prevent the main thread from being blocked

This function only supports WebGLRenderer at the moment
@0b5vr 0b5vr added the performance Performance issue label Dec 10, 2024
improve time slicing efficiency by using `renderer.compileAsync`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant