A Haxe-based shading language that compiles to GLSL ES 3.0 with IDE support, modularity, and modern language features.
HGSL is a shading language that compiles to GLSL ES 3.0, designed for writing shaders with full IDE support and modern language features. It allows developers to use Haxe's tooling for completions and type checks while extending GLSL with capabilities like modularization, inheritance, and implicit type conversions.
Graphics programmers and developers working with WebGL 2.0 who want a more robust and toolable shader development experience than raw GLSL provides.
HGSL offers a significantly improved developer experience over writing raw GLSL by providing IDE integration, type safety, and modern language constructs, all while outputting standard-compliant GLSL ES 3.0 code.
A shading language that can be compiled into GLSL ES 3.0
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides full autocompletion and type checking within editors like VSCode via Haxe's language server, as demonstrated in the setup and examples for error-free shader writing.
Extends GLSL with implicit type conversions, modular shader modules, inheritance, and higher-order functions, enabling more expressive and reusable code, detailed in sections on modules and overload.
Processes everything at compile time to generate clean GLSL ES 3.0 source code, allowing for early error detection and seamless integration into Haxe projects, as mentioned in the compilation approach.
Supports complex types like named and anonymous structures, arrays with compile-time sizes, and function overloading, enhancing code safety and organization, as explained in the structures and arrays sections.
Relies on Haxe's buggy macro system, which can cause stack overflows, completion failures, and requires workarounds like adding whitespace for completions to work, as admitted in the known issues.
Prohibits recursive function calls and struggles with mutual references between shaders, leading to compile errors and limiting advanced shader patterns, as outlined in the limitations section.
Due to Haxe's operator precedence, compile-time constants with bitwise operators may yield unexpected values unless parentheses are explicitly used, creating a subtle source of bugs, as warned in the operator precedence note.