react-three-fiber icon indicating copy to clipboard operation
react-three-fiber copied to clipboard

frameloop never missing tail callback

Open RenaudRohlinger opened this issue 3 years ago • 4 comments
trafficstars

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.

RenaudRohlinger avatar Jul 03 '22 04:07 RenaudRohlinger

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

codesandbox-ci[bot] avatar Jul 03 '22 04:07 codesandbox-ci[bot]

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?

drcmda avatar Jul 03 '22 05:07 drcmda

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?

CodyJasonBennett avatar Jul 14 '22 08:07 CodyJasonBennett

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.

drcmda avatar Jul 23 '22 07:07 drcmda

Continuing in #2481.

CodyJasonBennett avatar Sep 01 '22 11:09 CodyJasonBennett