Skip to main content
Known Participant
August 30, 2011
Question

Limit GPU rendering?

  • August 30, 2011
  • 2 replies
  • 2298 views

Hello fellow developers,

I'm using GPU rendering on a game for the appStore built with Flash CS5.5. It consumes a hell of a lot of RAM (>100) and I've been running tests for weeks to minimize the usage.

What I have discovered when I ran these tests is that it seems as everything that gets animated also gets uploaded to the GPU, an animation within a Movie Clip definetly gets uploaded. Also vector graphics within a MovieClip gets cached even though the "cache as bitmap" or "export as bitmap" options are off. Have anyone else encountered this problem? EVERYTHING gets cached when using GPU rendering, is it supposed to be like this? I am no optimizing expert as this is my first project ever for mobile devices.

Even vector graphics on the main timeline gets cached and kept there. I've been kickstarting the Garbage Collector with the method explained here by Sean Christmann (http://www.craftymind.com/2008/04/09/kick-starting-the-garbage-collector-in-actionscript-3-with-air/) but it only clears a fraction of what needs to be cleared. What I need is to strictly limit what is beeing cached and what not so that I can choose certain elements that I really need to have cached. Is this possible?

Anything that could help is greatly appreciated!

Thanks in advance,

Daani

This topic has been closed for replies.

2 replies

Known Participant
August 31, 2011

Time line animation will KILL your performance.   Its better to animate them in code (use a draw method, or turn on and off visibilty).

http://forums.adobe.com/thread/873326

I can get about 50-60 animated sprites on screen without too much slow down.  Where I start taking a hit is when I have to make the sprites intellegent (collision detection etc.).  Also, make sure your Object pooling. that will help your garbage collection issues.

I've also read that you are not suppose to cache as bitmap with GPU.  I'm assuming its because it cache's automatically?

-dis

Colin Holgate
Inspiring
August 31, 2011

What I was saying in the other thread doesn't mean timeline is bad. Sometimes a particular timeline arrangement can give bad performance, but there are plenty of good timeline arrangements that give as good, or better, performance as a code driven approach, and can be a lot easier to create.

relaxatraja
Inspiring
August 30, 2011

did you try with rendering mode CPU? how it works?

Known Participant
August 30, 2011

Forgot to mention it, yes I have been trying the CPU. Unfortunatelly I was forced to drag down quality too much to get better performance and still that was not good enough:)

relaxatraja
Inspiring
August 30, 2011

I hope you'r publishing with AIR 2.7.

http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html

http://www.indieflashblog.com/understanding-gpu-rendering-in-adobe-air-for-mobile.html

http://www.yeahbutisitflash.com/?p=986

http://www.blackcj.com/blog/2011/06/19/mobile-optimizations-with-adobe-air/