I was actually a little surprised when I loaded this simple three.js demo on my shiny new Macbook Pro M1 Max and it was ridiculously faster than on my Macbook Pro 2019. I mean, a frame-per-second is a frame-per-second, regardless of hardware. Is the animation/rendering on my 2019 that much below-speed, or is it that much over-speed on my M1 Max? Is there something I can change to ensure that the demo runs at the same speed regardless of machine?
I forked the example to add stats.
What’s your frame rate in each case? If it’s running very low on the older computer maybe the physics is not accounting for that correctly.
over-speed on my M1 Max?
I tested and can hit 260fps with the max number of balls on my laptop so I don’t think it’s overspeed issue.
I noticed that on my MacBook 2019 I had to f-with the Canon.js gravity in order for the ball objects to bounce somewhat close to like they would in reality. At the time, I chalked it up to just not having a deep understanding of Three.js, Canon.js, or WebGL yet. Maybe it’s just that normal mortal computers just can’t keep up, and this maxed out M1 Max with a 32-core GPU isn’t even breaking a sweat.
Yeah, when I set the Canon.js gravity to -9.8 (which is apparently equal to 1G), it looks realistic on the M1 Max.
You can make any computer break a sweat by disabling the browser FPS limiter btw.
Run Chrome with these flags and it will run the scene at maximum frame rate on whatever machine until it’s limited by either the CPU or GPU.
chrome --disable-gpu-vsync --disable-frame-rate-limit
Is there a solution to make m1 macs run at a normal speed?
Is there a way in code to make threejs expereinces run at a normal rate on m1 macs?
Can you provide some coding?