HLAG is currently in alpha|
HLAG is a high level shader language that compiles to AGAL code for use in Adobe Flash or Adobe AIR projects.
screenshot 1 screenshot 2
HLAG has a built in source editor with a real time preview window for testing compiled code. It exports shader code as XML containing AGAL instructions amongst other information (input source / output XML). It supports multiple passes and permutations as well as 3D,2D and post process shader types.
This is currently an early alpha version with some incomplete UI features such as a scroll bar (although you can use the mouse wheel to scroll the source until the scrollbar is fixed). The scroll bar will be fixed in the next release but the other features including preview and export should be working correctly.
Use the AGALMiniAssembler to compile the instructions in the XML output to a ByteArray for use in Stage3D.
(version 126.96.36.199 alpha, size 23 MB) windows only for the moment but no installation necessary (for test releases)
- Stack and operator precedence for equations using temporary registers to mimic the stack.
- Constant substitution for hard coded float values.
- Dynamic temporary register allocation: assigning temporary registers to variables based on that variables usage scope allowing multiple variables to share the same register depending on when they are used. Inlined functions benefit from this feature.
- Optimization of AGAL: removes redundant instructions and local variable declarations.
- Inlined functions: inline functions in current or external sources within equations.
- Import external sources: use '#include' to import external source files.
- Global and Local parameters to seperate material and object instance parameters.
- Multiple passes: use '#pass X' to define different passes for a source (where X is the pass index - max 8 passes).
- Preprocessor permutations: compile multiple permutations of a shader in to one effect XML file using preprocessor definitions.
- Integrated preview with parameter input tools.
- CPU AGAL (part implemented): AGAL instructions that can be executed on the CPU are exported in a different code block that can be used with the upcoming CPU AGAL interpreter for Flash/AIR.
- F2 in the source editor will bring up the color picker which will insert the normalized float3 color values in to the source.
- F3 in the source editor when 3 comma seperated numbers are selected will normalize the values in place.
- XML output was malformed but now fixed.
- Scrollbar for source window (use the mouse wheel to scroll for now)
- CPU AGAL: AGAL specifies that calculations that can be precalculated should be so CPU AGAL is for AGAL execution of instructions that can be performed on the CPU side. At the moment this is disabled as it is incomplete but will be included in the next release. The XML output will still export CPU AGAL instructions. This library for CPU AGAL will be provided with the compiler for use in projects much like the AGALMiniAssembler.
- Bug tracker
- Documentation (F1 on a keyword will bring up some information but full documentation will be provided soon including documentation for the XML output)
- Auto complete code option
- Cube map support for the preview window
- SWC for embedding the compiler in projects