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

Rendering loop in web worker #833

Open
4 tasks done
AntoninRousset opened this issue Sep 16, 2024 · 0 comments
Open
4 tasks done

Rendering loop in web worker #833

AntoninRousset opened this issue Sep 16, 2024 · 0 comments

Comments

@AntoninRousset
Copy link

Description

First of all, thank you for your work! Tresjs has really helped us keeping a composable and declarative structure for our 3D scenes, with a seamless integration with Vue.

As our app grew, we have noticed that the rendering loop is using a significant part of the resources on low-end platforms. This was honestly not much of an issue before we started using web workers to offload some computationally intensive tasks. We noticed that the browser is highly prioritizing the main thread over the web workers, making them virtually useless when the main loop is too demanding.

Suggested solution

We would like to have the rendering loop and all the Tree artillery in a dedicated web worker with the help of an offscreen canvas.

Note that this would imply some asynchronous messaging system between the DOM thread and the worker using postMessage.

Alternative

Limiting the FPS is a workaround, but it does not really solve the problem because it won't adapt to the available computational power.

Additional context

No response

Validations

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

1 participant