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.
EasyAGAL
by David Barlia, [email protected]
---------------------------------
Download: http://github.com/Barliesque/EasyAGAL
Online documentation: http://barliesque.com/easy_agal/docs/
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 _________________________________________________________________________________________
14.Jan.2014
- Corrected parameters passed to kil/killFragment() (Thanks b005t3r for reporting)
31.Aug.2012
- Rewrote Trig.atan2() which had a bug (thanks @nshen for reporting)
- Added public access to property "code" which is useful for comments
4.June.2012
- Updated AGALMiniAssembler.as
- Removed macro placeholders for seq & sne which are now supported
- Updated swc & docs
18.May.2012
- 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 TextureFlag.as
25.Feb.2012
- New example: a shader that renders lighting
- Corrected an embarassing number of mistakes in the docs for Blend.as
- Added checks to Blend.as where use of the same register for dest and either base or blend color fowls up the calculation
17.Feb.2012
- Updated SWC library
- Updated Docs with additions to Trig.as
- Fixed error in Trig.as
- Removed unused parameter "one" from ColorSpace::rgb2hsl()
16.Feb.2012
- Completed Trig.as macro library
11.Feb.2012
- Added new macro class -- Trig -- to contain macros for missing trigonometric functions
- Improved documentation, particularly in IRegister
4.Feb.2012
- 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 Component.as, register type was not passed on to component
3.Dec.2011
- Updated AGALMiniAssembler.as to official branch with support for rgba accessors
- Minor corrections in docs
11.Nov.2011
- Compiled ASDocs now included
- Updates to all ASDoc tags. Lots of additions, some minor corrections.
25.Oct.2011
- 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.
23.Oct.2011
- Modified AGALMiniAssembler.as to fix mishandling of RGBA component accessors
- Removed workaround from EasyBase.as
16.Oct.2011
- 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.
15.Oct.2011
- Added RegisterType and support for obtaining types of registers from macros.
- Added two more blend modes to macro library Blend.as: lighterColor & darkerColor
- Replaced nextRegister.as which mysteriously disappeared!
4.Oct.2011
- 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
3.Oct.2011
- Updated AGALMiniAssembler.as to current version!!!
- Removed verboseDebug as it is no longer an option in AGALMiniAssembler
2.Oct.2011
- 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()