Assorted bug fixes.

This commit is contained in:
Miguel Angel Astor Romero
2017-01-20 12:13:42 -04:00
parent 33aba8cae2
commit 5970be923b
9 changed files with 314 additions and 270 deletions

View File

@@ -85,8 +85,8 @@ vec3 WhittedTracer::trace_ray(Ray & r, Scene * s, unsigned int rec_level) const
}
// Return final color.
return _f->m_mat->m_emission + color;
return clamp(_f->m_mat->m_emission + color, 0.0f, 1.0f);
} else
return s->m_env->get_color(r);
return clamp(s->m_env->get_color(r), 0.0f, 1.0f);
}