Skip to content

Commit

Permalink
Replace NaN with 0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kugimasa committed Aug 23, 2023
1 parent 3063cb2 commit 538c5d6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resources/shader/compute-sample.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ fn compute_sample(@builtin(global_invocation_id) invocation_id: vec3<u32>) {
}
col += max(path.col, kZero) / f32(kSPP);
}
// NaNを0.0に変更する
if (col.r != col.r) {
col.r = 0.0;
}
if (col.g != col.g) {
col.g = 0.0;
}
if (col.b != col.b) {
col.b = 0.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);
Expand Down

0 comments on commit 538c5d6

Please sign in to comment.