Ok, so I’ve launched chrome with --disable-gpu-vsync --disable-frame-rate-limit and now with maxFPS 60 - I am getting 53-54 fps, seems like there is something else also
If I disable maxFPS setting - I am getting thousands of FPS now.
I understand that RAF inflict, but problem here - is that even 54FPS with disabling VSYNC in Browser - its not close to 60 and I have not understanding why rendering much slower than 60 fps, because we know that by default engine uses RAF and can render 144 fps without problems.
if you have vsync on 144fps, my guess is you’ll get stuck at one of these fps values,
since you can only have frame times in the multiple of 7ms
if you remove vsync and get above 1000 fps and then set maxFps to 60, you should be getting above 56fps no clue why you get less : O
I also get 48 FPS when engine.maxFPS = 60;
@Deltakosh I read the source code and asked the chatgpt about it, could it be the reason?
...
// Notice the +1 here
this._minFrameTime = 1000 / (value + 1);
}
Because of the (value + 1) in 1000 / (value + 1), if you set engine.maxFPS = 60, Babylon actually uses 1000 / 61 ≈ 16.39 ms as the minimum frame time. Combined with normal runtime overhead (and possibly browser vsync intervals), the real measured framerate can dip down near 48–50 fps in practice.
Maybe some lower number like: (value + 0.1)?
Can you try to set max fps to something like 65 / 70 / 80 ? If the limitation is because of vsync, it should not change anything. Also, did you try in different broswers?
Note that getting 48fps in 144Hz while you get 60fps in 60Hz is possible if vsync is enabled. For eg, if a frame takes 16ms, you will be at 60fps in 60Hz and at 48fps in 144Hz. That’s because 16ms means max 1000/16=62.5fps. As you can can only get 144fps / 72fp / 48fps / … in 144Hz when vsync is enabled, you will get 48fps.
Just to make sure that the frame rate is correct, can you activate it in Chrome? To do this, open a dev tools console, press ctrl+shift+P (on Windows), type “fps” and select “Show frames per second”:
@Evgeni_Popov Sorry just saw your message, I did not get notification for some reason. I tried on Firefox still the same. But I created a PR that fixes this problem, I’ve seen this approach on noa voxel engine before: Implement accumulator pattern for precise frame rate limiting by ertugrulcetin · Pull Request #16484 · BabylonJS/Babylon.js · GitHub

