ported cylinder.cpp improvements to hair.cpp
parent
0c20766291
commit
923069f877
|
@ -840,6 +840,11 @@ void HairShape::fillIntersectionRecord(const Ray &ray,
|
|||
const Vector relHitPoint = its.p - m_kdtree->firstVertex(iv);
|
||||
its.geoFrame.n = Normal(normalize(relHitPoint - dot(axis, relHitPoint) * axis));
|
||||
its.geoFrame.t = cross(its.geoFrame.n, its.geoFrame.s);
|
||||
|
||||
/* Migitate roundoff error issues by a normal shift of the computed intersection point */
|
||||
const Vector local = its.geoFrame.toLocal(relHitPoint);
|
||||
its.p += its.geoFrame.n * (m_kdtree->getRadius() - std::sqrt(local.y*local.y+local.z*local.z));
|
||||
|
||||
its.shFrame = its.geoFrame;
|
||||
its.wi = its.toLocal(-ray.d);
|
||||
its.hasUVPartials = false;
|
||||
|
|
Loading…
Reference in New Issue