react-three-fiber
react-three-fiber copied to clipboard
frameloop never missing tail callback
In a frameloop='never' configuration the tail callback is missing post-render.
Since the render is getting stopped after calling advance() I believe this callback should be called in order to be consistent with the two other modes always and demand.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit fa0ee91eb5a8bee0096080cf7adfbf3f11fcd6d8:
| Sandbox | Source |
|---|---|
| example | Configuration |
im not sure, tail usually indicates end of a series of frames. if im not mistaken it isn't called in frameloop=always because there's no "end". imo if frames are called manually via advance, tail should probably also be called manually?
We should expose a way to flush effects here, but advance is only concerned with a single frame.
invalidate should otherwise handle this if I'm not mistaken. Are you calling this in a loop?
IMO invalidate is also no indication for tail. Tail is when rendering is demand and you rotate controls, once it stops calling invalidate tail is called. Invalidate basically just counts a ticker up, even if the ticker was 0 it’s no Guarantee that another invalidate will count it up in the same frame. that ticker is decreased in the render function, which is called after all invalidates, if it reaches 0: tail. Tail can’t be reached when rendering is always. Again, I think tail must just be callable manually, that should do.
Continuing in #2481.