mitsuba3 icon indicating copy to clipboard operation
mitsuba3 copied to clipboard

Add eval(), sample_direction() and pdf_direction() to distant sensor

Open leroyvn opened this issue 4 years ago • 6 comments

Description

This PR implements the missing eval(), sample_direction() and pdf_direction() methods for the distant sensor plugin.

Notes:

  • Not ready for merge, requires decision regarding SurfaceInteraction3f. Depending on the outcome, I might close this PR.
  • ~The checkerboard test segfaults when rebasing onto master, I still have to investigate that. EDIT: This appeared with 1372c608e134ab997a2af5ad711f4efb35c463d1.~
  • Now requires #19

Testing

I added a few unit tests to check if the implementation was correct.

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] My changes generate no new warnings
  • [ ] My code also compiles for cuda_* and llvm_* variants. If you can't test this, please leave below
  • [x] I have commented my code
  • [x] I have made corresponding changes to the documentation
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [ ] I cleaned the commit history and removed any "Merge" commits
  • [x] I give permission that the Mitsuba 2 project may redistribute my contributions under the terms of its license

Tested with the LLVM backend only (no CUDA).

leroyvn avatar Jun 16 '21 15:06 leroyvn

Hi @Speierers, any news regarding that? I had a look at @merlinND's ptracer branch and it doesn't look like SurfaceInteraction3f is updated over there. I'm actually in the process of implementing these methods for the non-camera sensors (which I could add to this PR btw).

leroyvn avatar Jul 06 '21 09:07 leroyvn

Hi @leroyvn ,

Not sure to remember what was the issue with SurfaceInteraction3f?

Speierers avatar Jul 08 '21 07:07 Speierers

Hi @Speierers, see this other comment for details.

leroyvn avatar Jul 08 '21 07:07 leroyvn

I'm revisiting this PR. The issue we had back in July is still here. I started work on DirectionSample in #19 to generalise DirectionSample.emitter and turn it into a DirectionSample.endpoint. The update I did works but breaks many features (no problem to update all that of course): the change seems quite intrusive and breaks a symmetry which existed between DirectionSample and SurfaceInteraction.

Wrapping it up:

  • Should I finish this work on #19 or drop it?
  • Regardless the outcome on #19, what shall we do with this PR?

leroyvn avatar Aug 30 '21 13:08 leroyvn

Hi @leroyvn,

I was just looking at the PRs you mention. It was actually not 100% clear what the issue with DirectionSample.endpoint was, can you clarify? There are some unrelated-seeming test failures regarding the Scene class. Is that the main problem, i.e. do you need help debugging those?

wjakob avatar Aug 31 '21 07:08 wjakob

Hi @wjakob,

There are some unrelated-seeming test failures regarding the Scene class. Is that the main problem, i.e. do you need help debugging those?

I think I do (see https://github.com/mitsuba-renderer/mitsuba2-next/pull/19#issuecomment-909236433).

leroyvn avatar Aug 31 '21 13:08 leroyvn