mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.91k stars 1.19k forks source link

Disk shape position partial derivative #154

Closed ksmolenskiy closed 6 years ago

ksmolenskiy commented 7 years ago

Hello! Shouldn't disk dp/dv (disk.cpp line 79) be Vector3f dpdv = Vector3f(pHit.x, pHit.y, 0.) * (radius - innerRadius) / rHit; instead of Vector3f dpdv = Vector3f(pHit.x, pHit.y, 0.) * (innerRadius - radius) / rHit; ??

https://www.wolframalpha.com/input/?i=d%2Fdv+((1+-+v)+*+r0+%2B+v+*+r1)+*+cos(phi)

mmp commented 6 years ago

You are correct. Thanks for reporting this!