Created
April 3, 2011 20:11
-
-
Save jleedev/900730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git i/src/scene.cpp w/src/scene.cpp | |
| index 8382ef7..3ef0d1a 100644 | |
| --- i/src/scene.cpp | |
| +++ w/src/scene.cpp | |
| @@ -92,6 +92,9 @@ Color Scene::raytrace(const Ray& camera_ray, int level) const { | |
| continue; | |
| float int_distance2 = Ray::makeRay(camera_ray.getOrigin(), | |
| intersection->getOrigin()).getDir().magnitude2(); | |
| + if (int_distance2 < 1e-6) | |
| + // Too close! We must move forwards a little. | |
| + continue; | |
| if (int_distance2 < nearest_distance2) { | |
| // Found a closer hit | |
| nearest_shape = shape; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment