frameloop/frame invalidation in <View />
#950
kmannislands
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be really nice if support for
frameloop="demand"
andframeloop="never"
withinvalidate
was extended to the<View />
component.Here's an example where I've vendored in
VIew
(and converted to js) to add a console.debug inuseFrame
demonstrating that all 4 views in the example are rendered when ideally, only one of them needs to be rendered. I've removed the "camera shake" effect on one scene since that seems to require a consistent frameloop to work and would cause too much logging.For example, interacting with the transform controls or orbit controls in the wire frame scene has no impact on the other views (no attribute of any object is updated). Therefore, a more efficient approach would track the frames for each
View
or "virtual scene" separately and only triggeruseFrame
on the impacted scene.At present, all
View
s share the same value forframeloop
context as well so it isn't possible to have one scene running continuously while rendering frames on-demand in the other scenes. Supporting differing frameloops would mean that "camera shake" in this example could be enabled.I suspect that this can't be done in "user land" (ie, Drei) and would require modification of the "state enclave" design around
createPortal
in@react-three/fiber
itself but I haven't looked in to it extensively yet.Opening this largely to gain insight on what it would take to implement and see if anyone else is interested in the feature
Beta Was this translation helpful? Give feedback.
All reactions