Module APIs
Generated API reference for the standard BWSL modules.
Turn the guide into code
Take the key idea from this page into the playground and validate it in a real shader instead of leaving it as theory.
Open PlaygroundThese pages are generated from the module source files in the compiler repository. Modules are file-scope declarations and may live in module-only files or next to pipelines. Import a module with import Name, optionally alias it with import Name as Alias, then access exported members with Name::member or Alias::member. Use using Name only when an imported module should contribute functions and constants to unqualified lookup.
Math
Constants, safe math helpers, remapping, easing, waves, and scalar/vector utility functions.
Random
Hash-based random number generation and GPU-friendly random distributions.
Noise
Hash, value, gradient, Worley, cellular, and fractal noise helpers.
Color
Color-space conversion and tone-mapping helpers.
Compression
Intrinsic-backed vertex decompression helpers for packed positions, normals, UVs, and colors.
Debug
Debug colors, heatmaps, luminance, UV visualization, and bad-value highlighting.
Packing
Portable packing helpers for normalized colors, half floats, octahedral normals, RGBE, and RGBM.
PBR
Physically based rendering structs and BRDF helpers.
Globals
Shared engine-facing constants, enums, structs, and layout helpers.
PostFX
Post-processing helpers for gamma correction and tone mapping.
Sampling
Low-discrepancy sequences, disk/sphere/hemisphere sampling, and GGX sampling PDFs.
SDF
Signed-distance primitives, composition helpers, debug masks, and raymarching helpers.
Spaces
Coordinate-space transforms, projection helpers, depth reconstruction, and tangent bases.