Embree supports a fast and "robust" ray intersection mode. Mitsuba uses the default, fast mode. This is likely the best choice for general rendering tasks, but can cause issues in certain applications.
For example, some people use Mitsuba purely to do some specialized ray tracing (for its speed & simplicity). In such cases, the ray tracing might not happen in in a "Monte Carlo setting", and rays may be spawned in a structured way. In that case, it can happen that rays perfectly hit edges between triangles, which is a known failure mode of Embree's fast mode (see also https://github.com/mitsuba-renderer/mitsuba3/issues/1149).
This PR adds support to set the robust mode at runtime using a boolean flag at the scene level.
This also adds a test for the behavior. The test currently checks both failure and success of the ray tracing. I am not yet 100% sure if the failure will happen on all platforms (due to subtleties in the compilers & math eval) - to be seen once the CI runs.
I also haven't updated the documentation yet. I wasn't sure yet where would be the best place to describe scene level flags.
Embree supports a fast and "robust" ray intersection mode. Mitsuba uses the default, fast mode. This is likely the best choice for general rendering tasks, but can cause issues in certain applications.
For example, some people use Mitsuba purely to do some specialized ray tracing (for its speed & simplicity). In such cases, the ray tracing might not happen in in a "Monte Carlo setting", and rays may be spawned in a structured way. In that case, it can happen that rays perfectly hit edges between triangles, which is a known failure mode of Embree's fast mode (see also https://github.com/mitsuba-renderer/mitsuba3/issues/1149).
This PR adds support to set the robust mode at runtime using a boolean flag at the scene level.
This also adds a test for the behavior. The test currently checks both failure and success of the ray tracing. I am not yet 100% sure if the failure will happen on all platforms (due to subtleties in the compilers & math eval) - to be seen once the CI runs.
I also haven't updated the documentation yet. I wasn't sure yet where would be the best place to describe scene level flags.