Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Game Engine Development
  3. CrossShader

CrossShader

MITC++

A cross-compiler for shader languages, converting between SPIR-V, GLSL, HLSL, and Metal Shader Language.

Visit WebsiteGitHubGitHub
309 stars13 forks0 contributors

What is CrossShader?

CrossShader is a cross-compiler for shader languages that enables developers to convert shader code between SPIR-V, GLSL, HLSL, and Metal Shader Language. It solves the problem of maintaining multiple shader versions for different graphics APIs and platforms by providing a unified transpilation tool.

Target Audience

Graphics programmers, game developers, and engine developers who need to target multiple rendering backends (e.g., Vulkan, DirectX, OpenGL, Metal) from a single shader codebase.

Value Proposition

Developers choose CrossShader because it wraps several low-level compiler tools into a simple, consistent API, reducing the complexity of shader cross-compilation and saving time when porting graphics applications across platforms.

Overview

⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.

Use Cases

Best For

  • Porting OpenGL shaders to Vulkan via SPIR-V
  • Converting HLSL shaders for use in Metal on macOS/iOS
  • Downgrading GLSL shaders for older GPU compatibility
  • Building graphics engines that support multiple rendering APIs
  • Automating shader pipeline conversions in build systems
  • Developing cross-platform games with a single shader source

Not Ideal For

  • Projects requiring direct, low-level control over compiler-specific features and optimizations
  • Applications targeting only a single graphics API where cross-compilation is unnecessary
  • Real-time shader compilation in performance-critical loops where abstraction overhead matters
  • Environments without WebAssembly support or with strict native compilation requirements

Pros & Cons

Pros

Multi-Language Support

Converts between SPIR-V, GLSL, HLSL, and Metal Shader Language by wrapping established compilers like DirectX Shader Compiler and glslang, eliminating the need to manage multiple tools separately.

Unified API

Exposes a single `compile` function with simple configuration structs, abstracting the complexity of underlying compilers and making shader transpilation straightforward.

Cross-Platform Availability

Available as both a Node.js module (using WebAssembly) and a C++ library, catering to web and native development environments, as shown in the installation examples.

Version Targeting

Allows compiling to specific language versions, such as downgrading GLSL from 450 to 100 for older GPU compatibility, demonstrated in the usage code snippets.

Cons

Complex C++ Setup

Requires CMake and managing git submodules, which can be cumbersome and error-prone compared to simpler dependency management, as highlighted in the installation instructions.

Dependency on External Compilers

Relies on tools like DirectX Shader Compiler and glslang, so bugs or updates in these compilers might not be immediately reflected, potentially causing compatibility issues.

WebAssembly Limitations

The Node.js version depends on WebAssembly, which may not be supported in all environments and adds abstraction that could affect performance or portability.

Frequently Asked Questions

Quick Stats

Stars309
Forks13
Contributors0
Open Issues5
Last commit3 years ago
CreatedSince 2018

Tags

#vulkan#compiler#webassembly#opengl#transpiler#metal#directx#shader-compiler#game-development#glsl#webgl#hlsl#cross-platform#graphics-programming#gpu-programming#spir-v

Built With

E
Emscripten
W
WebAssembly
N
Node.js
C
CMake
C
C++

Links & Resources

Website

Included in

Game Engine Development1.3k
Auto-fetched 1 day ago

Related Projects

SHADERedSHADERed

Lightweight, cross-platform & full-featured shader IDE

Stars4,801
Forks316
Last commit3 years ago
Shader ParkShader Park

A JavaScript library for creating real-time 2D and 3D shaders. JS -> Shader. https://shaderpark.com/ https://twitter.com/shaderpark

Stars824
Forks29
Last commit1 day ago
WebGL NoiseWebGL Noise

GLSL procedural noise functions compatible with WebGL

Stars592
Forks38
Last commit1 year ago
PsrdnoisePsrdnoise

Tiling simplex flow noise in 2-D and 3-D compatible with GLSL 1.20 (WebGL 1.0) and above.

Stars327
Forks17
Last commit3 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