Files
horizon-airdef/crates/horizon-shader-api/tests/samples/schema-1/post/vignette.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
287 B
WebGPU Shading Language

override vignette: bool = true;
override samples: i32 = 4;
fn post(input: PostInput) -> vec4<f32> {
let d = distance(input.uv, vec2<f32>(0.5));
let dark = select(1.0, 1.0 - smoothstep(0.4, 0.9, d) * 0.5, vignette);
return vec4<f32>(input.color.rgb * dark, input.color.a);
}