I just wanted to give you a quick "heads-up" on my latest commits. This will probably break some code in your projects — but it was necessary. It's very easy to fix, though, and I've got some cool new features that make up for that!
FEATURE 1: Skipping Unchanged Frames
Some of you might have seen the new "starling.skipUnchangedFrames" property? When enabled, Starling won't do any rendering at all when the display list is unchanged. When I introduced this, any masks on the stage prevented this from happening; which is bad, because Feathers uses them a lot. Now, that's no longer an issue!
E.g. when you look at the Starling Demo or the Feathers Components Explorer (with that property enabled), Scout will show that most frames are avoid of almost any AS3 code.
That's a massive improvement for battery consumption of Starling-powered apps. , so almost ALL OF YOU should enable this property right away!
You may ask why I didn't activate this by default. That's because "RenderTexture" and "VideoTexture" need some special care when it's enabled. That is: there is no notification mechanism right now indicating that a texture is in use and if it has changed. So whenever a texture changes, developers have to call "setRequiresRedraw()" on any display object (e.g. the stage) to force re-rendering. Or they can disable "skipUnchangedFrames" while such a texture is on the screen.
Thanks to maximgavrilov for the idea for this feature!
FEATURE 2: Filters now render their last pass directly to the back buffer.
Starling tries to do this only when the object is moving; when it's static, I'm still rendering into a texture (for render cache support). In any case, that should be a welcome performance improvement for filters. One less draw call in most cases, without any downsides!
Furthermore, the "resolution" property on filters is back, and you can now even change the "textureSmoothing" and "textureFormat" settings. You can now also "cache()" them again if you know they won't change for a while.
And here are some things that I changed along the way, probably causing you to make a few changes in your code:
CHANGE 1: The package of the "MeshStyle" class has changed.
It's now to be found in "starling.styles". I realized that this is necessary when I'm adding other styles to the framework, which will happen sooner or later. In that case, they should all be grouped together just like it's now for the fragment filters.
CHANGE 2: Indicating that display objects don't support the render cache has changed.
Instead of overriding "get supportsRenderCache" and calling "object.updateSupportsRenderCache()" — which was not very intuitive — you now simply call "painter.excludeFromCache(object)" in the render method.
CHANGE 3: The default of "MeshBatch.batchable" changed from "true" to "false".
It's now just like in Starling 1. I changed that default when I introduced the render cache, because I thought it would be important to have all objects support it by default. But when people use the MeshBatch class directly, we are normally talking about a huge number of objects; and it's just a bad idea to batch this.
Please try out those changes! Except for a few very small bugfixes, I'm hoping that this is going to become the final 2.0 version. Just pull the latest head revision to get going.
If you have any questions, though — feel free to ask ahead!