tiny adjustments
parent
226b639d28
commit
c36b76253a
|
@ -8,6 +8,11 @@
|
||||||
<!-- Test the diffuse transmission model -->
|
<!-- Test the diffuse transmission model -->
|
||||||
<bsdf type="difftrans"/>
|
<bsdf type="difftrans"/>
|
||||||
|
|
||||||
|
<!-- Test the rough glass model -->
|
||||||
|
<bsdf type="roughglass">
|
||||||
|
<float name="alphaB" value="0.1"/>
|
||||||
|
</bsdf>
|
||||||
|
|
||||||
<!-- Test the Phong model -->
|
<!-- Test the Phong model -->
|
||||||
<bsdf type="phong">
|
<bsdf type="phong">
|
||||||
<float name="diffuseAmount" value="0.5"/>
|
<float name="diffuseAmount" value="0.5"/>
|
||||||
|
@ -55,10 +60,5 @@
|
||||||
<float name="alphaB" value="0.1"/>
|
<float name="alphaB" value="0.1"/>
|
||||||
</bsdf>
|
</bsdf>
|
||||||
|
|
||||||
<!-- Test the rough glass model -->
|
|
||||||
<bsdf type="roughglass">
|
|
||||||
<float name="alphaB" value="0.1"/>
|
|
||||||
</bsdf>
|
|
||||||
|
|
||||||
<camera type="perspective"/>
|
<camera type="perspective"/>
|
||||||
</scene>
|
</scene>
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Beckmann distribution function for gaussian random surfaces
|
* Beckmann distribution function for gaussian random surfaces
|
||||||
* @param thetaM Tangent of the angle between M and N.
|
* \param thetaM Tangent of the angle between M and N.
|
||||||
*/
|
*/
|
||||||
Float beckmannD(const Vector &m) const {
|
Float beckmannD(const Vector &m) const {
|
||||||
Float ex = Frame::tanTheta(m) / m_alphaB;
|
Float ex = Frame::tanTheta(m) / m_alphaB;
|
||||||
|
@ -91,11 +91,11 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smith's shadow-masking function G1 for the Beckmann distribution
|
* Smith's shadow-masking function G1 for the Beckmann distribution
|
||||||
* @param m The microsurface normal
|
* \param m The microsurface normal
|
||||||
* @param v An arbitrary direction
|
* \param v An arbitrary direction
|
||||||
*/
|
*/
|
||||||
Float smithBeckmannG1(const Vector &v, const Vector &m) const {
|
Float smithBeckmannG1(const Vector &v, const Vector &m) const {
|
||||||
if (dot(v, m)*Frame::cosTheta(v) <= 0)
|
if (dot(v, m) * Frame::cosTheta(v) <= 0)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
|
||||||
const Float tanTheta = Frame::tanTheta(v);
|
const Float tanTheta = Frame::tanTheta(v);
|
||||||
|
@ -109,7 +109,8 @@ public:
|
||||||
if (a >= 1.6f)
|
if (a >= 1.6f)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
|
|
||||||
return (3.535f * a + 2.181f * aSqr)/(1.0f + 2.276f * a + 2.577f * aSqr);
|
return (3.535f * a + 2.181f * aSqr) /
|
||||||
|
(1.0f + 2.276f * a + 2.577f * aSqr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vector reflect(const Vector &wi, const Normal &n) const {
|
inline Vector reflect(const Vector &wi, const Normal &n) const {
|
||||||
|
|
Loading…
Reference in New Issue