Fix hopefully last nan for iridescent material
This commit is contained in:
parent
b1351747b7
commit
86d009fb4c
3 changed files with 84 additions and 64 deletions
|
|
@ -51,9 +51,13 @@ fn render_image<
|
|||
for _ in 0..samples_per_pixel {
|
||||
let r =
|
||||
renderer.render_pixel(scene, camera, x, y, &mut rng) / (samples_per_pixel as Float);
|
||||
c[0] += r.r();
|
||||
c[1] += r.g();
|
||||
c[2] += r.b();
|
||||
if r.r().is_nan() || r.g().is_nan() || r.b().is_nan() {
|
||||
eprintln!("NAN x: {:?}, y: {:?}, r: {:?}", x, y, r);
|
||||
} else {
|
||||
c[0] += r.r();
|
||||
c[1] += r.g();
|
||||
c[2] += r.b();
|
||||
}
|
||||
}
|
||||
});
|
||||
println!("Rendered \"{}\" in {:?}", name.as_ref(), start.elapsed());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue