fix: don't accumulate terminated secondary wavelengths to spectral buckets

This commit is contained in:
Jan Halama 2026-09-18 13:02:00 +02:00
parent 8c19f30455
commit 5ccdcd06cd

View file

@ -447,7 +447,8 @@ class SpectralFilm : public FilmBase {
L *= weight * CIE_Y_integral;
// Accumulate contributions in spectral buckets.
for (int i = 0; i < NSpectrumSamples; ++i) {
const int numberOfWavelengths = lambda.SecondaryTerminated() ? 1 : NSpectrumSamples;
for (int i = 0; i < numberOfWavelengths; ++i) {
int b = LambdaToBucket(lambda[i]);
pixel.bucketSums[b] += L[i];
pixel.weightSums[b] += weight;