If I open this page in Chrome, the box jitters as it moves, but if I open it in Firefox, the motion is much smoother. It’s not a performance or framerate issue so what’s going on here? Is it an issue with the update loop or the way time is measured in PlayCanvas?
Yeah, I don’t think it’s about performance because this is even happening with games running at 60 fps. The jittering is also very noticeable with the single iframes link you provided.
BTW, I’m on a Mac, so maybe it’s more apparent on MacOS, but it’s also very apparent on mobile.
To me, it looks more like a timing issue than a performance issue. Maybe Chrome on Mac and mobile does something differently?
Well, the reason I’m bringing this up is because we’re seeing jittering in our mobile game built with the current version of PlayCanvas The game is using a lot of tweens.
Your game may be a lot more complex than that tweening example. It might be generating the occasional major garbage collection event that causes frame drops, for example.
But the confusing part here is why I’m only seeing the jittering motion in Chrome. The object moves smoothly when I use Firefox. That’s also the case with the tweening example: it’s jittering in Chrome, but smooth in Firefox.
I’ve actually noticed the opposite. Tweens are generally smoother on Chrome than on Firefox. Right now it seems like our smoothness issues are mostly linked to the dissolving in and out of some objects with lots of polys and many surfaces. That seems to cause tween motions to stutter/pause.
Okay, we really need to get to the bottom of this, so I created a new test project in the current version of PlayCanvas: a box moving back and forth similarly to the tween example.
I then took a very powerful iMac (Retina 5K, 27-inch from 2017 with MacOS Mojave 10.14.6) and setup two browser windows next to each other:
Firefox version 70.0.1 (64-bit) on the left
Chrome version 78.0.3904.87 (Official Build) (64-bit) on the right.
Using QuickTime, I made a screencapture clearly showing that when running in Chrome the box jitters while the Firefox project is running smoothly.
The video is available here in .mov format (please download, the Google Drive preview is low quality): https://drive.google.com/file/d/1SSS9hdQlzrvkgGXsDMVQHUReCYpnagcA/view?usp=sharing
Pixel Device Ratio is not ticked in settings in this test. Also, I did not make any changes to hardware acceleration settings in the browsers – I presume people playing our games usually wouldn’t know how to do that
Keep in mind that the issue also occurs on iOS devices, not just MacOS. That’s my primary concern since that’s where our audience is.
logDeltas = new LogDeltas();
logDeltas.start();
// wait a few seconds
logDeltas.stop();
// copy/paste into a .csv and look at it in LibreOffice or so
logDeltas.toCSV();