Don't acknowledge intersections closer than t=1e-2.

This avoids intersections with the shape itself.
This commit is contained in:
Eryn Wells 2013-09-21 17:02:26 -07:00
parent 6c1e8c7ffb
commit daeb052003

View file

@ -200,6 +200,9 @@ Scene::trace_ray(const Ray &ray,
nints = s->does_intersect(ray, &t);
if (nints > 0) {
for (int i = 0; i < nints; i++) {
if (t[i] < 1e-2) {
break;
}
if (t[i] < nearest_t) {
intersected_shape = s;
nearest_t = t[i];