Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Full Screen Animation performance

Recommended Posts

Any Actionscript work I do is either AIR for mobile or AIR for Desktop (standalone installations, kiosks) etc. 


For ease of setup I usually must target full frame for any desktop applications.


Performance optimization is critical regardless.


When publishing AIR to the desktop, you have the option of 3 different rendering modes, DIRECT, CPU, and AUTO. From experimentation on a typical PC I've discovered that using AUTO give the best performance.(DIRECT mode seems better on my iMac, I assume this has to do with different GPU-CPU configurations)


A recent application uses Blitmask on a dozen horizontally scrolling Textfields. 

With a 120 fps targeted frame rate and HD (1920x1080) stage size I  easily average over 100fps.



But, the moment I set the application as being fullscreen, which represents a roughly 10% increase in overall pixel area, the application frame rate dropped to less than 24fps!! Apparent speed of actual tweening seems even slower, less than 12fps.


I am perplexed as to why this is so.

I also tried the fullscreen rect trick which works well for full screen video but this had no effect.


Can anyone suggest how I might improve fullscreen animations using TweenMax-Lite?

if (stage.displayState == StageDisplayState.NORMAL) {
stage.fullScreenSourceRect=new Rectangle(0, 0, 1920, 1080);
} else {
Link to comment
Share on other sites

I'm 99.999% sure this has nothing to do with GSAP whatsoever. It's a graphics rendering issue in Flash. Think about it this way: let's say you've got all these nice bitmaps sized at 1000 pixels tall and you display them at their native size - perfect. 1000 rows of pixels in the image map to 1000 rows of pixels on the screen. Beautiful. But if you then change it so that 1000 rows of pixels must now map to 1100 pixels tall...uh oh, now Flash (and/or the GPU) has to do a bunch of extra calculations to do sub-pixel rendering. 


Imagine a black background with a single 1px white horizontal line in your image that's on the 10th row of pixels - where does that map to now? Should it be on the 11th row? Technically it lands inbetween 2 rows, so Flash has to figure it out, and sometimes blur the line so that instead of one white line, there are two gray ones. 


I can see why you'd assume that only stretching an image 10% shouldn't introduce much extra work (maybe 10% extra work?) but it's not like that. Even stretching it 1% can create a big speed bump for the processor. And again, this has absolutely nothing to do with GSAP.


If you want the best performance, always have things render at their native size. Otherwise, you can try defining that fullscreen rect thing, but that isn't really a silver bullet as far as I know. You can check with Adobe to see what their recommendations would be (I don't remember reading anything like that). 

  • Like 2
Link to comment
Share on other sites

I suspect there is actually something else going on here that only Adobe engineers can answer. After a lot of testing what I've discovered is that the full screen executable ALWAYS performs better with buttery smooth tweens when the Flash IDE is open. If I close the IDE, relaunch the executable, there is noticeable stutter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.