Permalink
Browse files

final submission

  • Loading branch information...
1 parent fe4765e commit c42d9eccca96605f9745b9cfc4bace39c0a5eef9 @seedmanee committed Oct 11, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −4 LambertianMaterial.cc
  2. +0 −1 Sphere.cc
View
8 LambertianMaterial.cc
@@ -78,10 +78,10 @@ void LambertianMaterial::shade(Color& result, const RenderContext& context,
Color reflection_result;
context.getScene()->traceRay(reflection_result, context, reflection_ray, atten * atten_factor, depth + 1);
- result = (light ) *color + Is
- + reflection_result * atten_factor * Kd * Dot(normal, reflection_ray_direction)
- + reflection_result * atten_factor * Ks * pow( max(Dot(reflection_ray_direction, -ray.direction()), 0.0), alpha)
- ;
+ Color reflection_diffuse = reflection_result * atten_factor * Kd * Dot(normal, reflection_ray_direction) ;
+ Color reflection_specular = reflection_result * atten_factor * Ks * pow( max(Dot(reflection_ray_direction, -ray.direction()), 0.0), alpha);
+
+ result = (light + reflection_diffuse) *color + Is + reflection_specular;
}
View
1 Sphere.cc
@@ -41,7 +41,6 @@ void Sphere::intersect(HitRecord& hit, const RenderContext&, const Ray& ray) con
double root2 = (-b + sdisc);
hit.hit(root2, this, matl);
}
-
}
}

0 comments on commit c42d9ec

Please sign in to comment.