提交 fe1d2fe4 编写于 作者: M Matt Pharr

ConductorMaterial: fix NaN bug if specified reflectance == 1

上级 a490efdc
......@@ -501,7 +501,8 @@ class ConductorMaterial {
etas = texEval(eta, ctx, lambda);
ks = texEval(k, ctx, lambda);
} else {
SampledSpectrum r = texEval(reflectance, ctx, lambda);
// Avoid r==0 NaN case...
SampledSpectrum r = Clamp(texEval(reflectance, ctx, lambda), 0, .9999);
etas = SampledSpectrum(1.f);
ks = 2 * Sqrt(r) / Sqrt(ClampZero(SampledSpectrum(1) - r));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册