I am excited to introduce today a new project we have been working on, called "Starling". So what is it ?
Starling is a 2D framework for game development developed in collaboration with the Austrian company Gamua (already behind the Sparrow-Framework on iOS), running on top of Stage3D (Molehill). It allows developers to leverage the power of the GPU without diving into the low-level details of the Stage3D APIs (available in Flash Player 11 and Adobe AIR 3). I am convinced that most of Flash developers will love this initiative, as most developers would like to leverage the GPU while reusing concepts like an event model, a display list, movieclips, sprites, etc.
Most of you, who had a look at the Stage3D APIs understand that this can be complex sometimes. So instead of writing 60 lines of code to draw a textured quad.
You will write the following :
// create a Texture object out of an embedded bitmap var texture:Texture = Texture.fromBitmap ( new embeddedBitmap() ); // create an Image object our of the Texture var image:Image = new Image(texture); // set the properties image.pivotX = 50; image.pivotY = 50; image.x = 300; image.y = 150; image.rotation = Math.PI/4; // display it addChild(image);
Quite nice hu ?
Of course, as a little obligatory test, find below a bunch of things (yes, sausages!) moving around :

Here is below another demo using Starling plugged with Box2D (for physics) :

Then, you have complete rendering of the your physics scene on the GPU.
Then of course particles! :

Click for demo (press right key for starting the particles and change).
Below a more concret example including MovieClip (through spritesheet) :

If you want to learn more about Starling, check the little book (Introducing Starling - 112 pages) I wrote about it, you can download it from the link below, it covers many concepts to get started with Starling :

