tiny adjustments

metadata
Wenzel Jakob 2011-06-23 14:57:00 +02:00
parent 226b639d28
commit c36b76253a
2 changed files with 11 additions and 10 deletions

View File

@ -8,6 +8,11 @@
<!-- Test the diffuse transmission model -->
<bsdf type="difftrans"/>
<!-- Test the rough glass model -->
<bsdf type="roughglass">
<float name="alphaB" value="0.1"/>
</bsdf>
<!-- Test the Phong model -->
<bsdf type="phong">
<float name="diffuseAmount" value="0.5"/>
@ -55,10 +60,5 @@
<float name="alphaB" value="0.1"/>
</bsdf>
<!-- Test the rough glass model -->
<bsdf type="roughglass">
<float name="alphaB" value="0.1"/>
</bsdf>
<camera type="perspective"/>
</scene>

View File

@ -70,7 +70,7 @@ public:
/**
* 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 ex = Frame::tanTheta(m) / m_alphaB;
@ -91,11 +91,11 @@ public:
/**
* Smith's shadow-masking function G1 for the Beckmann distribution
* @param m The microsurface normal
* @param v An arbitrary direction
* \param m The microsurface normal
* \param v An arbitrary direction
*/
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;
const Float tanTheta = Frame::tanTheta(v);
@ -109,7 +109,8 @@ public:
if (a >= 1.6f)
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 {