tres icon indicating copy to clipboard operation
tres copied to clipboard

On demand Rendering

Open Tinoooo opened this issue 2 years ago • 5 comments

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.

Tinoooo avatar Mar 03 '23 11:03 Tinoooo

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

hv-pul avatar Aug 09 '23 11:08 hv-pul

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).

Tinoooo avatar Aug 10 '23 08:08 Tinoooo

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

Sea-DH1 avatar Dec 08 '23 06:12 Sea-DH1

Unfortunately, there is no progress on this.

Tinoooo avatar Dec 08 '23 08:12 Tinoooo

@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 avatar Dec 13 '23 08:12 alvarosabu