Flash 11 introduced Stage3D, a low-level hardware-accelerated graphics API that powered high-fidelity 3D games using Adobe Graphics Assembly Language (AGAL) shaders. Migrating Stage3D frameworks (Away3D, Starling, Alternativa3D) to modern WebGL 2.0 requires mapping assembly registers directly to GLSL vertex and fragment shaders.
1. AGAL vs GLSL Register Mapping
| AGAL Register | GLSL Equivalent | Description & Pipeline Purpose |
|---|---|---|
va0 - va7 | in vec4 aPosition | Vertex Attribute registers fed from Vertex Buffers (position, UVs, normals). |
vc0 - vc127 | uniform mat4 uMVPMatrix | Vertex Constant registers holding model-view-projection matrices and light data. |
v0 - v7 | out vec2 vTexCoord / in vec2 | Varying registers interpolated across the rasterizer from vertex to fragment stage. |
fc0 - fc27 | uniform vec4 uColorMultiplier | Fragment Constant registers holding material colors and alpha thresholds. |
fs0 - fs7 | uniform sampler2D uTexture | Fragment Samplers binding 2D texture maps, mipmaps, and cube maps. |
oc | fragColor = vec4(...) | Output Color register defining final pixel color written to the frame buffer. |
