diff options
author | Julian T <julian@jtle.dk> | 2020-08-11 21:21:02 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-08-11 21:21:02 +0200 |
commit | 690b72664ca8d471f5c117f6ed87aeae2de0a208 (patch) | |
tree | 8bc30efc009462d4390ac6eb8fe28ccbdbbd88a1 /src/render.cpp | |
parent | 3b8893902ac5f529faf15accaa3fb5360771d3b3 (diff) |
Defuse coloring
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/render.cpp b/src/render.cpp index 5601863..197226e 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -9,12 +9,6 @@ const Vec3d up = Vec3d(0, 1, 0); -void Color::clamp() { - if (m_x > 1) { m_x = 1; } - if (m_y > 1) { m_y = 1; } - if (m_z > 1) { m_z = 1; } -} - Renderer::Renderer(const Scene &scn, Vec3d eye, Vec3d target, unsigned width, unsigned height) : m_scn(scn) { @@ -84,8 +78,7 @@ Color Renderer::pathtrace_sample(const Ray &r, unsigned hop) { return Color(0, 0, 0); } - auto green = Color(0, 1, 0); - return Color(green * norm.dot(tolight)); + return res->m_mat.reflect(norm, r.m_direction, tolight); } const Shape* Renderer::cast_ray(const Ray &r, double chk_dist, double *dist_ret) { |