Skip navigation
Currently Being Moderated

RenderMode (gpu) or (direct) - Can someone explain ?

Apr 3, 2012 6:12 AM

When in GPU mode .. I am seeing pretty good performance. There is a couple hiccups on the iPad3 using tweenMAX on large PNG's.    When I set renderMode to Direct ... performance takes a huge hit and looks like it's running at 10fps or something.

 

I keep reading about starling and using direct rendermode for awesome performance.  Is there something I need to do to achieve this ?   I am building with AIR 3.2 .. I'm building on the command line with the iOS5.1 SDK.      What else do I need to do to take advantage of getting greater performance ?

 
Replies
  • Currently Being Moderated
    Apr 3, 2012 6:19 AM   in reply to Applauz78

    If you're using Starling, or StageVideo, or Stage3D itself, you need Direct for it all to work correctly. If you're doing things that are less suited to GPU, such as character animations where every frame looks different, you may well get better performance with CPU than GPU.

     

    What Direct does for those kinds of things is to transfer the changed area of the stage straight into the GPU. You will get much better performance than CPU, but depending on how much of the screen has changed you may or may not get better performance than GPU.

     

    So, if too much is changing you may well get better performance with GPU.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 6:46 AM   in reply to Applauz78

    Some of the usual tricks, like cacheasbitmap = true, might improve the CPU performance enough to compensate for the overhead of using Direct to copy so much to the GPU.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 8:34 AM   in reply to Applauz78

    So, you're getting about 1500 fps on GPU? Just kidding...

     

    I was saying that if you have something that isn't optimized at all, running as CPU at 10 fps, it may get 15 fps on Direct without any changes. If you use normal CPU optimizing tricks, such as cacheasbitmap=true, the CPU performance might go to 20 fps, and Direct to 30 fps.

     

    If you're doing normal GPU, I think that Flash does what it can to get bitmaps into the GPU for you, but if for example you had a walk cycle you would get bad performance unless you used a system such as Starling that dealt with sprite sheets, or you had code that preloaded the GPU with the frames of the walk cycle, and then cycled through those using code. That's where using Direct on its own might be worth trying, you get good enough performance from the original MovieClip or Graphics walk cycle without lots of work making sure that textures are loaded into the GPU.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 12:13 AM   in reply to Applauz78

    You could also try something like this: http://www.greensock.com/blitmask/

    No idea if it works for you, but is sounds awesome...

     

    Anyone had any experience with blitmask and air?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 10:49 AM   in reply to TopoBuilder

    I've had great results with TweenLite so I assume other greensock things will work well with AIR.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points