Stage3D
{{Short description|API for rendering interactive 3D graphics}}
Stage3D (codenamed Molehill) is an Adobe Flash Player API for rendering interactive 3D graphics with GPU-acceleration, within Flash games and applications. Flash Player or AIR applications written in ActionScript 3 may use Stage3D to render 3D graphics, and such applications run natively on Windows, Mac OS X, Linux, Apple iOS and Google Android.[http://helpx.adobe.com/x-productkb/multi/stage3d-unsupported-chipsets-drivers-flash.html Stage3D unsupported chipsets, drivers, Flash Player 11, AIR 3], Adobe Help Stage3D is similar in purpose and design to WebGL.{{cite book|author=Matt Fisher|title=HTML5 for Flash Developers|url=https://books.google.com/books?id=O2DWzWRnQPwC&pg=PT165|year=2013|publisher=Packt Publishing Ltd|isbn=978-1-84969-333-2|at=§ Stage3D versus WebGL, p. 91}}
Stage3D was introduced in Adobe Flash Player 11.0 and AIR 3.0 in order to facilitate GPU-acceleration of 3D content in Flash applications{{cite book|author=Joseph Labrecque|title=What's New in Flash Player 11|url=https://books.google.com/books?id=UGD4zMFnK0QC&pg=PA17|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1110-0|page=17}}{{cite book|author=Joseph Labrecque|title=What's New in Adobe AIR 3|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1108-7|pages=17–26}} 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.{{cite book|editor=Eric Lengyel|title=Game Engine Gems 2|year=2011|publisher=CRC Press|isbn=978-1-56881-437-7|chapter=3D in a Web Browser|author=Remi Arnaud|pages=207–212}}
GPU Shaders in Stage3D are expressed in the Adobe Graphics Assembly Language (AGAL).{{rp|57}}{{cite web|url=https://www.adobe.com/devnet/flashplayer/articles/what-is-agal.html |title=What is AGAL {{pipe}} Adobe Developer Connection |publisher=Adobe.com |date=2011-10-10 |accessdate=2014-08-04}} 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.{{cite book|author=Christer Kaitila|title=Adobe Flash 11 Stage3D (Molehill) Game Programming Beginner's Guide|year=2011|publisher=Packt Publishing Ltd|isbn=978-1-84969-169-7}}{{rp|25}}
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,{{cite book|author=Wagner James Au|title=Game Design Secrets|year=2012|publisher=John Wiley & Sons|isbn=978-1-118-46391-8|page=130}}{{cite web|url=https://www.theverge.com/2011/10/7/2471974/epics-unreal-3-engine-coming-soon-to-adobe-flash-11|title=Adobe Flash 11 adopts Unreal Engine 3 for better browser games {{pipe}} The Verge|date=7 October 2011 |publisher=theverge.com|accessdate=2014-08-04}} Away3D 4, CopperCube,{{cite web|url=http://www.develop-online.net/business-spotlights/tools-spotlight-coppercube-4-0/0186964 |title=Tools Spotlight: CopperCube 4.0 |website=MCV |publisher=evelop-online.net |date=2014-05-28 |accessdate=2014-09-22}} Flare3D,{{cite book|author=Keith Gladstien|title=Flash Game Development In a Social, Mobile and 3D World|year=2013|publisher=Cengage Learning|isbn=978-1-4354-6021-8|pages=383–421}} Starling,{{cite book|author=Thibault Imbert|title=Introducing Starling|year=2012|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-2089-8}}{{rp|vii}} ND2D or Adobe Labs' Proscenium.{{cite book|author=Rex van der Spuy|title=Foundation Game Design with ActionScript 3.0|url=https://books.google.com/books?id=mR4LqMTCgPoC&pg=PA641|year=2012|publisher=Apress|isbn=978-1-4302-3993-2|page=641}} Similarly, WebGL 3D applications may be built with three.js, a higher-level library similar to these.{{cite web|url=http://www.airtightinteractive.com/2011/10/stage3d-vs-webgl-performance/ |title=Stage3D vs WebGL Performance — Airtight Interactive |publisher=Airtightinteractive.com |date=2011-10-28 |accessdate=2014-08-04}} Away3D and Starling have been christened as official components of the Adobe Gaming SDK.Thibault Imbert (December 4th, 2012) [http://www.bytearray.org/?p=4969 Introducing Game Developer Tools (Gaming SDK, Adobe Scout, FlasCC)]{{cite web|url=https://creative.adobe.com/products/gaming-sdk|title=Adobe Gaming SDK|publisher=creative.adobe.com|accessdate=2014-08-04}}
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.[http://www.adobe.com/devnet/flashplatform/whitepapers/roadmap.html Adobe Flash Roadmap], 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.[http://asvguy.com/2012/04/and-then-premium-features-arrived.html And Then Premium Features Arrived] {{webarchive|url=https://web.archive.org/web/20150205215645/http://asvguy.com/2012/04/and-then-premium-features-arrived.html |date=2015-02-05 }}, ASV Guy Blog[http://blogs.adobe.com/flashplayer/2012/07/premium-features-update.html Update: Premium Features for Flash Player], Adobe AIR and FP 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.[https://www.adobe.com/devnet/flashplayer/articles/premium-features.html Adobe Premium Features for Flash Player], 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.{{cite web|url=http://www.bytearray.org/?p=4516|title=Introducing Flash Player 11.4/AIR 3.4 beta!|last=Imbert|first=Thibault|publisher=ByteArray}}
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.{{cite web|url=http://wiki.scratch.mit.edu/wiki/Stage3D|accessdate=2014-08-05|title=Stage3D|publisher=scratch.mit.edu}}[https://bugbase.adobe.com/index.cfm?event=bug&id=3591185 Adobe Flash Player 11.8 - Bug 3591185: Pixel Bender shader performance drastically degraded in FP11.8. Closed as "NeverFix"] {{webarchive|url=https://web.archive.org/web/20140422031641/https://bugbase.adobe.com/index.cfm?event=bug&id=3591185 |date=2014-04-22 }}
Features
Stage3D consists of the following components:
- Unified API - Unified ActionScript 3 API for managing texture memory, vertex shading, pixel shading, and mesh rendering. Transparently executed using OpenGL (on Mac OS X and Linux) and DirectX (on Microsoft Windows).
- 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 Shaders (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.{{rp|47–48}}{{cite web|url=http://www.bytearray.org/?p=4472|title=Stage3D compressed textures – Introducing the ATF SDK - ByteArray.org|publisher=bytearray.org|accessdate=2014-08-04}}
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:[http://www.adobe.com/devnet/scout/articles/adobe-scout-getting-started.html Getting started with Adobe Scout], 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 for writing GPU shaders.[http://www.adobe.com/devnet/flashplayer/articles/what-is-agal.html What is AGAL], 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 opcodes 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, 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). AGAL also allows high-quality texture rendering with mip-mapping.[http://www.adobe.com/devnet/flashplayer/articles/mipmapping.html Mipmapping for smoother textures in Stage3D], Adobe Developer Connection AGAL is used extensively in Flash game engines such as Away3D 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.[http://schedule2013.gdceurope.com/session-id/825509 Session : Flash to the Max! High Performance 3D Graphics in Silent Hunter Online] {{Webarchive|url=https://web.archive.org/web/20210828080636/https://schedule2013.gdceurope.com/session-id/825509 |date=2021-08-28 }}, GDC Europe 2013[http://wiki.flare3d.com/index.php?title=FLSL_(Flare3D_Shader_Language) FLSL] {{Webarchive|url=https://web.archive.org/web/20230114133653/http://wiki.flare3d.com/index.php?title=FLSL_(Flare3D_Shader_Language) |date=2023-01-14 }}, 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.[http://www.jrmcv.co.uk/HLAG/ HLAG is currently in alpha] {{Webarchive|url=https://web.archive.org/web/20220702102853/http://www.jrmcv.co.uk/HLAG/ |date=2022-07-02 }}, HLAG Tool Website
When porting C++ 3D video games for playback in Adobe Flash Player, developers must translate traditional HLSL and GLSL shaders into AGAL.[https://web.archive.org/web/20130803174615/http://www.gamasutra.com/view/news/196773/Crytek_Silent_Hunter_Online_talks_late_additions_to_GDC_Europe_2013.php 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
References
{{reflist}}
External links
- Stage3D articles on Adobe Developer Connection
- {{cite web|url=https://www.adobe.com/devnet/flashplayer/stage3d.html|title=3D game development for Flash and video games|publisher=adobe.com|accessdate=2014-08-04}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/how-stage3d-works.html|title=How Stage3D works|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/flare3d-building-3d-game.html|title=Building a 3D Flash game with Flare3D and Stage3D|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/creating-games-away3d.html|title=Creating 3D games and apps with Away3D 4 and Stage 3D|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/what-is-agal.html|title=What is AGAL|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/mixamo-flare-stage3d.html|title=Adding 3D content to your Flash game fast and easy|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/introducing_Starling.html|title=Introducing the Starling 2D framework|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/vertex-fragment-shaders.html|title=Vertex and Fragment Shaders|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/flashplayer/articles/mipmapping.html|title=Mipmapping for smoother textures in Stage3D|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/games/gaming_engines.html|title=Stage 3D gaming engines|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/scout/articles/adobe-scout-getting-started.html|title=Getting started with Adobe Scout|publisher=adobe.com|accessdate=2014-09-17}}
- {{cite web|url=http://www.adobe.com/devnet/games/articles/compiling-opengl-games.html|title=Compiling OpenGL games with the Flash C++ Compiler (FlasCC)|publisher=adobe.com|accessdate=2014-09-17}}
- Translation tools from OpenGL and GLSL:
- {{cite web|url=https://github.com/adobe/GLS3D|title=adobe/GLS3D · GitHub|publisher=github.com|accessdate=2014-08-04}}
- {{cite web|url=https://github.com/adobe/glsl2agal|title=adobe/glsl2agal · GitHub|publisher=github.com|accessdate=2014-08-04}}
{{Adobe Flash}}