summaryrefslogtreecommitdiff
path: root/vec.h
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-16 19:08:28 +0800
committerKeuin <[email protected]>2022-04-16 19:08:28 +0800
commit60d8221109304bc4f207dda8a42623cae488af5d (patch)
tree5f4c59a81d58d14666226ee1f7da5299db98f9f5 /vec.h
parent52d11df35ca9846085b910e2e40434b48847d9d8 (diff)
Move trace logging to tracelog.h.
Pixel-wise, comprehensive, beautiful trace logging.
Diffstat (limited to 'vec.h')
-rw-r--r--vec.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vec.h b/vec.h
index d2dece0..e3e15b8 100644
--- a/vec.h
+++ b/vec.h
@@ -10,6 +10,7 @@
#include <ostream>
#include <cassert>
#include <algorithm>
+#include "tracelog.h"
static inline bool eq(int a, int b) {
return a == b;
@@ -134,8 +135,10 @@ struct vec3 {
// TODO test TIR
if (Enable_TIR) {
// ri_inv < sin(a1), cannot refract, must reflect (Total Internal Reflection)
+ TRACELOG(" reflect (TIR, d=%f)\n", d);
return reflect(r1);
} else {
+ TRACELOG(" refract (forced, d=%f)\n", d);
d = -d; // abs, just make the sqrt has a real solution
}
}