Skip to content

Commit

Permalink
some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed May 31, 2023
1 parent 108ca9c commit 0ad4942
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@

build/
*.ppm
*.jpg

bin/*
!bin/conf.json
.vscode/
2 changes: 1 addition & 1 deletion bin/conf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ "width": 800,
"heigth": 600,
"samples": 1,
"samples": 50,
"depth": 5
}
Binary file added demo/test50-0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/test50-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/test50-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@

using namespace std::chrono_literals;

int effective_depth = INT_MAX;

Color ray_color(const Ray &r, const Hittable& world, int depth){
hit_record rec;

if(depth < effective_depth) effective_depth = depth;
if(depth <= 0)
return Color(0,0,0);

Expand Down Expand Up @@ -84,6 +86,7 @@ Color* Renderer::run(int img_height, int img_width, int samples, int max_depth,
th.get();
}
log << std::endl << " Done !" << std::endl;
log << std::endl << " Effective max depth : " << effective_depth << std::endl;

return img;
}

0 comments on commit 0ad4942

Please sign in to comment.