allow 'g' to vary across spectral channels

metadata
Wenzel Jakob 2013-02-01 11:31:58 -05:00
parent c4045a1066
commit 49fb2d5028
1 changed files with 6 additions and 2 deletions

View File

@ -161,8 +161,12 @@ static void lookupMaterial(const Properties &props, Spectrum &sigmaS, Spectrum &
sigmaA = sigmaT - sigmaS; sigmaA = sigmaT - sigmaS;
} }
if (props.hasProperty("g")) if (props.hasProperty("g")) {
if (props.getType("g") == Properties::ESpectrum)
g = props.getSpectrum("g");
else
g = Spectrum(props.getFloat("g")); g = Spectrum(props.getFloat("g"));
}
if (g.min() <= -1 || g.max() >= 1) if (g.min() <= -1 || g.max() >= 1)
SLog(EError, "The anisotropy parameter 'g' must be in the range (-1, 1)!"); SLog(EError, "The anisotropy parameter 'g' must be in the range (-1, 1)!");