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

On demand Rendering #140

Closed
Tracked by #490
Tinoooo opened this issue Mar 3, 2023 · 5 comments · Fixed by #490
Closed
Tracked by #490

On demand Rendering #140

Tinoooo opened this issue Mar 3, 2023 · 5 comments · Fixed by #490

Comments

@Tinoooo
Copy link
Contributor

Tinoooo commented Mar 3, 2023

Is your feature request related to a problem? Please describe.
In scenes that are not continuously changing, it could be a massive performance improvement to only trigger rendering when things change.

Describe the solution you'd like
This feature should be optional. A prop on TresCanvas to activate it would be handy. There could be some kind of callback that can be used to request a render (something like requestTick). This callback should be available in all child components of TresCanvas. It has to be called manually whenever changes are made that change the scene. This also means that internal entities (like OrbitControlsfor example) have to call it whenever they change.

Suggested solution
See above.

@hv-pul
Copy link

hv-pul commented Aug 9, 2023

Maybe I'm misunderstanding, but couldn't you just pause/resume the render loop to implement that?

@Tinoooo
Copy link
Contributor Author

Tinoooo commented Aug 10, 2023

Maybe I'm misunderstanding, but couldn't you just pause/resume the render loop to implement that?

I think that approach would not be sufficient. pausing the render loop manually means, you woul'd have to manually resume the rendering in a lot of situations. Just some examples: Resizing of the canvas, changes in the render props, changes on materials, camera position changes (OrbitControls for example).

@Sea-DH1
Copy link

Sea-DH1 commented Dec 8, 2023

Please tell me, is there any progress on this feature that can be discussed?

@Tinoooo
Copy link
Contributor Author

Tinoooo commented Dec 8, 2023

Unfortunately, there is no progress on this.

@alvarosabu alvarosabu added the v4 label Dec 13, 2023
@alvarosabu
Copy link
Member

@Tinoooo I was talking with le grish (thretle author) about it, they implementing a task scheduling for it. Some food for inspiration

https://threlte.xyz/docs/learn/basics/render-modes#mode-on-demand

@alvarosabu alvarosabu changed the title Conditional Rendering On demand Rendering Dec 13, 2023
This was referenced Jan 2, 2024
@alvarosabu alvarosabu mentioned this issue Feb 7, 2024
Closed
13 tasks
@alvarosabu alvarosabu linked a pull request Apr 24, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants