Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Haxe Game Development
  3. HGSL

HGSL

MITHaxe

A Haxe-based shading language that compiles to GLSL ES 3.0 with IDE support, modularity, and modern language features.

GitHubGitHub
158 stars2 forks0 contributors

What is HGSL?

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.

Target Audience

Graphics programmers and developers working with WebGL 2.0 who want a more robust and toolable shader development experience than raw GLSL provides.

Value Proposition

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.

Overview

A shading language that can be compiled into GLSL ES 3.0

Use Cases

Best For

  • Writing complex shaders with IDE autocompletion and type checking
  • Creating modular and reusable shader libraries
  • Developing WebGL 2.0 applications with maintainable shader code
  • Implementing shader inheritance and polymorphism
  • Using higher-order functions and closures in shaders
  • Generating GLSL source code from a more expressive language

Not Ideal For

  • Projects not already using or willing to adopt the Haxe ecosystem
  • Teams needing to write simple, one-off shaders without the overhead of learning a new language and tooling
  • Environments where shader code must be hand-edited or integrated with non-Haxe build systems
  • Shader designs that rely heavily on recursive functions or complex circular dependencies

Pros & Cons

Pros

Strong IDE Integration

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.

Modern Language Features

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.

Compile-Time Compilation

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.

Rich Type System

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.

Cons

Haxe Tooling Issues

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.

Language Limitations

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.

Operator Precedence Pitfalls

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.

Frequently Asked Questions

Quick Stats

Stars158
Forks2
Contributors0
Open Issues4
Last commit2 years ago
CreatedSince 2022

Tags

#haxe#shader-compiler#type-safe#glsl#webgl#webgl2#graphics-programming#compile-time

Built With

H
Haxe

Included in

Haxe Game Development413
Auto-fetched 18 hours ago

Related Projects

parasolparasol

HaxeFlixel Shaders and Supporting Utilities

Stars23
Forks2
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub