# Smooth

**URL:** <https://phaser.discourse.group/t/smooth/8273>\
**Category:** Phaser 3\
**Created:** [December 3, 2020, 9:25am UTC](https://phaser.discourse.group/t/smooth/8273 "2020-12-03T09:25:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jack/32/1689_2.png) [@Jack](https://phaser.discourse.group/u/Jack)\
**Post date:** [December 3, 2020, 9:25am UTC](https://phaser.discourse.group/t/smooth/8273/1 "2020-12-03T09:25:43Z")

</div>

It’s been a while since I’ve been programming simple games. I liked how smooth things could move. Today I tested a game, and there’s a lot of lag. I tested some [Phaser 3 examples](https://phaser.io/examples) and they have the same problem. I usually use Opera, tested Chrome, same problem, and then luckily Firefox is relatively smooth. Is this a common problem with never versions of browsers and Phaser ? That they’re more demanding. My PC should be capable.

The games and examples run almost twice as slow compared to Firefox. Using older versions of Phaser 3 helps a bit.

---

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jack/32/1689_2.png) [@Jack](https://phaser.discourse.group/u/Jack)\
**Post date:** [December 5, 2020, 6:15am UTC](https://phaser.discourse.group/t/smooth/8273/2 "2020-12-05T06:15:03Z")

</div>

I can have Opera, Chrome and Firefox running the  
[https://phaser.io/examples/v3/view/actions/place-on-circle](https://phaser.io/examples/v3/view/actions/place-on-circle)  
side by side. All updated. Firefox is super smooth. Opera and Chrome is lagging awfully.

On the other hand. Firefox doesn’t show the source. Just stops at “Please wait, loading source from GitHub …”.

[https://phaser.io/examples/v3/view/physics/arcade/fps-test](https://phaser.io/examples/v3/view/physics/arcade/fps-test)  
ETA: 2000, Opera: 2163, Chrome: 2193 and Firefox: 2011  
Again these numbers has Opera and Chrome running like at half speed.

Tried to play around with  
this.physics.world.setFPS();  
Is the threshold like trying to get below 2000 in the example. If so it doesn’t look good.

All of my games have some objects moving at a fixed number of pixels per frame, so this is like a dealbreaker.

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 5, 2020, 10:02pm UTC](https://phaser.discourse.group/t/smooth/8273/3 "2020-12-05T22:02:29Z")

</div>

Check [https://codepen.io/samme/full/KbdXad](https://codepen.io/samme/full/KbdXad) (click on the game canvas) or [https://codepen.io/samme/debug/KbdXad](https://codepen.io/samme/debug/KbdXad) (temporary link).

Physics FPS is a different thing, you don’t need to change that.

---

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jack/32/1689_2.png) [@Jack](https://phaser.discourse.group/u/Jack)\
**Post date:** [December 5, 2020, 10:32pm UTC](https://phaser.discourse.group/t/smooth/8273/4 "2020-12-05T22:32:40Z")

</div>

Excellent. That restores a bit of faith. With the debug Opera, Chrome and Firefox has the logo jumping around smoothly. ActualFps and delta at 98-101%. Now what happened ? Shouldn’t the Phaser 3 Examples be tweeked accordingly - if possible. I need to investigate.  
Thanks. 🙂

Okay, I guess I need to go from Phaser.AUTO (which auto-detect WEBGL) to CANVAS. Funny thing is that it used to be all fine. I’ll look into my graphics driver. And of course I have to test on a few other computers.

Been running different WebGL reports and tests in Chrome and Firefox, and got different results (on both top and lower levels). I guess that was what to be expected.  
[https://browserleaks.com/webgl](https://browserleaks.com/webgl)  
Chrome says ANGLE: True, Direct3D 9. Major Performance Caveat: True.  
Firefox, ANGLE: True, Direct3D 11. Major Performance Caveat: False.

---

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jack/32/1689_2.png) [@Jack](https://phaser.discourse.group/u/Jack)\
**Post date:** [December 8, 2020, 7:48am UTC](https://phaser.discourse.group/t/smooth/8273/6 "2020-12-08T07:48:23Z")

</div>

Okay. Solution for me (developing). In Opera and Chrome I enable this flag:  
 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/6/6e7c48a1465ff4a25171eba2722d98c228300eab.png)  
Changed from “default”.

Link in previous post now reports the same for Opera, Chrome and Firefox.  
Phaser 3 is now super smooth. Yes !

For my low demanding games I think I can use CANVAS (leaving AUTO). Some people will experience smooth games at 60 fps and not something lagging at an erratic 30 something fps, but it may also be the other way around.

CANVAS seems to use GPU anyway. The tricker was to go from Direct3D 9 to 11.  
[https://en.wikipedia.org/wiki/ANGLE\_(software)](https://en.wikipedia.org/wiki/ANGLE_(software))  
Chromium (Opera and Chrome) uses ANGLE not only for WebGL, but also for its implementation of the 2D HTML5 canvas and for the graphics layer of the Google Native Client.  
Firefox uses ANGLE as the default WebGL backend on Windows.

Beware. Setting the flag may cause problems elsewhere. I haven’t seen any.

😃
