Search code examples
performanceactionscript-3renderinggpumode

AS3 direct rendering mode -- what does it accelerate?


Direct rendering mode. What exactly is this used for? "Treating the entire frame as a Stage3D surface" does nothing for me. I hear reports that it is the "fastest" rendering mode, but in what way? Does it speed up vector processing, bitmap processing, or neither?

Would the old "GPU" tweaks (caching as bitmap) yield performance increases under this mode?

Also, where should the project be set to use direct rendering? There are two places the option is offered--the first in the AS3 language config and the second in the publishing menu.


Solution

  • direct render mode is used with Stage3D. This is Adobes hardware accelerated set of API's that run in the browser through flash player and on desktop, iOS and Android through AIR.

    When using Stage3D you essentially get a hardware accelerated stage that lives behind the traditional display list stage.

    stage list

    You cannot use the traditional Flash API's and have your content run on the GPU, programming directly on Stage3D is more similar to OpenGL programming. It requires the use of AGAL shaders and a specific set of API's.

    http://www.adobe.com/devnet/flashplayer/articles/how-stage3d-works.html

    There are however quite a few libraries designed to work directly with Stage3D. Content programmed with these libs will be hardware accelerated and take advantage of the huge performance boost.

    Starling mimics the DisplayList API's and should be pretty familiar if you've done traditional Flash programming. There is also a UI Framework built on top of Starling called Feathers. I'm currently using this in a mobile application as an alternative to Flex Mobile for performance reasons.

    There are also several 3D libraries that are designed for creating/working with 3D content. Check out Away3D or do a quick google search. This site also lists quite a few Stage3D frameworks:

    http://www.adobe.com/devnet/flashplayer/stage3d.html

    Here are some more links for more info:

    http://gaming.adobe.com/ - info on Stage3D sdk's. Also includes download links for the newest Flash SDK's

    http://www.bytearray.org/?p=2555 -Stage3D was called Molehill in the beta days

    Getting started with stage3d in Flash CS5, and which framework to choose? -another stackoverflow question on the topic

    Hope this helps