diff --git a/src/scene.cc b/src/scene.cc index 1d82d99..5894458 100644 --- a/src/scene.cc +++ b/src/scene.cc @@ -134,7 +134,7 @@ Scene::render() d = Vector3(0, 0, 1); d.normalize(); primary_ray = Ray(o, d); - Color c = trace_ray(primary_ray, 0); + Color c = trace_ray(primary_ray); pixels[y * width + x] = c; } } @@ -177,7 +177,9 @@ Scene::add_light(PointLight *light) * Trace the given ray through the scene, recursing until depth has been reached. */ Color -Scene::trace_ray(const Ray &ray, const int depth) +Scene::trace_ray(const Ray &ray, + const int depth, + const float weight) { if (depth >= max_depth) { return Color::Black; diff --git a/src/scene.h b/src/scene.h index 6ba4ea9..b0eb9c7 100644 --- a/src/scene.h +++ b/src/scene.h @@ -42,7 +42,7 @@ public: void add_light(PointLight *light); private: - Color trace_ray(const Ray &ray, const int depth); + Color trace_ray(const Ray &ray, const int depth = 0, const float weight = 1.0); // Pixel dimensions of the image. int width, height;