RT→rgba16float→threshold→blur→composite, end-to-end proof of the three primitives. threshold/blur run from onBeforeUpdate (one submit each) so the storage-write→sampled-read dependency gets WebGPU's per-submit barrier (there is none between dispatches within a compute pass); the composite is a UI custom shader so it owns the canvas ping-pong. Documents the Vulkan symmetry (gap 4): the native present path records passes generically and barriers between them, so the same chain is wireable today. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 lines
364 B
WebGPU Shading Language
7 lines
364 B
WebGPU Shading Language
// HDRBloom miss (runs in SHADE). Dark, sub-threshold background so the
|
|
// bloom pass only picks up the bright cubes, not the sky.
|
|
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
|
|
let t = clamp(ray.direction.y * 0.5 + 0.5, 0.0, 1.0);
|
|
rtAccumulate(mix(vec3<f32>(0.015, 0.018, 0.030),
|
|
vec3<f32>(0.030, 0.040, 0.070), t));
|
|
}
|