Little fix for shadow ray generation.

This commit is contained in:
2016-12-29 22:32:32 -04:00
parent 2bec46b580
commit 2b1a9ed819
2 changed files with 923 additions and 996 deletions

1915
output.ppm

File diff suppressed because one or more lines are too long

View File

@@ -82,10 +82,10 @@ vec3 Tracer::trace_ray(Ray & r, vector<Figure *> & vf, vector<Light *> & vl, uns
for (size_t l = 0; l < vl.size(); l++) { for (size_t l = 0; l < vl.size(); l++) {
vis = true; vis = true;
sr = Ray(vl[l]->m_position, i_pos); sr = Ray(vl[l]->m_position, i_pos + n * BIAS);
for (size_t f = 0; f < vf.size(); f++) { for (size_t f = 0; f < vf.size(); f++) {
if (f != f_index && vf[f]->intersect(sr, _t)) { if (vf[f]->intersect(sr, _t)) {
vis = false; vis = false;
break; break;
} }