fix perspective_rdist issues reported by Sebastian Novozin

metadata
Wenzel Jakob 2015-07-15 12:37:38 +02:00
parent 7f5aa0c0b2
commit 5a272564f7
1 changed files with 6 additions and 1 deletions

View File

@ -398,11 +398,16 @@ public:
near plane (in local camera space) */
Point nearP = m_sampleToCamera(samplePos);
if (m_distortion) {
Float correction = invertDistortion(Vector2(nearP.x / nearP.z, nearP.y / nearP.z).length());
nearP.x *= correction; nearP.y *= correction;
}
/* Turn that into a normalized ray direction */
Vector d = normalize(Vector(nearP));
dRec.d = trafo(d);
dRec.measure = ESolidAngle;
dRec.pdf = m_normalization / (d.z * d.z * d.z);
dRec.pdf = pdfDirection(dRec, pRec);
return Spectrum(1.0f);
}