summaryrefslogtreecommitdiff
path: root/material_dielectric.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'material_dielectric.cpp')
-rw-r--r--material_dielectric.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/material_dielectric.cpp b/material_dielectric.cpp
index ed8e4eb..61e34ec 100644
--- a/material_dielectric.cpp
+++ b/material_dielectric.cpp
@@ -3,6 +3,7 @@
//
#include "material_dielectric.h"
+#include "tracelog.h"
bool material_dielectric::scatter(ray3d &r, const object &hit_obj, double hit_t, random_uv_gen_3d &ruvg) const {
const auto hit_p = r.at(hit_t);
@@ -22,9 +23,11 @@ bool material_dielectric::scatter(ray3d &r, const object &hit_obj, double hit_t,
// determine reflection or refraction using Schlick's Approximation.
if (reflectance(cos1, ri_) > ruvg.range01_scalar()) {
// reflect
+ TRACELOG(" reflect (dielectric material, schlick, ri=%-10f)\n", ri_);
r2 = n.reflect(r.direction());
} else {
// refract
+ TRACELOG(" refract (dielectric material, schlick, ri=%-10f)\n", ri_);
r2 = n.refract<true>(r.direction(), ri_);
}
r.direction(r2.unit_vec());