Little bit of code clean up in TraceRay
This commit is contained in:
parent
1a5a46c468
commit
8de737decd
2 changed files with 5 additions and 4 deletions
|
|
@ -268,18 +268,18 @@ Scene::trace_ray(const Ray &ray,
|
||||||
diffuse_level = shape_material.GetDiffuseIntensity();
|
diffuse_level = shape_material.GetDiffuseIntensity();
|
||||||
ambient_level = 1.0 - diffuse_level;
|
ambient_level = 1.0 - diffuse_level;
|
||||||
|
|
||||||
shadow_ray = Ray(intersection, light_direction);
|
shadowRay = Ray(intersection, light_direction);
|
||||||
for (Object::Ptr s : shapes) {
|
for (Object::Ptr s : shapes) {
|
||||||
// Skip the intersected shape.
|
|
||||||
if (s == intersected_shape) {
|
if (s == intersected_shape) {
|
||||||
|
/* Skip the intersected shape. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
mStats.shadowRays++;
|
mStats.shadowRays++;
|
||||||
|
|
||||||
// Figure out if we're in shadow.
|
/* Figure out if we're in shadow. */
|
||||||
ts.clear();
|
ts.clear();
|
||||||
if (s->DoesIntersect(shadow_ray, ts)) {
|
if (s->DoesIntersect(shadowRay, ts)) {
|
||||||
diffuse_level = 0.0;
|
diffuse_level = 0.0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ private:
|
||||||
|
|
||||||
void PrintRayTable() const;
|
void PrintRayTable() const;
|
||||||
|
|
||||||
|
/* Ray counts */
|
||||||
unsigned long primaryRays;
|
unsigned long primaryRays;
|
||||||
unsigned long shadowRays;
|
unsigned long shadowRays;
|
||||||
unsigned long reflectionRays;
|
unsigned long reflectionRays;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue