Skip to content

Commit

Permalink
Try two at disk parameterization and partial derivatives.
Browse files Browse the repository at this point in the history
The fix from issue mmp#154 led to a different bug (issue mmp#183). This switches
back to the old partial derivative vectors via adjusting the disk
parameterization. (Now (0,0) is on the outer ring, which isn't great, but
seems like the least worst option.)
  • Loading branch information
mmp committed Dec 30, 2018
1 parent b59f1d2 commit 2f0852c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/shapes/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ bool Disk::Intersect(const Ray &r, Float *tHit, SurfaceInteraction *isect,
// Find parametric representation of disk hit
Float u = phi / phiMax;
Float rHit = std::sqrt(dist2);
Float oneMinusV = ((rHit - innerRadius) / (radius - innerRadius));
Float v = 1 - oneMinusV;
Float v = (radius - rHit) / (radius - innerRadius);
Vector3f dpdu(-phiMax * pHit.y, phiMax * pHit.x, 0);
Vector3f dpdv =
Vector3f(pHit.x, pHit.y, 0.) * (innerRadius - radius) / rHit;
Expand Down

0 comments on commit 2f0852c

Please sign in to comment.