Skip to content

Commit

Permalink
Minor formatting/readability changes to prbvolpath
Browse files Browse the repository at this point in the history
  • Loading branch information
njroussel committed Oct 6, 2023
1 parent 5f9eebd commit 1eeceb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/python/python/ad/integrators/prbvolpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 1eeceb2

Please sign in to comment.