diff --git a/src/pbrt/util/spectrum.cpp b/src/pbrt/util/spectrum.cpp index 7cdece168..019f307a7 100644 --- a/src/pbrt/util/spectrum.cpp +++ b/src/pbrt/util/spectrum.cpp @@ -43,11 +43,7 @@ Float SpectrumToPhotometric(Spectrum s) { if (s.Is()) s = s.Cast()->Illuminant(); - Float y = 0; - for (Float lambda = Lambda_min; lambda <= Lambda_max; ++lambda) - y += Spectra::Y()(lambda) * s(lambda); - - return y; + return InnerProduct(&Spectra::Y(), s); } XYZ SpectrumToXYZ(Spectrum s) {