Skip to content


Subversion checkout URL

You can clone with
Download ZIP
EasyAGAL is an open source ActionScript library that simplifies coding assembly language shaders. Advantages include: Code completion and hinting, easier-to-read code, macro libraries -- including trigonometry functions like atan2(), color blending formulas from Photoshop, and more -- ready to use in your own shaders.
HTML ActionScript JavaScript CSS
Branch: master


by David Barlia,
Online documentation:

EasyAGAL is an open source ActionScript library that assists developers in writing 
AGAL ("Adobe Graphics Assembly Language") by providing an AS3-based 
pseudo-AGAL command set.  The resulting advantages include: 
	* Code completion and hinting
	* More easy-to-read code
	* Macros organized into libraries
	* Dynamic code customization
EasyAGAL provides training wheels to learning AGAL as well as a structural 
foundation for writing shaders for use with any other library. All methods 
of EasyAGAL maintain the same parameters, in the same order, as AGAL opcodes; 
They are all documented with ASDoc tags providing help for every instruction and 
register as you type, including the original AGAL opcodes.

CHANGE LOG _________________________________________________________________________________________

- Corrected parameters passed to kil/killFragment() (Thanks b005t3r for reporting)

- Rewrote Trig.atan2() which had a bug (thanks @nshen for reporting) 
- Added public access to property "code" which is useful for comments

- Updated
- Removed macro placeholders for seq & sne which are now supported
- Updated swc & docs

- Fixed atan() formula which was incorrect for input values less than 0 (thanks @makc for reporting)
- New alias management functions!   assign()  & unassign()
- Added .xy as a standard component selection
- Removed unsupported flags from

- New example:  a shader that renders lighting
- Corrected an embarassing number of mistakes in the docs for
- Added checks to where use of the same register for dest and either base or blend color fowls up the calculation

- Updated SWC library
- Updated Docs with additions to
- Fixed error in
- Removed unused parameter "one" from ColorSpace::rgb2hsl()

- Completed macro library

- Added new macro class -- Trig -- to contain macros for missing trigonometric functions
- Improved documentation, particularly in IRegister

- Compiled library to a SWC
- Added BlendHSL macros including: hue, saturation, luminosity and color blend functions
- Added ColorSpace macros, featuring conversion between RGB & HSL, desaturate, colorize, etc.
- Added new functions to RegisterType:  isConst(),  isTemp() , isReadOnly()
- Corrected an error in, register type was not passed on to component

- Updated to official branch with support for rgba accessors
- Minor corrections in docs

- Compiled ASDocs now included
- Updates to all ASDoc tags.  Lots of additions, some minor corrections.

- Added new "formatAS3" option to getVertexOpcode() and getFragmentOpcode()
	- Using this option, you can trace the opcode generated by EasyAGAL formatted as AS3 code.
	- Comment out your EasyAGAL shader code and replace, for a slight optimization.
	- Uncomment the EasyAGAL code to continue work.
	- Obviously this is not applicable to dynamically customized shader code.

- Modified to fix mishandling of RGBA component accessors
- Removed workaround from

- Changed register variables to static, so that only one set is needed for the entire project
- EasyBase.init() now does not get called if it's not needed.  If all shaders in a project use 
	setVertexOpcode() and setFragmentOpcode() in the constructor, none of EasyAGAL's
	registers need to be used, conserving memory.
- Added RegisterType and support for obtaining types of registers from macros.
- Added two more blend modes to macro library lighterColor & darkerColor
- Replaced which mysteriously disappeared!

- Replaced Blend.softLight() with a formula that is a perfect match with Photoshop and is *far* more efficient
- setFragmentOpcode() and setVertexOpcode() now allow appending.  Instruction counting still not added.
- Retested all blend modes.  Minor updates to avoid possible "two constant parameters" error.
- Removed unsupported facility to select components of a SAMPLER register
- Fixed bugs in Blend.softLight() and Blend.hardLight() macros

- Updated to current version!!!
- Removed verboseDebug as it is no longer an option in AGALMiniAssembler

- added CONST_byIndex
- opcode and instruction count are available now before calling upload()
- shader upload errors now trigger a dump of the shader code with line numbers
- separated debug options in EasyBase constructor
- added interface IComponent to differentiate single components
- new macro Utils.selectByIndex()
Something went wrong with that request. Please try again.