Notes - Darshan Rane

useumpireSoftware and s/w Development

Dec 2, 2013 (4 years and 7 months ago)



Starling is a pure Actionscript 3 Game Engine for Flash which can take
advantage of Flash 11's GPU accelerated
Stage3D graphics
. Important point is its Open Source & Free, Platform independent & Adobe is supporting its

Stage 3D, previously codenamed "Molehill," is a new method/model of 2D and 3D rendering developed by Adobe
and supported with a new Stage3D API

a set of low
level GPU
accelerated APIs enabling advanced 2D and 3D
capabilities across multiple screens and dev
ices (desktop, mobile, and TV) through the runtimes.
More details on
Stage 3D

Adobe Flash

11 Stage 3D (Molehill) Game Programming Guide

Adobe Flash Platform Blog Entries for Stage 3D

Flash 3D Concept

Previously, Flash 3D rendering was performed without using 3D hardware acceler
ation. In fact, all 3D rendering in
Flash Player before version 11 was accomplished using the software mode that relied on the CPU for rendering.
Software mode is slow and cannot be used to render detailed 3D scenes.

With the release of Flash Player 11, n
ew opportunities are now available. Developers can leverage 3D hardware
acceleration rather than relying on the computer’s CPU to do the rendering. The new mode of rendering enables
Flash 3D content to be handled by a secondary processor, part of the video

hardware of a computer, called the
Graphics Processing Unit (GPU). GPU is a piece of hardware that is totally dedicated to rendering objects in 3D.

Working with 3D hardware acceleration


3D scene is defined as a group of 3D geometries (meshes). Each
geometry is specified as a set of triangles, and
each triangle, in turn, is comprised of a set of vertices. So, defining a 3D scene simply means to define a set of
vertices, and eventually add some related rendering information

such as textures or vertex c

When you worked with the older software mode, a 3D engine such as Away3D would receive this stream of
vertices. It would calculate the screen positions of the triangles and then prompt Flash Player to natively render
those triangles one by one, thro
ugh a series of "fill" draw operations.

This process, although smartly coded within the engine, was extremely slow. In some cases the rendering result
wasn't particularly accurate. The content was rendered per triangle, instead of per pixel. This caused de
pth sorting
errors. Triangles would sometimes render out of place, at the wrong depth.

Now consider the possibilities with Stage3D. Using 3D hardware acceleration, the software simply defines the
geometries and then passes them on to the computer's GPU. Th
e geometries are uploaded to the GPU memory,
which is a piece of memory that sits on the video hardware that is dedicated for use by the GPU. The GPU receives
the data and processes it, completely taking over the job of rendering the 3D content.

The softwa
re works much more efficiently because it is only required to pass the parameters needed for rendering
to the GPU. For example, the software specifies where the eye point (the 3D camera) is located in the 3D scene,
sets the location of lights in the scene,

and other details about the 3D objects and effects in the scene.

The GPU receives all this data. It starts by analyzing the defined vertices and begins rendering the scene triangle
by triangle. The GPU produces the final rendered image that is ready for d
isplay on the screen.

The GPU rendering process is much faster than software mode. The GPU is designed to focus on a very specific
task: it simply calculates the vertices and renders triangles. That's it.

Since the hardware of the GPU is extremely speciali
zed for this very specific task, the hardware accelerated 3D
rendering process is extremely efficient.

In contrast, the CPU is a generic processor. It not optimized for the specific task of rendering triangles. As a result,
it is much less efficient at the

rendering operation, as you may have experienced when rendering Flash 3D content
using software mode.