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
Support manual render mode / advancing the render loop by 1 tick #624
Comments
@verekia I think we should rephrase this ticket to |
+1 on this! Have the control over how / when to render and render-priority is deffo something REALLY useful, with r3f you can can do useFrame(() => {}, proprity) that is super helpful, you can use the priority = 0 to override the internal render loop, you can use negative values and positives too. This is very helpful when you want some stuff happens after others :) EDIT: |
+1 I also like R3F's approach. It's simple and flexible and lets users roll their own loop order. RelatedObstaclesIt seems to me that what's holding the current codebase back is the simple, practical current implementation of
Users seem to like that. Me too. But the current implementation isn't linked to any particular
It'd be really handy if we could both:
So ... 👇 Feedback pleaseHere's a proposal for creating an unbound context in Feedback on this proposal is very appreciated. Other proposals are also welcome. StatusHowever, for me anyway, big changes like in the discussion I linked to are on hold until after |
@alvarosabu It seems like the upcoming This ticket was not about making an equivalent of R3F's Feel free to rename the ticket as you please or make a new one about allow overriding the |
Hey there! As @andretchen0 perfectly explained, we need to work on having the render loop tied to the specific canvas and not global, which would be a significant change that would open a world of possibilities to users. This together with Andre's proposal of unbound context and plugins is on top of my list for next @andretchen0 do you think we could do it without a breaking change or it would be better to delay the release and add this to v4? |
Hey @alvarosabu
I responded over here. |
Description
Supporting a manual render mode allows developers to manage their rendering loop externally with more control. It is useful for games to use a single rAF loop and have all their systems executed in a predictable order. For example their main loop can execute:
advance()
call here in their loop.Suggested solution
The feature should add an option to
TresCanvas
to render "manually" or to "never" loop, and then offer a function to call to advance the rendering by 1 tick.Additional context
R3F's implementation (
<Canvas frameloop="never">
+advance()
): https://github.com/pmndrs/react-three-fiber/blob/fac9424a12e6068f1c8e1062240d2a3373cd2e23/packages/fiber/src/core/loop.ts#L166Threlte uses
<Canvas renderMode="manual">
+advance()
.Some old Threlte commit that implemented the feature: threlte/threlte@272d17c
Validations
The text was updated successfully, but these errors were encountered: