Log all objects before starting the render

This commit is contained in:
Eryn Wells 2014-08-03 17:25:25 -07:00
parent 4828cb313f
commit a0fbecf483
2 changed files with 18 additions and 0 deletions

View file

@ -150,6 +150,8 @@ Scene::render()
{
LOG_INFO << "Rendering scene with " << shapes.size() << " objects.";
printf("Rendering scene with %lu objects.\n", shapes.size());
LogObjects();
std::chrono::time_point<std::chrono::system_clock> start, end;
start = std::chrono::system_clock::now();
@ -326,3 +328,17 @@ Scene::trace_ray(const Ray &ray,
return out_color;
}
void
Scene::LogObjects()
const
{
LOG_DEBUG << "BEGIN SCENE OBJECTS";
for (Object::Ptr obj : shapes) {
LOG_DEBUG << *obj;
}
LOG_DEBUG << "END SCENE OBJECTS";
}

View file

@ -53,6 +53,8 @@ public:
private:
Color trace_ray(const Ray &ray, const int depth = 0, const float weight = 1.0);
void LogObjects() const;
// Pixel dimensions of the image.
int width, height;