Closed jampekka closed 6 years ago
Good catch! With the current code and delta lights, max_t
for calculating shadow rays is always 1-2*EPSILON
. Just using the shadow ray's length instead of ld
for max_t
seems like a proper fix to me, too. Thanks for reporting!
I fixed this in a slightly different way. Seems a bit more concise to me handling this just where solid angle is computed.
When the lights are sampled in
visionray::pathtracing::kernel
, the shadow is cast with max length ofld
at: https://github.com/szellmann/visionaray/blob/f557d7d206b0ff3431ba634be9d05619d541ad3f/include/visionaray/detail/pathtracing.inl#L155However, for delta lights
ld
is always set to one (presumably due to handle the solid angle computations later) at: https://github.com/szellmann/visionaray/blob/f557d7d206b0ff3431ba634be9d05619d541ad3f/include/visionaray/detail/pathtracing.inl#L140Using the proper length for the shadow ray seems to fix this issue. Eg: