minor restructuring
parent
38002c8450
commit
920aedafb8
|
@ -339,7 +339,7 @@ public:
|
||||||
|
|
||||||
Spectrum diff = m_diffuseReflectance->eval(bRec.its);
|
Spectrum diff = m_diffuseReflectance->eval(bRec.its);
|
||||||
if (m_nonlinear)
|
if (m_nonlinear)
|
||||||
diff /= Spectrum(1.0f) - m_fdrInt*diff;
|
diff /= Spectrum(1.0f) - diff*m_fdrInt;
|
||||||
else
|
else
|
||||||
diff /= 1 - m_fdrInt;
|
diff /= 1 - m_fdrInt;
|
||||||
|
|
||||||
|
@ -357,6 +357,7 @@ public:
|
||||||
bRec.sampledType = EDiffuseReflection;
|
bRec.sampledType = EDiffuseReflection;
|
||||||
|
|
||||||
Spectrum diff = m_diffuseReflectance->eval(bRec.its);
|
Spectrum diff = m_diffuseReflectance->eval(bRec.its);
|
||||||
|
diff /= Spectrum(1.0f) - m_fdrInt*diff;
|
||||||
if (m_nonlinear)
|
if (m_nonlinear)
|
||||||
diff /= Spectrum(1.0f) - diff*m_fdrInt;
|
diff /= Spectrum(1.0f) - diff*m_fdrInt;
|
||||||
else
|
else
|
||||||
|
@ -424,14 +425,14 @@ public:
|
||||||
bRec.wo = Warp::squareToCosineHemisphere(sample);
|
bRec.wo = Warp::squareToCosineHemisphere(sample);
|
||||||
Float Fo = fresnelDielectricExt(Frame::cosTheta(bRec.wo), m_eta);
|
Float Fo = fresnelDielectricExt(Frame::cosTheta(bRec.wo), m_eta);
|
||||||
|
|
||||||
pdf = Warp::squareToCosineHemispherePdf(bRec.wo);
|
|
||||||
|
|
||||||
Spectrum diff = m_diffuseReflectance->eval(bRec.its);
|
Spectrum diff = m_diffuseReflectance->eval(bRec.its);
|
||||||
if (m_nonlinear)
|
if (m_nonlinear)
|
||||||
diff /= Spectrum(1.0f) - diff*m_fdrInt;
|
diff /= Spectrum(1.0f) - diff*m_fdrInt;
|
||||||
else
|
else
|
||||||
diff /= 1 - m_fdrInt;
|
diff /= 1 - m_fdrInt;
|
||||||
|
|
||||||
|
pdf = Warp::squareToCosineHemispherePdf(bRec.wo);
|
||||||
|
|
||||||
return diff * (m_invEta2 * (1-Fi) * (1-Fo));
|
return diff * (m_invEta2 * (1-Fi) * (1-Fo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue