Skip to content

Cat Rain use Web Animation API instead of rAF loop#14

Open
Martin-Pitt wants to merge 2 commits intoVedalAI:mainfrom
Martin-Pitt:main
Open

Cat Rain use Web Animation API instead of rAF loop#14
Martin-Pitt wants to merge 2 commits intoVedalAI:mainfrom
Martin-Pitt:main

Conversation

@Martin-Pitt
Copy link

Uses the Web Animation API for cat rain instead. (Element.animate)

rAF loops run at 120Hz on, well, 120Hz displays, so the cats end up falling and spinning twice as fast.

Now imagine how that feels like on a 240Hz display.

You can fix that by using delta time in the rAF animation loops but there is the Web Animation API which also animates it off the main thread and other good stuff.

Use the Web Animation API for cat rain instead

rAF loops run at 120Hz on, well, 120Hz displays, so the cats end up falling and spinning twice as fast. Now imagine how that felt like on a 240Hz display.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant