Skip to content

Commit

Permalink
A bug in path tracing is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Apr 18, 2015
1 parent b09ede6 commit 7ff63bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/simplebpt_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ int main(int argc, char **argv) {
scene.addSphere(Sphere(16.5, Vector3(77.0, 16.5, 78), Color(), Color(0.99, 0.99, 0.99), REFLECTION_REFRACTION)); // Glass ball
scene.addSphere(Sphere( 7.5, Vector3(50.0, 72.5, 81.6), Color(16, 16, 16), Color(), REFLECTION_DIFFUSE), true); // Light

const int width = 160;
const int height = 120;
const int width = 320;
const int height = 240;
Camera camera(width, height,
Vector3(50.0, 40.8, 220.0),
Vector3(0.0, 0.0, -1.0),
Expand All @@ -30,7 +30,7 @@ int main(int argc, char **argv) {
5.0,
28.0);

BPTRenderer renderer(width, height, 20, 2);
BPTRenderer renderer(width, height, 30, 2);
renderer.render(scene, camera);

return 0;
Expand Down
1 change: 1 addition & 0 deletions src/renderer/BPTRenderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ namespace spica {
const Vector3 x0xV = positionOnObjplane - positionOnLens;
const Vector3 x0x1 = hitpoint.position() - positionOnLens;
const double PAx1 = camera.PImageToPAx1(PImage, x0xV, x0x1, orientNormal);
totalPdfA *= PAx1;

throughputMC = camera.contribSensitivity(x0xV, x0xI, x0x1) * throughputMC;
} else {
Expand Down

0 comments on commit 7ff63bb

Please sign in to comment.