From cfeb7766e7a1513492451f35dc65b86409655a7b Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 31 Jan 2020 12:12:09 +0100 Subject: [PATCH] fixed a serious issue in spectral interpolation (caught by @merlinND) --- src/libcore/spectrum.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/spectrum.cpp b/src/libcore/spectrum.cpp index 8f95a5cf..6e289161 100644 --- a/src/libcore/spectrum.cpp +++ b/src/libcore/spectrum.cpp @@ -703,7 +703,7 @@ Float InterpolatedSpectrum::eval(Float lambda) const { b = m_wavelengths[idx1], fa = m_values[idx1-1], fb = m_values[idx1]; - return math::lerp((lambda - a) / (b-a), fb, fa); + return math::lerp((lambda - a) / (b-a), fa, fb); } else if (idx2 == idx1+1) { /* Hit a value exactly */ return m_values[idx1];