I was reading some of your code, while comparing it to the original PBRT. Then I noticed a minor difference in the PerspectiveCamera class.
In my version, the bug is on line 137. It's in the generateRayDifferential(CameraSample, RayDifferential) method. When you're updating the origin of the RayDifferential, you're setting it to [U,U], rather than [U,V].
Change:
ray.o.setTo(lensUV[0], lensUV[0], 0.f);
To:
ray.o.setTo(lensUV[0], lensUV[1], 0.f);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was reading some of your code, while comparing it to the original PBRT. Then I noticed a minor difference in the PerspectiveCamera class.
In my version, the bug is on line 137. It's in the generateRayDifferential(CameraSample, RayDifferential) method. When you're updating the origin of the RayDifferential, you're setting it to [U,U], rather than [U,V].
Change:
To: