Skip to content

Commit

Permalink
Fix bug in ptracer which would generate NaN rays
Browse files Browse the repository at this point in the history
  • Loading branch information
njroussel committed Nov 30, 2023
1 parent eba6c25 commit 3d902a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/integrators/ptracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ class ParticleTracerIntegrator final : public AdjointIntegrator<Float, Spectrum>

// Primary & further bounces illumination
auto [ray, throughput] = prepare_ray(scene, sensor, sampler);
trace_light_ray(ray, scene, sensor, sampler, throughput, block, sample_scale);

Float throughput_max = dr::max(unpolarized_spectrum(throughput));
Mask active = dr::neq(throughput_max, 0.f);

trace_light_ray(ray, scene, sensor, sampler, throughput, block,
sample_scale, active);
}

/**
Expand Down

0 comments on commit 3d902a4

Please sign in to comment.