// Payload declared here so the WGSL assembler sees it before the wfPayload // binding, the SHADE dispatch, and the raygen source. // // Wavefront model: closesthit_main runs in SHADE and accumulates the // pixel's color directly (rtAccumulate) instead of writing a payload that // raygen reads back. struct Payload { color: vec3, }; fn closesthit_main(ray: RayDesc, hit: HitInfo, payload: ptr) { let bary = vec3(1.0 - hit.attribs.x - hit.attribs.y, hit.attribs.x, hit.attribs.y); rtAccumulate(bary); }