click to download (Introducing Starling - rev 1.2.7).
Check the official Starling website to download it and share your content with the Starling community.
I hope you will like it!
Comments (85)
Great job, amazing performance!
“…while reusing concepts like an event model…”
Someone should fork this and replace all the events with as3-signals.
Hi Josh,
Yes, we discussed the idea of doing this initially. Maybe a future addition
Thibault
Hi Thibault,
Is this “secret” project Adobe was talking about on Flash on the Beach? They told us it will be revealed soon
Just curious…
Thank you
Brilliant! I can’t wait to get my hands dirty with this! Thanks!
Hi franto,
Yes it is
Thibault
Hey nice !! Too bad I’ll have to wait a few hours (damn job ^^) before I can get my hands on it and try “things”
Great initiative, Flash definitely needs such a library.
PS: in the official website, titles don’t appear under IE.
Wow this looks very great!! I think it is also great it is opensourced.
Are the Starling sprites interactive? Can you make it click, hover and focus like normal sprites?
Awesome, this next couple of weeks is going to be a great time for Flash
Hi Philippe,
Thanks for the feedback about IE, will forward.
Hi Mark,
Yes, sprites can be interactive for sure. Just like with the native display list, you can also disable any kind of interactivity on sprites also, if required.
Thibault
Hi Matt,
Yes, 2D easily on the GPU, the way it should be
Thibault
Hi there!
Maybe a silly question, but why develop an AS3 look-alike API that looks like the normal API, behaves like the normal API but it’s NOT the normal API?
Why not re-write the player internals under the hood to use Stage3D so everyone gets the performance increase for free?
Is it too risky? Too expensive? Wouldn’t be even faster than an AS3 implementation? Is it related to Stage3D not being available on Linux?
Sorry for all the questions : )
Juan
Great! really like it! Many thanks!
Hi Juan,
Actually we could, but is there really value doing so ? Once you will try Starling, you will notice how easy it is to use, it feels very natural and simple. Doing so would also mean we would kind of deprecate the display list, which will also be useful for “some” things.
It would not be necessarily faster, and because it would be native, it would be harder to update things as always. Also, this is the model you find on other platforms like iOS or Android, all you have there are GPU APis and you have layers on top, abstracting those.
Also, the community can then participate to such frameworks, fork them, and shape them the way they want. Which is impossible to do if done natively, people are locked and cannot adapt or change things.
Thibault
Cool! I’m very excited with this, can’t wait to try it!!
Some questions:
- Which one is better for game development: using full blitting or Starling?
- Which one is faster, normal blitting or Starling, especially when the Stage3D uses the software rendering instead of hardware rendering?
Thanks!
Hi abiyasa,
- Which one is better for game development: using full blitting or Starling?
Starling allows you to use a completely GPU accelerated graphic pipeline. You are very likely to be able to do more and using low CPU usage by using Starling. To port your game on mobile too, through Starling, you will get the best performance.
- Which one is faster, normal blitting or Starling, especially when the Stage3D uses the software rendering instead of hardware rendering?
In our tests, we have seen Stage3D software fallback consume more CPU usage, but bringing a 2x performance improvement over the traditional display list (CPU) rasterizer.
Hope this helps!
Thibaut
Awesome work!
Thanks Thibault for the response! This is definitely going to be a big improvement for Flash game development.
I’m quite sure the next Flash Professional will support Starling
I stick with ND2D it is fast full featured GPU 2D engine, and it has a lot more usefull features counting and counting
#2 +1.
Exciting times for being a flash developer.
Hi Jaroslav,
ND2D is great too!
Thibault
Very nice work! As always =)
Spotted a little typo:
var image:Image = new Image(texture);
I guess it should be
var quad:Image = new Image(texture);
Is it possible to use Starling with AIR for iOS or AIR for Android?
Je trouve ca zarbi…
Une plateforme 2D, qui finit par se doter d’une API 3D et qui redéfinit une autre API 2D plus performante à partir de celle en 3D.
Sachant qu’on a juste un outil WYSIWYG pour générer la 2D primaire. Cet outil étant au départ la grande force de la plateforme.
Ca cloche. C’est le bordel. Par exemple les nouveaux arrivants en dev Flash ne vont jamais rien y comprendre.
Nice to have this but its an epic fail that Adobe has not managed to get the hardware acceleration going for all existing flash content when using all the existing apis and code base.
HUGE EPIC FAIL.
Super lame Adobe, super lame.
I disagree @tomsamson, I think the FlashPlayer team have done the right thing here.
Of course it would be nice to have all the traditional display list content out there instantly GPU accelerated in FP11, but I imagine this would create a backward compatibility debugging hell-scenario for Adobe. Thibault’s response in comment 15 makes a lot of sense to me.
How do I use it on Flex project that use MXML and AS3 syntax instead of Actionscript project? Please advice.
Just played with this library and it’s very slick. Friendly and fast. Love the build-in pivotX/Y.
I’m just missing an API for BitmapFilters…. I’m using those filters a lot in my projects and they always take away precious fps, so it would be nice if there was some way to put in filters without losing fps ( through the API that you normally use with DisplayObjects i.e. *.filters = [filtera, filterb]; ). Otherwise an internal function that takes the bounds of a filter and adds it to the Bitmap i.e. BitmapData. generateFilterRect(); Ah well… it’s an awesome step forwards from the low-level AGAL stuff. Keep up the good work.
Niice! Looking through the little book right now. (107 pages.. little indeed
I am very interested in the motivation behind not making this an official Flash Player feature. I wont put it quite the way ‘Juan’ or ‘tomsamson’ did, but still, why not do this internally?
Don’t misunderstand, mirroring the standard API feels like the right approach and effort of releasing the library is appreciated (a lot!), but why? (always ask why
Hi Thibault so impressed too much things in so small time, 3D, physics engine! Great !
Superb framework. I’m making a game right now using it. Why cant we add children to MovieClips?
gpu is not working with me all the demos fall back to cpu i was able to run gpu with flash incubator
is there a link to download flash incubator so i can chick if the problme is on my machine?
Hi Thibault, great news!
How can I use it in my AIR 3 for mobile experiments?
I tried to set it up but ended with the Wrong WMode error.
Thanks
This is such a good work you did. Really I look forward creating some amazing games thanks to this framework.
Flash becomes more and more efficient at creating games and I’m sure it will pleased me
.
Thanks again !
Hi Ypmits,
Yes, filters are on the list of potential additions
Thibault
This is a really big deal. This was exactly what you needed to do to get wide and quick adoption of Molehill among existing developers. Please continue with this!
Are there any performance strategies for dealing with large numbers of objects (like moving 10000 unchanging circle images around the screen)? I’m finding that with large quantities of small objects, blitting the old fashioned way actually comes out ahead. Of course, as soon as I move up to larger objects, Starling wins easily, taking no hit as objects get larger. ND2D has some interesting strategies for optimizing this type of thing, and I’m wondering if there’s anything similar in Starling. I tried using RenderTexture.drawBundled(), but that seemed to come out fairly close to where I was by simply adding all of the objects to the Starling display list and moving them around. Any suggestions?
Your team has done an excellent job making this API easy to get going with!
Thibault, I have one tiny detail you might want to add to the getting started instructions:
- If you are developing an AIR App, set the render mode to GPU. Otherwise you’ll get a “wrong wmode” alert. (Took me a couple of hours to figure out)
And a question: Why are you targeting 4.5 SDK (4.5.0.20967) instead of the newer stable version?
Thanks.
Hi Emibap,
Thanks for the notes. I will fix this. I used internal builds where renderMode=direct was required. Sorry!
For the SDK, good point. I guess it is outdated version, will update this.
Thanks again.
Thibault
Hi Tyler,
Good point. For this specific use case you mentioned, yes it could be optimized. This is something we discussed with Daniel, Starling could reuse the same vertex/index buffer instead of creating multiple ones if objects are the same. Daniel, did some tests and had a 20% performance improvement but was not super happy about the design he would end up with.
So, yes. This is something that could be added, you can put a request on the Starling forum : http://forum.starling-framework.org/
Thibault
I think the sample code is messed up. The variable quad is never declared/instantiated. Otherwise, looks great!
Very very cool.
But may be we need add some utils like vaildate GPU can used?
Hi, Thibault.
Can we use Starling framework with another Stage3D frameworks (for instance Away3D 4)?
First tests shows that one stage3D is overriding another.
this.view = new View3D();
this.addChild(this.view); // adding viewport to display list
this.starling = new Starling(MainClass, this.stage, null, stage.stage3Ds[1]); // pass next index of stage3D
this.starling.start();
and we just see starling content…
@John Davies, who said this:
“I disagree @tomsamson, I think the FlashPlayer team have done the right thing here.
Of course it would be nice to have all the traditional display list content out there instantly GPU accelerated in FP11, but I imagine this would create a backward compatibility debugging hell-scenario for Adobe.
”
That´s what they have to do if they want to keep the majority of the flash designer user base around and that´s also what they have to do if they want to make flash´s reputation not go completely to shit.
Let’s be realistic here:
Who knows about things like Starling: People like us visiting such sites, coding in AS3 etc.
The majority of the flash designer (not coder) base hates AS3 and would prefer to do things in visual workflow in the flash ide and code in something as simple to use as AS1/ JS.
Also of course the notion promoted by Adobe that one has to code in a lower level language like AS3 to get better performance is of course nonsense because the main performance bottleneck of flash was always the graphics handling side so addressing that brings the huge performance boost as we see.
In other technologies it doesn´t matter in which language one codes, one always gets massively better performance than in flash because all visual content is automatically hardware accelerated.
Besides that, Adobe´s approach means:
-All exisiting flash content has to be recreated to get any performance gain
this will not be done and hence:
-99.99% of the flash content on the web will for many years be performing as sucky as always and hence lead to more and more people saying flash´s performance still sucks.
Adobe has the task to allow people to recompile their existing AS1,2 and 3 content to run accelerated on the visual side and also that anything one does in visual workflow in flash ide should automatically get hardware accelerated behind the scenes.
If that isn´t delivered, well, blame yourself as flash´s reputation goes more and more downhill.
This looks amazing! This will definitely help spread the new version of Stage3D amongst developers! Keep up the great work!
I’d really be interested in utilizing this for some blitting tests I am using for as3isolib.v2. The issue I have had in the past regarding these 2d to 3d utility libs are that they addresses “whole” objects just fine, but can’t seem to handle split textures.
If you have some time and would like put it through it’s paces with the as3isolib.v2, please let me know. I love to see what kind of performance boosts it would give.
hi
i would also like to know if this starling framework works in combination with existing 3d-framework like away3d. would be awesome to use this particles in my away3d projects…
Look really cool.
I am going to test it !!!
thx a lot
Hi tomsamson,
Automatically HW accelerate existing content is not likely to work. We cannot magically HW accelerate all the content produced for the past 15 years and expect everything to work.
If you look at how modern platforms are working today, what they expose to you are GPU APIs and a layer is created on top of this to abstract the complexity if needed. Why do you think such libraries like Sparrow or Cocos2D exist on iOS for instance and are so popular ?
You should also check Tinic’s article explaining the issue with automatic/magic HW acceleration, we have been there : http://blog.kaourantin.net/?p=138
With such frameworks like Starling and others, people have the opportunity to easily transition to HW acceleration and soon, most content will use complete GPU acceleration and this is very likely to change a lot of things.
Finally, you mention people, which will not know about such frameworks, I am not sure about that. And if tools are needed, they will be relying on such frameworks behind the scenes, so I guess we need to have those pieces before building more on top
Thibault
perfectly good
Thibault.
Toi qui a été formateur. Comment je vais expliquer cette situation à mes élèves qui vont découvrir l’AS3 cette année ? Vers quoi on se dirige ? Une séparation de la communauté de Flasheurs en 2, ceux qui jouent en 2D native et ceux qui jouent sur le Stage3D ?
Sache par exemple que cela fait plusieurs mois que j’entends mes élèves dire “c’est vrai que Flash est mort ? on nous que Flash de toute façon c’est fini…”. Alors quelle perspective donner à des nouveaux arrivants vu la situation ? Comment arriver à leur passer doucement la pilule que va falloir se taper une nouvelle API après avoir galéré 1 semaine sur la première ?
Merci de ton retour, tu peux passer par mon email directement.
Cordialement.
Une solution pourrait être de considérer l’API 2D native comme dépréciée, et former les nouveaux arrivants en AS3 directement sur l’API de Starling.
Qu’en penses-tu ?
I wonder if in Starling the 2.5d features like rotateX, rotateY and rotateZ and z-axis still exist and work right because of stage3d.
Impressive. I’m waiting 2D acceleration since years now. Great work!!!
looks initiative. When will CS 6 release?
I’m not able to run any of the demos – all I get is a blank screen with a different colored background. On a couple of them I have a stats box. My flash version is 11.0.1.129
What do I need to do to see them?
Hi! This is really cool and these demos run very fast!
But how to activate FP11 with Google Chrome? I’m ok with Firefox and IE but Chrome still have FP10.3
Thanks for any advice.
Sorry for my previous question ^^ I’ve just installed Chrome Canary and it’s ok.
Is there a workaround to get it running on mobile yet? I get the “wrong wmode value” with gpu
Would love to see how it runs on the iPad2.
Can’t make it work on android mobile device (with flash player 11 installed).
I’ve tested with a HTC desire and an Acer iconia tab…
any issues with android ?
Good job, the library looks great.
My only concern to use it for production games is distribution. Would it be possible to have the library working transparently with earlier (10.x) version of the flash player using the display list? A bit like software rollback.
Aucun demo ne fonctionne sur IE et firefox
seulement sur Chrome Canary?????
dommage
@tomsamson – Boo-fucking-hoo
Good job, Thibault & co.
thanks for this brilliant framework, cannot wait till i use it in my next project!
Hussein
very good performance…
perfectly cool!
Similar to what Kuba asked… will this work natively to export from Flash to iOS?
Hello,
Pour les Développeurs ActionScript francophones, j’ai repris les exemples du livre de Thibault avec des explications en français
http://www.actionscript-facile.com/tag/starling
A plus,
Salut Thibault,
Est-il possible de bénéficier de tout ceci avec une application Mobile ? J’ai crue voir que pour le moment Air 3 pour Android et IOS ne supportait pas stage3D ? Si c’est le cas, existe’il une version beta de la prochaine version de Air 3 pour commencer à travailler ? Et sinon Flash CS6 est pour cette année ou 2012… ?
Merci d’avance,
Mike
Salut,
Cédric pose une question intéressante en 52/53. Est-ce que tu pourrais partager ta réponse, si réponse il y a ^^.
Merci
Bonjour,
j’ai vu qu’il y avait au sanflashcisco une intervention nommée “Stage3D – Changing the Game for Gaming”
savez vous si elle sera visible sur le net ? si oui où ?
Merci
ps : sorry, I wrote in french because I know that Thibault will understand
just a little performance test:
http://niklasknaack.blogspot.com/2011/10/starling-framework-performance-test.html
hope u like it.
cheers
Looks awesome, cant wait to play around with it!
This is something that I have been eager for a very long time! GPU-acceleration for 2D-games! Now ANYTHING is possible! This will deliver a whole new gaming-experience!
Digging in right now, and really excited! FYI- small typo on page 8- “at not time”
Great work! I’m already testing it out and creating a tile-based game… Quite simple with great performance!
Where can I get the source of the boos’s demo?
Hi,
This is super cool! Does the Flash hardware acceleration still only work in the browser and on mobiles or does it work on the desktop as well?
Hi, nice introduction, after playing with the API, I made tutorial on my blog to show how to implement pixels collision detection with starling. Feed back are welcome. here it is : http://www.cocoapp.eu/?p=342
cheers
Bonjour Thibault.
Pourrait tu ajouter dans la classe textfield de starling la possibilité d’écrire de droite à gauche (hébreu, arabe). Ce serait génial.
Merci et bonne année.
HI, really nice work, currently I’m testing I’ve got a problem I’m trying to make something like AngryBirds where you move the whole view fallowing the ball all looks to be ok but the texture is just limitate to the initial view area so when I move I just see my current view moving but no the remaining area to the right, I think this is to save memory just drawing the available area of my texture but is there a way to update it so I can see the remaining area, I hope my question is clear. Regards.
woOow !amazing .. .
Is there a bitmapdata.draw() method on Starling? If there is, is it faster?
Thank you.
cant you rotate particles ?
Hi,
Mybe this is a stupid question but I must ask. It is reccommended to use starling for mobile apps that are not require to much resources like games?
Thank you
Trackbacks/Pingbacks (19)
[...] wollte es Euch nicht vorenthalten: Starling Framework – The GPU powered 2D Flash API (Website) Introducing Starling – ByteArray.org (kurzer Einstieg + Demos) http://www.bytearray.org/wp-content/…0rev%201.0.pdf (alle Infos) Ich [...]
[...] Example of how Starling works: http://www.bytearray.org/?p=3371 [...]
[...] can find the introduction of the framework here and you can find, download and test the actual framework [...]
[...] : This demo is available here (was produced with Starling) Post a comment | Trackback [...]
[...] Introducing Starling – ByteArray.org [...]
[...] Introducing Starling – ByteArray.org [...]
[...] qui restent surprise. On a appris il y a quelques temps la sortie d#039;un framework nommé Starling, développé par Thibault Imbert (Chef Produit sur la Flash Platform) dont personne n#039;avait [...]
[...] more about Starling: bytearray.org/?p=3371 starling-framework.org leebrimelow.com/?p=3028 gotoandlearn.com/play.php?id=147 [...]
[...] for some quick and easy examples. I also highly recommend reading the lengthy Starling manual available on the ByteArray blog. The last few pages go over how to use particle [...]
[...] そして、Starlingのサンプル http://www.bytearray.org/?p=3371 [...]
[...] sometimes broken or corrupt (screen displays static looking image). This is with trying to run the Starling demo or simply loading an image into the [...]
[...] I gave a try to Starling, it is easy to use ! To get start go on this Thibault Imbert page’s blog, there are some examples and a book! Don’t forget to upgrade to the last version of the Flash [...]
[...] habe ich mich an die Starling-Introduction-PDF gehalten, in der schon einige gut dokumentierte Beispiele und Anregungen zu finden [...]
[...] http://www.bytearray.org/?p=3371 [...]
[...] Starling is a display framework which allow developper to use flash player 11 stage 3D API. It replicate the display list structure to gpu, so it#8217;s pretty easy for any flash developper to get into it. Here is more info about Starling. [...]
[...] from O’Reilly by Thibault Imbert A few months ago, I was excited to share with you the birth of Starling, the new 2D GPU framework for Flash. I am happy to announce that the tutorial book I wrote is now [...]
[...] 9:19 Downloading the PDF… in a zip file? http://www.bytearray.org/?p=3371 [...]
[...] Thibault Imbert Tutorial Collection – http://www.bytearray.org/?p=3371 [...]
[...] Starling is a display framework which allow developper to use flash player 11 stage 3D API. It replicate the display list structure to gpu, so it’s pretty easy for any flash developper to get into it. Here is more info about Starling. [...]