Is there a proper way of limiting the framerate? I was thinking of writing my own solid implementation on top of engine.runRenderLoop then submitting a pull request to the official repo. The API may look like this:
let engine = new BABYLON.Engine(canvas);
let scene = new BABYLON.Scene(engine);
let maxFramerate = 24;
engine.runRenderLoop(() => scene.render(), maxFramerate);
engine.setMaxFramerate(60);
engine.getMaxFramerate();
@labris I find the SceneOptimizer does not kick in very often when set at 30 FPS, 1000ms check rate. Even when users on lower end machines are getting slide-show experiences sometimes. Do you have any tips for what I could be doing wrong with it ?
I will give that a shot ! Edit: Wow 250ms is working way more reliably, thank you for helping me in your own thread
As far as I know SceneOptimizer will try to make desired FPS but it doesn’t mean that every user will get it, especially at lower end.
That would be magical indeed if it could just fix anyone It’s 50/50 on laggy systems wether the first/subsequent optimizations gets applied. I went about setting it up the way the docs outline with custom functions for different priority levels, including some logging in there as well.