fix perspective_rdist issues reported by Sebastian Novozin
parent
7f5aa0c0b2
commit
5a272564f7
|
@ -398,11 +398,16 @@ public:
|
||||||
near plane (in local camera space) */
|
near plane (in local camera space) */
|
||||||
Point nearP = m_sampleToCamera(samplePos);
|
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 */
|
/* Turn that into a normalized ray direction */
|
||||||
Vector d = normalize(Vector(nearP));
|
Vector d = normalize(Vector(nearP));
|
||||||
dRec.d = trafo(d);
|
dRec.d = trafo(d);
|
||||||
dRec.measure = ESolidAngle;
|
dRec.measure = ESolidAngle;
|
||||||
dRec.pdf = m_normalization / (d.z * d.z * d.z);
|
dRec.pdf = pdfDirection(dRec, pRec);
|
||||||
|
|
||||||
return Spectrum(1.0f);
|
return Spectrum(1.0f);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue