98c8db50a3
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>
9 lines
287 B
WebGPU Shading Language
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);
|
|
}
|