2026-05-31 20:16:04 +00:00
|
|
|
// Sponza miss (runs in SHADE). Primary miss → two-stop sky gradient.
|
|
|
|
|
// Shadow miss → the sun is unoccluded, so add the pending direct term.
|
2026-05-19 00:27:09 +02:00
|
|
|
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
|
|
|
|
|
if ((*payload).shadowRay == 1u) {
|
2026-05-31 20:16:04 +00:00
|
|
|
rtAccumulate((*payload).color);
|
2026-05-19 00:27:09 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let t = clamp(ray.direction.y * 0.5 + 0.5, 0.0, 1.0);
|
|
|
|
|
let sky = vec3<f32>(0.45, 0.65, 0.95);
|
|
|
|
|
let zenith = vec3<f32>(0.95, 0.85, 0.65);
|
2026-05-31 20:16:04 +00:00
|
|
|
rtAccumulate(mix(sky, zenith, t));
|
2026-05-19 00:27:09 +02:00
|
|
|
}
|