Open pbrt4bounty opened 8 months ago
Maybe the problem is here, in the Sample method: https://github.com/mmp/pbrt-v4/blob/master/src/pbrt/lightsamplers.cpp#L268
Float pInfinite = Float(infiniteLights.size()) /
Float(infiniteLights.size() + (!lightBounds.empty() ? 1 : 0));
infiniteLigths.size() value can be 0.0 and later this value is used in some division operations..
if (u < pInfinite) {
u /= pInfinite;
int index = std::min<int>(u * infiniteLights.size(), infiniteLights.size() - 1);
Float pdf = pInfinite * 1.f / infiniteLights.size();
return SampledLight{infiniteLights[index], pdf};
} else {...
I try to add this...
if (pInfinite == 0.0f) return {};
..and seems that solve the issue, but unsure if this are the 'right' solution.
@mmp what do you think?
I obtain a FATAL CUDA error when I use 'Exhaustive' LightSampler with a rectangle area light and render the scene on the GPU. This don't happen with other light types.. Latest binaries from the master branch of the repository.
Can ayone confirm this issue, please? This are the scene that cause this error: exhaustive_error.zip