Skip to content

Commit dfad74c

Browse files
committed
SpectralFilm: ensure wavelength range is within [Lambda_min, Lambda_max]
A fatal error is issued if it isn't--with the current spectral implementation, those wavelengths won't be sampled in practice and updating the implementation would be a significant overhaul at this point. Issue #417.
1 parent 23593dc commit dfad74c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pbrt/film.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,13 @@ SpectralFilm *SpectralFilm::Create(const ParameterDictionary &parameters,
10501050
int nBuckets = parameters.GetOneInt("nbuckets", 16);
10511051
Float lambdaMin = parameters.GetOneFloat("lambdamin", Lambda_min);
10521052
Float lambdaMax = parameters.GetOneFloat("lambdamax", Lambda_max);
1053+
if (lambdaMin < Lambda_min || lambdaMax > Lambda_max)
1054+
ErrorExit("Unfortunately pbrt must be recompiled to render wavelengths "
1055+
"beyond the [%f,%f] range ([%f,%f] was specified). Please "
1056+
"update Lambda_min and/or Lambda_max as necessary in "
1057+
"src/pbrt/util/spectrum.h and recompile.", Lambda_min, Lambda_max,
1058+
lambdaMin, lambdaMax);
1059+
10531060
Float maxComponentValue = parameters.GetOneFloat("maxcomponentvalue", Infinity);
10541061

10551062
return alloc.new_object<SpectralFilm>(filmBaseParameters, lambdaMin, lambdaMax,

0 commit comments

Comments
 (0)