docs(webgpu-rt): add RTVolume example (procedural spheres + any-hit cut-out)
A 3x3x3 grid of AABB-geometry spheres rendered through an analytic ray-sphere intersection shader, with an any-hit spherical-checkerboard cut-out so the background shows through. Exercises both features end to end on the WebGPU wavefront tracer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
1628e1a58c
commit
5dd1086f08
10 changed files with 420 additions and 1 deletions
7
examples/RTVolume/resolve.wgsl
Normal file
7
examples/RTVolume/resolve.wgsl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// RTVolume RESOLVE-stage tonemap: Reinhard + gamma 2.2 over the linear
|
||||
// accumulator.
|
||||
fn resolve_main(coord: vec2<u32>, hdr: vec4<f32>) -> vec4<f32> {
|
||||
let mapped = hdr.rgb / (hdr.rgb + vec3<f32>(1.0));
|
||||
let g = pow(mapped, vec3<f32>(1.0 / 2.2));
|
||||
return vec4<f32>(g, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue