Crafter.Graphics/examples/RTVolume/miss.wgsl

7 lines
341 B
WebGPU Shading Language
Raw Normal View History

// RTVolume miss (runs in SHADE). Vertical sky gradient — also what shows
// through the any-hit cut-out cells.
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.05, 0.07, 0.12),
vec3<f32>(0.45, 0.60, 0.85), t));
}