-
Notifications
You must be signed in to change notification settings - Fork 30
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
[animation-frame-rate] Synchronising multiple low framerate animations #84
Comments
Web Animations 2 introduces the notion of group effects. This would allow a single animation to group multiple effects, and thus the This does not negate the usefulness of setting the frame rate on an entire timeline. This could be an interesting idea in a world where multiple timelines are allowed, which is a new feature that would need to be added. We'd need to define how frame rates set on animations relate to the potential frame rate on a timeline. My hunch is that setting the frame rate on an entire timeline does not offer sufficient granularity since a single timeline may be shared by multiple animations managed by different components with no knowledge of each other's logic. Allowing multiple effects in groups tied to a single animation with a given frame rate seems more contained. |
My preference would be to allow for the UA to synchronize low framerate animations by default. That would be a big power win. It would mean some unpredictability around when the first callback happens after starting an animation. |
@smfr could work, but I worry it's one of those heuristic things that doesn't work in practice. What's the cut-off for "low" here? Feels like it should be specific. |
I think there are two topics being discussed here. The first topic is the notion of an animation being comprised of multiple sub-animations. As of this writing, the proposed solution for this is to use group effects as introduced by Web Animations Level 2. If an animation is indeed acting as the player for multiple effects, a single The second topic is about multiple Our intention in terms of implementation is to update all animation for a given timeline with the same frame rate in the same page rendering update. Going further, our intention is to also ensure that animations with differing frame rates that could land in synchronized updates must land in synchronized updates. Consider setting some animations to update at While this probably seems obvious, it remains to be seen what is the best thing to do for newly-started animations, as @smfr points out. Consider that you have existing
I will propose an edit to this document that addresses the topic of synchronizing updates for animations based on their |
Slightly tangential to this, we have occasionally seen a need to run animations that don't drop frames, but hang instead of jumping. I believe this was most clearly explained in a blog about various Xbox animations:
In the past we've considered addressing this with a different type of timeline whose current time increments can be capped. If we have group effects, however, I suppose that extension point could be either the timeline or the animation. |
I think my preference would be to set the frame rate on the timeline. This way, it is obvious to the developer that multiple animations running on the same timeline will align with each other as the timeline ticks at the lower rate. Also, by setting the framerate on the default document timeline you could implicitly opt your entire page into a different tick rate. |
I came to the same conclusion in my comment on w3c/csswg-drafts#7196 (comment) |
Same conclusion here whatwg/html#5025 (comment) |
Although, there's the case where you have a 60fps animation, and a 30fps animation, and you want them to be in sync. As in, the 30fps anim's frames are shown at the same time as every other 60fps animation frame. |
The above could be solved by allowing a timeline to have a parent timeline, which defaults to the document timeline. That way, you could create a 15fps timeline which has a parent 30fps timeline. Then, every other frame on the 30fps timeline would be in sync with the 15fps timeline. |
https://github.com/WebKit/explainers/tree/main/animation-frame-rate
The proposal suggests the animation has a frame rate, but I'm not sure that's the right place for this to be defined (but maybe it could become a shorthand).
A non-basic 'animation' is created using multiple
Animation
s, and if each of these are 10fps for stylistic reasons, it feels likely that you could end up with multiple animations running at 10fps but out of sync with each other, so the overall effect seems wrong.I'm not sure what the alternative is. Maybe some way to place a new framerate-limited timeline on the document timeline, then allow animations to exist be on that new timeline. All animations on that timeline would have the same framerate and tick at the same time.
The text was updated successfully, but these errors were encountered: