Navigation

Multi Textures and Path Finder Plugin

Published on 15th July 2016

image

Since the last issue we released Phaser 2.6.1. This was a tiny point release fixing an important bug. Beyond this though, we've not been idle - and the Phaser development train continues to plough on! Here is what's in production:

Multi-Texture Support

As you know, Phaser uses a custom build of Pixi v2. In Pixi 2 (and 3) it uses batched sprites in WebGL. This allows it to draw sprites that share the same texture in a single draw call. So if 2000 sprites are all using the same texture, or part of a texture (think texture atlas), then it happens in a single draw call on the GPU. This is important to keep performance up. Every time the texture has to change, the batch if flushed and starts over from scratch again. Do this too often and you can easily work your way into the situation of 1 draw call per Sprite, which is a terrible place to be from a performance point of view.

However, it doesn't have to be this way. And Felipe (@bitnenfer) has been busy implementing multi-texture batched drawing support, and updating the Phaser / Pixi 2 shaders to support it. This is something Mat wrote about on the Pixi blog, which explains it in more detail. We're using our own approach and code for Phaser, but the principal is the same.

You can track development in the public multi-texture branch on GitHub. Most of the hard work has been done, so expect to see this hit a Release Candidate within a week.

Path Manager Plugin

As promised a while ago, I said I wanted to release the Path Manager Plugin we had developed internally, for free, rather than charge for it. So work has begun on doing just this. You can find the source in the Phaser dev repo, in the plugins folder. It's not yet production ready as there are a couple of classes to tidy-up and examples to create. But keep your eye on it, because it's coming soon, and offers some really nice motion path support :)