Bringing OpenGL C/C++ code to the web with FlasCC

Stage3D allows GPU accelerated 3D content to run in the Flash Player accross operating systems and browsers. We have a number of interesting libraries that will help you bring your OpenGL C/C++ code to the web with FlasCC.

GLS3D

The GLS3D library is an open source project we started to provide a basic OpenGL implementation for FlasCC users targeting Stage3D.

Source Code: https://github.com/adobe/gls3d
Live Demo: http://cmodule.org/neverball

FreeGLUT

The GLUT library was created to make it easier to write cross-platform OpenGL based apps. I’ve implemented a Stage3D backend for the FreeGLUT library and used it in conjunction with the GLS3D project to compile some of the popular NeHe OpenGL tutorials.

Source Code: https://github.com/alexmac/alcfreeglut
Live Demo: http://www.cmodule.org/nehe/

GLSL To AGAL

If you’ve investigated the Stage3D API you’ll know that the shader format is a custom bytecode format designed to be easily compiled down to DirectX bytecode or GLSL depending on the platform the Flash Player is running on. Sadly this makes it hard for humans to write. This project is based on the open-source Mesa codebase and contains a full GLSL parser and optimizer hooked up to a custom AGAL backend so that GLSL shaders can be compiled and optimized down to AGAL bytecode. It can be used offline as a pre-processing step within your applications asset creation workflow or at runtime by compiling the library to a SWC with FlasCC and using it in your SWF.

The repository also includes a precompiled SWC so that you can get started with it immediately.

Source Code: https://github.com/adobe/glsl2agal
Live Demo: http://adobe.github.com/glsl2agal/

Starling Filter Playground

Starling 1.2 supports AGAL based filters that can be applied to any Sprite to alter the way they render. Rather than writing the filter by hand with AGAL asm its possible to hook up the GLSL2AGAL project to Starling so that these Filters can be written using GLSL. Modifying the shader in the UI causes the filter to update in realtime.

Source Code: https://github.com/alexmac/StarlingFilterPlayground
Live Demo: http://alexmac.github.com/StarlingFilterPlayground/