aboutsummaryrefslogtreecommitdiffstats
path: root/src/metal.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-01-09 20:42:24 +0100
committerladevieq <ladevie.quentin@gmail.com>2021-01-09 20:43:09 +0100
commit2db0d27e7f1744443958717c19b732eed57455f2 (patch)
tree839b8ea513c8c239f015071ab083bd50f03854a5 /src/metal.cpp
parent4379b46b46563c5a709df8d567ef75affc3fd31c (diff)
Replace old classes with compute shader structs
Diffstat (limited to 'src/metal.cpp')
-rw-r--r--src/metal.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/metal.cpp b/src/metal.cpp
deleted file mode 100644
index 196c95d..0000000
--- a/src/metal.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "metal.hpp"
-#include "hittable.hpp"
-#include "vec3.hpp"
-
-metal::metal(const color& albedo, double f)
- : albedo(albedo), fuzz(f < 1 ? f : 1) {}
-
-bool metal::scatter(const ray& r, const struct hit_info& info, color& attenuation, ray& scattered) const {
- auto reflected = reflect(r.direction.unit(), info.normal);
-
- scattered = ray { info.point, reflected + fuzz * random_in_unit_sphere() };
- attenuation = albedo;
- return (scattered.direction.dot(info.normal) > 0.0);
-}