Luis Carli

Why Godot 4 Web Exports on Mac only work on Safari?

Short answer: It’s a bug on the MacOS version of Chrome and Firefox.

As of August 2023, with up-to-date software, the MacOS versions of both Firefox and Chrome can take an extra two minutes or more to load the web export version of a Godot 4 project, or they may not load at all. Neither the Windows versions of those browsers nor Safari on the Mac present these problems. Why?

This problem is not present in the previous version of the game engine. In Godot 3, the web export utilized the browsers’ WebGL interface. Due to its new features, Godot 4 has introduced a new backend renderer. The compatibility mode used in its web export renders the game through the browsers’ WebGL 2.0 interface. WebGL 2.0 is the next version of WebGL and is based on OpenGL ES 3.0.

Apple has deprecated OpenGL on MacOS in favor of Metal, its proprietary graphics acceleration API. The problem seems to lie in how the browsers execute the WebGL 2.0 calls on the Mac.

Firefox and Chrome utilize a translation layer called ANGLE to transform the OpenGL ES API calls into one of the hardware-supported APIs available for the platform on which they are running. The version of ANGLE used by Firefox and Chrome does not seem to support Metal yet, so what is happening there is not optimal on Mac hardware.

New versions of the ANGLE library have implemented Metal calls, and Chrome is working on updating the version they use.

From playing some games, it seems like Unity3D web exports suffer from the same problem on the Mac. There’s a high probability that the root cause is the same.

Next — Blog

Publishing Web Exports from Godot 4

Previous — Blog

Tiny Game: Platformer