mirror of
https://github.com/mmp/pbrt-v4
synced 2026-09-26 16:20:07 +03:00
replace Riemann sum computation in SpectrumToPhotometric() with InnerProduct()
This commit is contained in:
parent
b5be145843
commit
84634b94c2
1 changed files with 1 additions and 5 deletions
|
|
@ -43,11 +43,7 @@ Float SpectrumToPhotometric(Spectrum s) {
|
|||
if (s.Is<RGBIlluminantSpectrum>())
|
||||
s = s.Cast<RGBIlluminantSpectrum>()->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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue