Skip to content

Commit

Permalink
clamp final color.
Browse files Browse the repository at this point in the history
  • Loading branch information
kugimasa committed Aug 23, 2023
1 parent 0132479 commit 3063cb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resources/shader/compute-sample.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ fn compute_sample(@builtin(global_invocation_id) invocation_id: vec3<u32>) {
}
col += max(path.col, kZero) / f32(kSPP);
}
col = saturate(col);
textureStore(frameBuffer, invocation_id.xy, vec4f(col, 1.0));
let r = clamp(col.r, 0.0, 1.0);
let g = clamp(col.g, 0.0, 1.0);
let b = clamp(col.b, 0.0, 1.0);
textureStore(frameBuffer, invocation_id.xy, vec4f(r, g, b, 1.0));
}
}

0 comments on commit 3063cb2

Please sign in to comment.