Little bit of code clean up in TraceRay

This commit is contained in:
Eryn Wells 2014-08-02 14:30:40 -07:00
parent 1a5a46c468
commit 8de737decd
2 changed files with 5 additions and 4 deletions

View file

@ -268,18 +268,18 @@ Scene::trace_ray(const Ray &ray,
diffuse_level = shape_material.GetDiffuseIntensity();
ambient_level = 1.0 - diffuse_level;
shadow_ray = Ray(intersection, light_direction);
shadowRay = Ray(intersection, light_direction);
for (Object::Ptr s : shapes) {
// Skip the intersected shape.
if (s == intersected_shape) {
/* Skip the intersected shape. */
continue;
}
mStats.shadowRays++;
// Figure out if we're in shadow.
/* Figure out if we're in shadow. */
ts.clear();
if (s->DoesIntersect(shadow_ray, ts)) {
if (s->DoesIntersect(shadowRay, ts)) {
diffuse_level = 0.0;
break;
}

View file

@ -76,6 +76,7 @@ private:
void PrintRayTable() const;
/* Ray counts */
unsigned long primaryRays;
unsigned long shadowRays;
unsigned long reflectionRays;