2026-07-22 18:09:06 +02:00
|
|
|
//SPDX-License-Identifier: MIT
|
|
|
|
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
|
|
|
|
|
2026-06-09 22:45:33 +00:00
|
|
|
// RTMultiShadow RESOLVE-stage tonemap: Reinhard + gamma 2.2 over the
|
|
|
|
|
// linear accumulator. Registered as a WebGPURTStage::Resolve shader.
|
|
|
|
|
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);
|
|
|
|
|
}
|