From 1eeceb28e9990c86ef28880c652fc7b64e0424ed Mon Sep 17 00:00:00 2001 From: Nicolas Roussel Date: Fri, 6 Oct 2023 15:57:14 +0200 Subject: [PATCH] Minor formatting/readability changes to `prbvolpath` --- src/python/python/ad/integrators/prbvolpath.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/python/ad/integrators/prbvolpath.py b/src/python/python/ad/integrators/prbvolpath.py index 145b95dc5..185a96bed 100644 --- a/src/python/python/ad/integrators/prbvolpath.py +++ b/src/python/python/ad/integrators/prbvolpath.py @@ -282,7 +282,7 @@ def sample(self, # Re evaluate the phase function value in an attached manner phase_eval, _ = phase.eval_pdf(phase_ctx, mei, wo, act_medium_scatter) if not is_primal and dr.grad_enabled(phase_eval): - Lo = phase_eval * dr.detach(dr.select(active, L / dr.maximum(1e-8, phase_eval), 0.0)) + Lo = phase_eval * dr.detach(dr.select(act_medium_scatter, L / dr.maximum(1e-8, phase_eval), 0.0)) if mode == dr.ADMode.Backward: dr.backward_from(δL * Lo) else: @@ -305,7 +305,7 @@ def sample(self, bsdf_eval = bsdf.eval(ctx, si, bs.wo, active_surface) if not is_primal and dr.grad_enabled(bsdf_eval): - Lo = bsdf_eval * dr.detach(dr.select(active, L / dr.maximum(1e-8, bsdf_eval), 0.0)) + Lo = bsdf_eval * dr.detach(dr.select(active_surface, L / dr.maximum(1e-8, bsdf_eval), 0.0)) if mode == dr.ADMode.Backward: dr.backward_from(δL * Lo) else: