Log all objects before starting the render
This commit is contained in:
parent
4828cb313f
commit
a0fbecf483
2 changed files with 18 additions and 0 deletions
16
src/scene.cc
16
src/scene.cc
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue