Files
horizon-airdef/crates/horizon-shader-api/tests/samples/schema-1/post/grade.wgsl
T
Ludovic Marie 98c8db50a3 Horizon shader packs: horizon-shaders.toml (schema 1) and the .hshader package
A new crate, horizon-shader-api, reads and checks Horizon's own WGSL shader
packs (docs/api/shaders.md), so the game, the launcher and the registry judge
a pack the same way. This first part is the format: the manifest (id, name,
version, the api line, shared files, the sky, material and post stages,
options typed for WGSL override constants, a GPU time budget) and the package
(a folder or a .hshader zip, built reproducibly so its SHA-256 depends only on
its files). The stages' WGSL is checked in the next parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:18:03 +01:00

9 lines
293 B
WebGPU Shading Language

override saturation: f32 = 1.1;
override tonemap: u32 = 1u;
fn post(input: PostInput) -> vec4<f32> {
let c = input.color.rgb;
let graded = mix(vec3<f32>(luminance(c)), c, saturation);
return vec4<f32>(select(graded, graded / (graded + 0.5) * 1.5, tonemap > 0u), input.color.a);
}