According to the description in the book, Scene::IntersectP() "checks for the existence of intersections along the [passed] ray". This operatorion should be symmetric in the sense that if i1 and i2 are pbrt::Interaction's, then scene.IntersectP(i1.SpawnRayTo(i2)) should be true if and only if scene.IntersectP(i2.SpawnRayTo(i1)) is true.

However, I've encountered the following contradiction to this expectation: For two pbrt::Vertex's x1 and x2, pbrt::VisibilityTester{ x1.GetInteraction(), x2.GetInteraction() }.Unoccluded(scene) and pbrt::VisibilityTester{ x2.GetInteraction(), x1.GetInteraction() }.Unoccluded(scene) returned opposite values. Since VisibilityTester::Unoccluded does nothing else than calling Scene::IntersectP in the previously described way (see the description in the book), it seems like I'm missing something crucial here.

  • $\begingroup$ Could it be due to numerical issues for ray-triangle intersection? $\endgroup$
    – Hubble
    Feb 16, 2020 at 19:51
  • $\begingroup$ @Hubble Well, hard to say, but I guess the error indeed depends on the surface the ray hits. $\endgroup$
    – 0xbadf00d
    Feb 16, 2020 at 20:09
  • $\begingroup$ I wouldn't be surprised if the visibility tester is inconsistent if you test on a scene with complex meshes with high-frequency details. Maybe try with two triangles facing each others, or reduce the robustness epsilon, and see if the problem is still there. $\endgroup$
    – Hubble
    Feb 16, 2020 at 20:13
  • $\begingroup$ @Hubble I don't know if you're familiar with it, but I've tested it with the "sample.pbrt" scene in PBRT which is as simple as possible: i.stack.imgur.com/txaN0.png. $\endgroup$
    – 0xbadf00d
    Feb 16, 2020 at 20:25
  • $\begingroup$ Huddle is certainly right: It might be due to numerical issues for the ray-triangle intersection. PBRT offset the spawned ray (github.com/mmp/pbrt-v3/blob/…) to avoid such issue. However, there is no silver bullet here. $\endgroup$
    – Beltegeuse
    Feb 17, 2020 at 18:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.