Stage3D was introduced in Flash Player 11 to leverage the GPU for hardware-accelerated 3D rendering. It offloads rendering tasks to the GPU to achieve higher frame rates and more detailed 3D scenes. The Starling framework is a 2D graphics library built on top of Stage3D that provides a familiar display list API. Starling Feathers is an extension that provides reusable UI controls. The Adobe Gaming SDK packages these technologies along with tools to simplify game development.
5. Before Stage3D
Typical Flash display list
Stage
Instance
SWF file’s
main class
Display
Display
Object
Object
Container
Display
Button TextField Sprite MovieClip Object
Container
Sprite
Source: http://www.adobe.com/devnet/flash/quickstart/display_list_programming_as3.html
6. Before Stage3D
Problems
Till Flash Player 10, 2D & 3D objects are
rendered using software mode.
CPU is over-utilized.
FP10 can take up max. of 4,000 triangles for 3D
scenes to maintain acceptable performance.
Detailed 3D scenes was not possible.
Source: http://www.adobe.com/devnet/flashplayer/articles/how-stage3d-works.html
7. Before Stage3D
Problems
Imagine a scene from Epic Citadel rendered using CPU only?
9. About Stage3D
Introduced for desktop since Flash Player 11.0 &
AIR 3.0
For mobile since Flash Player 11.2 & AIR 3.2
10. About Stage3D
Actionscript
3D frameworks
2D frameworks
(Away3D, Alternativa3D, etc
(Starling, ND2D, etc)
)
Stage3D
OpenGL, OpenGL ES 2.0, DirectX
GPU
Source: http://www.adobe.com/devnet/flashplayer/articles/how-stage3d-works.html
http://www.adobe.com/devnet/flashplayer/articles/introducing_Starling.html
http://readwrite.com/2011/10/05/adobes-strategy-to-distinguish
11. About Stage3D
Advantages
Leverage on 3D hardware acceleration
Offload rendering tasks to GPU
Achieve higher frame rates (30 – 60 fps)
More detailed 3D scenes
Source: http://www.adobe.com/devnet/flashplayer/articles/how-stage3d-works.html
12. About Stage3D
Disadvantages
Have to be extra careful when mixing regular Flash
UI (flash.display.*) with Stage3D.
Limited to Shader Model 2.0 (latest version is
4.0), due to requirement to target multiple
platforms.
Smaller no. of Shader registers available due to
older version of Shader Model being used.
Source: http://www.adobe.com/devnet/flashplayer/articles/how-stage3d-works.html
13. About Stage3D
Special stage layers
StageVideo (bottom-most layer)
Stage3D[0]
Stage3D[1]
Stage3D[n]
Stage (top-most layer)
Source: http://www.adobe.com/devnet/flashplayer/articles/how-stage3d-works.html
14. Starling framework
Actionscript port of Sparrow framework for iOS.
Developed on top of Stage3D API.
Available for desktop and mobile.
Meant for 2D game development, but has other
uses too.
Source: http://www.adobe.com/devnet/flashplayer/articles/introducing_Starling.html
15. Starling framework
Advantages
Easy to learn
Familiar API e.g. flash.display.Sprite starling
counterpart is starling.display.Sprite
Similar API useful when updating existing projects
to Starling.
Source: http://www.adobe.com/devnet/flashplayer/articles/introducing_Starling.html
17. Starling framework
More advantages...
Event model
Lightweight
It’s free!
Source: http://www.adobe.com/devnet/flashplayer/articles/introducing_Starling.html
18. Starling framework
Disadvantages
Layering issues (when using either StageVideo or
regular Flash display list objects, or both).
Need to look out for “Resource not available”
errors (can be solved by Object Pooling).
Need to watch app file sizes, especially when
deploying to mobile.
Spritesheets are limited to 2048 x 2048 pixels.
Source: http://www.adobe.com/devnet/flashplayer/articles/introducing_Starling.html
19. Starling Feathers
extension
Lightweight skinnable, extensible UI controls for
Starling framework.
Cross-platform, with various themes available for
both desktop and mobile.
Provide screen transitions similar to mobile view
transitions.
Provide UI controls commonly found in mobile apps
e.g. header bars, scroll/table views, switches, etc.
20. Starling Feathers
extension
Useful layout functions.
Useful for creating quick prototypes.
Useful for creating “Settings” screen for apps.
Prefers AS3 Signals over Events.
21.
22. Getting started with
Starling
Tools
Adobe Flash Builder 4.7
Eclipse with FB4.7 plug-in
FlashDevelop
FDT
Adobe Flash Professional CS6
23. Getting started with
Starling
SDKs
Adobe AIR SDK 3.2+
Adobe Gaming SDK
Pre-packaged with Adobe AIR
SDK, Starling, Feathers, Away3D, essential native
extensions and ATF tools
Flash Player 11.2
28. Adobe Texture Format
(ATF)
Traditionally, games use uncompressed formats like
PNG for game graphics.
GPUs do not know how to handle image formats like
PNG and JPEG natively.
Images are stored into CPU memory instead.
Better to use GPU memory, but right type of
compressed textures must be used for each
platform.
Source: http://www.adobe.com/devnet/flashruntimes/articles/introducing-compressed-textures.html
29. Adobe Texture Format
(ATF)
In order to target multiple platforms, various
textures must be prepared for each platform:
DXT for Windows and Mac OS
ETC1/DXT for Android
PVRTC for iOS
ATF can wrap all these formats into one file!
Source: http://www.adobe.com/devnet/flashruntimes/articles/introducing-compressed-textures.html
30. Adobe Texture Format
(ATF)
Available from FP 11.4/AIR 3.4 onwards
Links
http://www.adobe.com/devnet/flashruntimes/articl
es/introducing-compressed-textures.html
http://www.adobe.com/devnet/flashruntimes/articl
es/atf-users-guide.html