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
293 B
WebGPU Shading Language
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);
|
|
}
|