How to oprimize requestAnimationFrame ? FPS

I use requestAnimationFrame and have some animation on three.js.

I want to optimize my animation so that it is available even on slower devices.
What are the optimization methods? And what FPS value is optimal?

@sts_1994 here are general performance suggestions: How to optimize objects in three.js? Methods of optimization

60 FPS is generally the goal, but if the scene does not change constantly it may be lower, or in WebVR uses you may want >90 FPS.

my animation will work faster if I have 30 FPS?

Your framerate will be exactly half as fast at 30 FPS as at 60 FPS :wink:

If you are using requestAnimationFrame, then you cannot control the framerate. The browser chooses this automatically to be as fast as the device can smoothly render, and there’s little point in changing that unless you have other things on the page that you want to reserve more computation time for. Typically you should not be deciding what framerate to use, instead you should find out why your animation takes a long time per frame and make sure each frame runs as fast as possible.

2 Likes