Open leroyvn opened 4 years ago
Hi @leroyvn,
I couldn't reproduce this bug on my end, could you try again with the latest distant
sensor to see if it works on your side?
Thanks for looking into it :) I rebased my distant
branch onto the latest master
, ran the script and got the following output:
rectangle, scalar_mono (ShadowEpsilon = 0.0008941)
scene_size = 1
si.p.z = -1.798e-07
relative = -0.0002011
emitter_val = 1.0
scene_size = 10
si.p.z = -5.067e-07
relative = -0.0005668
emitter_val = 1.0
scene_size = 100
si.p.z = 2.371e-06
relative = 0.002651
emitter_val = 1.0
scene_size = 1000
si.p.z = -5.521e-05
relative = -0.06175
emitter_val = 1.0
scene_size = 1e+04
si.p.z = -0.0007543
relative = -0.8437
⚠️ emitter_val = 0.0
scene_size = 1e+05
si.p.z = 0.002558
relative = 2.861
emitter_val = 1.0
scene_size = 1e+06
si.p.z = 0.02558
relative = 28.61
emitter_val = 1.0
scene_size = 1e+07
si.p.z = -1.658
relative = -1855
⚠️ emitter_val = 0.0
rectangle, scalar_mono_double (ShadowEpsilon = 1.665e-12)
scene_size = 1
si.p.z = -4.948e-17
relative = -2.971e-05
emitter_val = 1.0
scene_size = 10
si.p.z = 2.553e-17
relative = 1.533e-05
emitter_val = 1.0
scene_size = 100
si.p.z = -1.101e-14
relative = -0.006613
emitter_val = 1.0
scene_size = 1000
si.p.z = 9.37e-14
relative = 0.05627
emitter_val = 1.0
scene_size = 1e+04
si.p.z = 8.59e-13
relative = 0.5158
emitter_val = 1.0
scene_size = 1e+05
si.p.z = -6.844e-12
relative = -4.11
⚠️ emitter_val = 0.0
scene_size = 1e+06
si.p.z = -3.435e-11
relative = -20.62
⚠️ emitter_val = 0.0
scene_size = 1e+07
si.p.z = 1.246e-09
relative = 748.4
emitter_val = 1.0
sphere, scalar_mono (ShadowEpsilon = 0.0008941)
scene_size = 1
si.p.z = -1.798e-07
relative = -0.0002011
emitter_val = 1.0
scene_size = 10
si.p.z = -5.067e-07
relative = -0.0005668
emitter_val = 1.0
scene_size = 100
si.p.z = 2.371e-06
relative = 0.002651
emitter_val = 1.0
scene_size = 1000
si.p.z = -5.521e-05
relative = -0.06175
emitter_val = 1.0
scene_size = 1e+04
si.p.z = -0.0007543
relative = -0.8437
⚠️ emitter_val = 0.0
scene_size = 1e+05
si.p.z = 0.002558
relative = 2.861
emitter_val = 1.0
scene_size = 1e+06
si.p.z = 0.02558
relative = 28.61
emitter_val = 1.0
scene_size = 1e+07
si.p.z = -1.658
relative = -1855
⚠️ emitter_val = 0.0
sphere, scalar_mono_double (ShadowEpsilon = 1.665e-12)
scene_size = 1
si.p.z = -4.948e-17
relative = -2.971e-05
emitter_val = 1.0
scene_size = 10
si.p.z = 2.553e-17
relative = 1.533e-05
emitter_val = 1.0
scene_size = 100
si.p.z = -1.101e-14
relative = -0.006613
emitter_val = 1.0
scene_size = 1000
si.p.z = 9.37e-14
relative = 0.05627
emitter_val = 1.0
scene_size = 1e+04
si.p.z = 8.59e-13
relative = 0.5158
emitter_val = 1.0
scene_size = 1e+05
si.p.z = -6.844e-12
relative = -4.11
⚠️ emitter_val = 0.0
scene_size = 1e+06
si.p.z = -3.435e-11
relative = -20.62
⚠️ emitter_val = 0.0
scene_size = 1e+07
si.p.z = 1.246e-09
relative = 748.4
emitter_val = 1.0
Platform: macOS 11.4 Compiler: Apple clang version 12.0.5 (clang-1205.0.22.9) Python version: Python 3.8.8 :: Anaconda, Inc. Mitsuba 2 version: leroyvn/mitsuba2@c9282a035c8b9dd063aee896c246fe0f0fcd68f9 [branched off 2cd84c842183aa285cf543307c875d565b1621f0] Compiled variants:
scalar_mono
scalar_mono_double
Interesting, I have only tested this on a Linux machine. This is running with Embree I suppose?
AFAIK I'm running with the kd-tree (I set MTS_ENABLE_EMBREE
to OFF).
Same here actually. Would it be possible for you to try on a Linux machine?
I got exactly the same results on a WSL (Ubuntu 20.04). I'll attach my CMake cache file just in case.
Ray intersection is sometimes behind surface with inaccuracy larger than shadow epsilon. This may result in wrong occlusion.
System configuration
Platform: macOS 10.15.4 Compiler: Apple clang version 11.0.0 (clang-1100.0.33.17) Python version: Python 3.7.6 :: Anaconda, Inc. Mitsuba 2 version: leroyvn/mitsuba2@ed00d49b8fd9f03e8e6430dc85f8696994cad6bc [branched off abf69382ceb76a8d91a5e5104fa745a9cb5434be] Compiled variants:
scalar_mono
scalar_mono_double
Problem
I sometimes get intersections located at the wrong side of the associated surface. While it's usually not an issue, the error in positioning can become larger that
ShadowEpsilon
if scene dimensions become too large. At this point, this become problematic, as the surface will occlude while is actually should not. I tried with therectangle
andsphere
shape plugins.Note that I encountered this issue only with the
distant
sensor plugin (see #143). I suspect that this is due to the fact that the ray origin moves further away from the scene as its size increases, which increases the tolerance on positioning.Any idea about what can be done to ensure that the intersection point will end up at the correct side of the surface? (Or at least closer than
ShadowEpsilon
?)Steps to reproduce