I’ve been impressed by the Starling framework but like many I’ve struggled to get a solid 60fps on some of the older mobile devices out there. For example, my recent parallax scrolling demo was capped at 30fps on iPad 1 whereas the iPad 2 was easily capable of running it at a full 60fps without batting an eyelid.
Thankfully the latest version of Starling now supports blend modes and there’s one in particular that can really give your apps a performance boost in certain situations. It’s called
BlendMode.NONE and it deactivates all Stage3D alpha blending on any display objects that it’s applied to. This is perfect for large background images or tile maps that don’t require an alpha channel.
Let’s take a look at a quick code example. First import the
Now simply apply the blend mode to your display object. We’ll use an
Image in this example:
var image:Image = new Image(backgroundTexture);
image.blendMode = BlendMode.NONE;
And that’s basically it. If you’re applying
BlendMode.NONE to large (or many) display objects then you’re likely to see a significant performance boost on a large number of devices. Remember however, if your display object requires the use of transparency then you won’t be able to use
BlendMode.NONE without losing its alpha information.
For some additional detail and a list of the available blend modes, pop on over to this post on the Starling forum.