
BWSL
A shader language for variant-heavy graphics code.
Write the pipeline once, express permutations as typed state, and compile clean specialized shaders for SPIR-V, GLSL, HLSL, and Metal.
Variants without shader sprawl
Declare the variant space once, use it like normal code, and let the compiler specialize the selected path. GPU Particles uses one pipeline to become a sphere, vortex, or helix without duplicating the shader.
Built for Modern Graphics
Shader work has outgrown simple text files. BWSL gives passes, resources, and variants a first-class language.
Tame Variant Sprawl
Declare axes once, branch normally, and let the compiler generate the exact shader paths.
Pipeline-First Design
Passes, targets, and render state live beside the shader code that uses them.
Type-Safe Bindings
Validate uniforms, structs, and resource layouts at compile time, not runtime.
Cross-Platform Output
Target SPIR-V, GLSL, HLSL, and Metal Shading Language from a single codebase.
Modern Ergonomics
Use modules, imports, and compile-time evaluation without sacrificing GPU-level control.
Rich Standard Library
Drop-in helpers for math, color, noise, PBR, and post-processing.
A Quick Tour
Start with variants, then layer in the language features that make them scale.
pipeline Particles {
enum ParticleShape {
Sphere
Vortex
Helix
}
variants {
shape: ParticleShape = ParticleShape::Sphere;
}
pass "MainPass" {
vertex {
float3 particlePos = spherePos;
if (variants.shape == ParticleShape::Vortex) {
particlePos = vortexPosition(...);
} else if (variants.shape == ParticleShape::Helix) {
particlePos = helixPosition(...);
}
}
}
}Production Ready. Open Source.
Built for the Real World
BWSL was built because modern rendering engines need more than isolated GLSL or HLSL strings. The language is designed from the ground up to understand pipelines, resources, and variants natively.
The compiler ships as a fast, native CLI for Windows, macOS, and Linux, alongside a WASM build that powers the browser playground.
Permissive License
Use BWSL anywhere: personal experiments, open-source engines, or commercial AAA titles. The Apache 2.0 license gives you the freedom and legal protection to build with confidence.
The compiler, standard library, and playground are entirely open source and available on GitHub.
- Commercial and private use
- Modification and distribution
- Express patent grant from contributors
- License and copyright notice required
- Changes must be documented
Start writing better shaders
Read the language guide or jump straight into the interactive browser playground.