image

I'm pleased to announce that we have completed our work on the WebGL Tilemap Renderer for Phaser, and it's now available for testing in Phaser 2.7.0 Beta 1.

For too long tilemap performance in Phaser has been poor running under WebGL. With a Canvas to Texture internal drawing system, coupled with super-expensive texture uploads, it never took advantage of WebGL at all, and caused significant performance issues.

Thanks to the support of our Phaser Patreon backers, we were able to fund the development of a brand new WebGL Tilemap renderer. The new renderer creates 'internal' layers for each different tileset included in a map, which permits high-speed batch drawing via WebGL, and fixes large tiles at map edges, and other glitches, which are visible in the Canvas implementation.

When a map is processed, the system creates a list of tiles for each layer. This intermediate step allows us to continue to use all the existing map functionality, and get out a list which can be rapidly processed into TRIANGLE_STRIP batches.

The lists (there is one per layer) are processed into batch data which is fired up to the new WebGL shader, where it is drawn extremely rapidly and efficiently. The shader handles alpha and scaling on a per-batch basis. So the Tile.alpha value is ignored but the TilemapLayerGL.alpha is used, which is the same as the Canvas implementation.

Please Test!

You can download pre-built versions of Phaser 2.7.0 from the GitHub dev branch. This is a drop-in replacement for any game using Tilemaps under WebGL. Note that 2.7.0 is an upgraded version of Phaser 2.6.1, so if your game doesn't yet run under 2.6.1 you'll need to remedy that, before you can test out the new tilemaps.

Download Phaser 2.7.0 Beta 1

Once you've had a chance to test it, please report your findings in the Phaser Forum. We're especially interested to know what performance you get on very low-end GPUs or mobile hardware. But it's safe to say we're seeing silky smooth 60fps rendering on a vast range of desktops now.