diff --git a/src/pbrt/util/spectrum.cpp b/src/pbrt/util/spectrum.cpp index d59f4f898..e31317bd0 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) {