First of all, a “NOT-BIG-NEWS” warning. This is basic Stage3D stuff, but again, as part of my Minimole project intended only to experiment with Stage3D and understand how the big 3D engines out there work, this could help others understand Stage3D as it helps me.
Two things currently happening in Minimole: 1) being a bit fed up with how slowly Adobe advances Pixel Bender 3D, I decided that my dream of never having to deal with the difficult AGAL was not being realistic, so I started developing basic materials with AGAL. PixelBender3D materials are still there, each material will have corresponding PB3D/AGAL versions, so it could be a good resource for comparing them. For example, the phong shader I just committed to minimole looks like this:
Yeah. AGAL is mean. This doesn’t even combine shader bits as engines like Away3D do, but its a start in understanding AGAL. I intend to keep practicing the language and produce more “hardcoded” materials in Minimole, so stay tuned with the project to see more examples.
A note about this particular shader: In the PB3D equivalent of this shader, I was calculating direction to light and direction to camera in the fragment shader. This one performs such calculations in the vertex shader and interpolates them in the fragment shader, which appears to produce better visual results, appart from performing better of course.
2) Something I observe with Away3D is that it’s powerful material system is so complex, that it’s not easy to step in and write some custom shading. Having been playing with Cinder lately, I’m in love with how easy you can write a GLSL shader and inject it into a mesh. I wish I could do the same with Flash. So minimole will be starting to take this direction, that is, expose the Stage3D API in a more “creative coding” way instead of a “full rendering engine” way. My goal is to be able to use Minimole in a way that you can easily experiment with shaders in Flash. Cause shaders rule!
Given the unfriendliness of AGAL, the path will be hard. I doubt that I will be able to produce things like Haxe’s HXSL or Flare3D’s FLSL in the short term, but I will start by focusing on making this stuff simpler. The current state of Minimole fulfills this task a bit. You can easily create new AGAL materials and start getting acquainted with AGAL without having to worry much about the camera projection matrix, geometry, etc and directly focus on intermediate AGAL shaders.
If anyone has ideas on this “make custom shader development in Flash easier” proposal, please feel free to comment. I’m open to ideas.
Stay tuned for more news…


Awesome. Thanks for sharing. Minimole is small and greate. I think that minimole is great start for developing new powerful engine.
Great! Totally agree with you. We need tools for experimenting with shaders in Stage3D. With a reference to making music, AGAL reminds me of when you get stuck setting up the sampler instead of just get the groove going. Keep sharing and I’ll be cheering!
Hi Li – NICE! I’m at exactly the same point in wanting access at the shader level. I’ve searched everywhere trying to figure out what Adobe based AGAL on. The closest thing I have found to it is the OpenGL ARB assembly code, but I still haven’t found any decent examples saying “here’s the string for a fresnel shader” for example. If you have any links to resources that led you to build that phong shader, I’d really appreciate a heads up on where to look.
Hey Choons,
Well, this is what I collected from the google search I did at the time:
http://iflash3d.com/shaders/my-name-is-agal-i-come-from-adobe-1/
http://iflash3d.com/shaders/my-name-is-agal-i-come-from-adobe-2/
http://www.saltgames.com/2011/agal-registers/
http://www.adobe.com/devnet/flashplayer/articles/what-is-agal.html
AGALtheMEaN is progressing nicely, ping me if you want to be it’s first beta tester =D