Stage3D (
codename
A code name, codename, call sign, or cryptonym is a code word or name used, sometimes clandestinely, to refer to another name, word, project, or person. Code names are often used for military purposes, or in espionage. They may also be used in ...
d ''Molehill''
) is an
Adobe Flash Player API
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
for rendering interactive
3D graphics
3D computer graphics, sometimes called CGI, 3D-CGI or three-dimensional computer graphics, are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for the purposes of perfor ...
with
GPU-acceleration, within Flash games and applications. Flash Player or
AIR applications written in
ActionScript 3
ActionScript is an object-oriented programming language originally developed by Macromedia Inc. (later acquired by Adobe). It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript (meani ...
may use Stage3D to render 3D graphics,
and such applications run natively on Windows, Mac OS X, Linux, Apple
iOS and Google
Android.
[Stage3D unsupported chipsets, drivers, Flash Player 11, AIR 3](_blank)
Adobe Help Stage3D is similar in purpose and design to
WebGL.
Stage3D was introduced in
Adobe Flash Player
Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is a discontinuedExcept in China, where it continues to be used, as well as Harman for enterprise users. computer program for viewing multimedia ...
11.0 and
AIR 3.0 in order to facilitate
GPU-acceleration of 3D content in Flash applications
In Flash Player 10 and earlier, 3D Flash applications had to render 3D graphics completely on the
CPU. Flash Player 10 supported a limited form of GPU acceleration support for materials, in an API called
Pixel Bender.
GPU
Shader
In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of s ...
s in Stage3D are expressed in the
Adobe Graphics Assembly Language (AGAL).
Stage3D objects depart from the traditional
SWF rendering model in that they cannot be added to SWF's
display lists; instead they must be instantiated via
ActionScript
ActionScript is an object-oriented programming language originally developed by Macromedia Inc. (later acquired by Adobe). It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript (mean ...
.
Because Stage3D is a low-level library that may be tedious to use directly, it has seen some higher-level 3D and 2D libraries built on top of it in order to benefit from the higher performance that it provides. An incomplete list of libraries and
game engines using it includes:
Unreal Engine 3,
Away3D
Away3D is an open-source platform for developing interactive 3D graphics for video games and applications, in Adobe Flash or HTML5. The platform consists of a 3D world editor (Away Builder), 4,
CopperCube,
Flare3D,
Starling,
ND2D or Adobe Labs' Proscenium.
Similarly, WebGL 3D applications may be built with
three.js, a higher-level library similar to these.
Away3D and Starling have been christened as official components of the Adobe Gaming SDK.
History
In 2011, Flash Player 11 was released, and with it the first version of Stage3D, allowing for GPU-accelerated 3D rendering for Flash applications and games, on desktop platforms such as Microsoft Windows and Mac OS X.
In March 2012, Flash Player 11.2 was released, which enabled Stage3D/GPU support on Android and iOS platforms. Games utilizing Stage3D APIs would work with no changes on these mobile platforms.
[Adobe Flash Roadmap](_blank)
Adobe
In June 2012, Flash Player 11.3 was released, enabling progressive streaming of Stage3D texture maps, allowing for faster performance and startup times for games and applications utilizing Stage3D.
In August 2012, Flash Player 11.4 was released, which raised the supported hardware-accelerated
video cards count to 2006, and allowed alpha-channels for Stage3D compressed textures.
In March 2012, Adobe announced that Stage3D will be part of the premium features of the Flash Player (stating with Flash Player version 11.2), and thus not available completely free of charge to developers, but based on a revenue sharing scheme.
[And Then Premium Features Arrived](_blank)
, ASV Guy Blog Various notable members of the Flash community objected to the change, referring to it as a "speed-tax".
In January 2013, Adobe classified all premium features as general availability, and could be freely used by Flash applications, without requiring a license or royalty from developers or publishers.
Flash Player Dev Center, Adobe
In September 2012, Flash Player 11.4 was released allowing games to target "constrained profiles" which included older graphics chips, that did not support all the features of Stage3D.
In April 2013, Flash Player 11.7 was released, which supported 16-bit texture maps for Stage3D content, which allowed reduced memory usage and improved memory management.
In July 2013, Flash Player 11.8 was released, which increased the maximum texture map size to 4096 x 4096, in addition to supporting rectangular (non-square) texture maps for Stage3D content. This allowed for greater detail in texture maps, and larger
texture atlases to be created enabling better performance.
As of 2014, GPU acceleration was removed in Flash Player 11.8 onwards for Pixel Bender scripts. Pixel Bender was an older technology for writing high-performance CPU-based image processing filters. This disrupted a number of less well-endowed projects, including MIT's
Scratch, which could not find the manpower to rapidly recode their applications.
Features
Stage3D consists of the following components:
*Unified API - Unified
ActionScript
ActionScript is an object-oriented programming language originally developed by Macromedia Inc. (later acquired by Adobe). It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript (mean ...
3 API for managing texture memory, vertex shading, pixel shading, and mesh rendering. Transparently executed using
OpenGL
OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
(on
Mac OS X
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
and
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
) and
DirectX
Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct" ...
(on
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
).
*Accelerated GPU Rendering - Integrated support for
graphic cards built by NVidia, AMD and Intel,
Blacklist for incompatible graphic cards.
*Accelerated CPU Rendering - Integrated software renderer fallback using
SwiftShader, for systems with missing/incompatible graphics cards.
*AGAL (Adobe Graphics Assembly Language) - A language for writing
Shader
In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of s ...
s (programs that run on the GPU) such that they can be converted to
OpenGL GLSL Shaders and
DirectX HLSL Shaders by Flash Player.
*ATF (Adobe Texture Format) - A
texture format such that textures can be converted to appropriate platform-specific texture formats such as
DXT on Windows and MacOS,
PVRTC on iOS.
Stage3D is supported by the following components:
*XC APIs - the "premium features" for Flash Player, consisting of high-speed memory manipulation opcodes (known as ''"Alchemy"'') and Stage3D APIs.
*
CrossBridge - A cross-compilation toolkit to compile OpenGL-based 3D games or game engines to run within Flash Player.
*
Adobe Scout - A visual profiler for Flash content running on desktop or mobile. Scout enables in-depth profiling of Stage3D content with the following integrated features:
[Getting started with Adobe Scout](_blank)
Adobe Developer Connection
**Stage3D Preview - View the current back-buffer of executed Stage3D Content
**Stage3D Recording - Capture every Stage3D command executed by the Flash content, and replay/step through executed commands
**GPU memory usage - Profile texture memory usage with a real-time breakdown
**Stage3D Program Editor - Interactively modify recorded Stage3D commands and see what effect this has on rendering. Edit the AGAL code for the vertex and fragment programs executed by each draw call.
AGAL
Adobe Graphics Assembly Language (AGAL) is an
assembly language
In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
for writing GPU
shader
In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of s ...
s.
[What is AGAL](_blank)
Adobe Developer Connection AGAL was invented by Adobe to provide a unified shader language for all platforms.
AGAL programs are written by hand with low-level
opcode
In computing, an opcode (abbreviated from operation code) is an enumerated value that specifies the operation to be performed. Opcodes are employed in hardware devices such as arithmetic logic units (ALUs), central processing units (CPUs), and ...
s and
registers.
AGAL programs are compiled into bytecode which is then embedded into Flash
SWF movies.
This AGAL bytecode is automatically
compiled into
OpenGL GLSL Shaders and
DirectX HLSL Shaders by
Adobe Flash Player
Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is a discontinuedExcept in China, where it continues to be used, as well as Harman for enterprise users. computer program for viewing multimedia ...
, depending on the platform.
With AGAL, developers can write shaders that transform 3D models on the GPU (
vertex shader), and shaders that render complex
dynamic lighting effects on the GPU (
pixel shader
In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of s ...
). AGAL also allows high-quality texture rendering with
mip-mapping. AGAL is used extensively in Flash
game engines such as
Away3D
Away3D is an open-source platform for developing interactive 3D graphics for video games and applications, in Adobe Flash or HTML5. The platform consists of a 3D world editor (Away Builder), and
Flare3D for various effects. AGAL is commonly used to provide
dynamic lighting,
high dynamic ranging (HDR),
alpha masking, multipass rendering,
displacement mapping, and
environment mapping.
[FLSL](_blank)
, Flare3D Wiki Flare3D extends AGAL with a proprietary Shader language called FLSL (FLare3D Shader Language), that makes writing Shader programs easier.
HLAG is another example of a high-level Shader language that compiles into AGAL.
When porting
C++ 3D video games for playback in
Adobe Flash Player
Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is a discontinuedExcept in China, where it continues to be used, as well as Harman for enterprise users. computer program for viewing multimedia ...
, developers must translate traditional HLSL and GLSL shaders into AGAL.
Crytek, Silent Hunter Online talks late additions to GDC Europe 2013
Gamasutra, ''"C++ console rendering engine into Adobe Flash using Actionscript/Stage3D and using AGAL for graphical effects such as ocean rendering"'' The C++ video game code can be converted into Flash-compatible code using CrossBridge.
See also
* Papervision3D
Papervision3D is an open-source, 3D graphics engine for rendering 3D content within Adobe Flash Player and Adobe AIR.
Unlike modern Flash 3D engines such as Away3D and Flare3D, Papervision3D is not built for Stage3D and renders 3D content fu ...
* WebGL
References
External links
*Stage3D articles on Adobe Developer Connection
**
**
**
**
**
**
**
**
**
**
**
**
* Translation tools from OpenGL
OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
and GLSL:
**
**
{{Adobe Flash
3D graphics APIs
Adobe Flash
Graphics libraries