aboutsummaryrefslogtreecommitdiffstats
path: root/src/lambertian.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/lambertian.cpp
parent4379b46b46563c5a709df8d567ef75affc3fd31c (diff)
Replace old classes with compute shader structs
Diffstat (limited to 'src/lambertian.cpp')
-rw-r--r--src/lambertian.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/lambertian.cpp b/src/lambertian.cpp
deleted file mode 100644
index 16ab146..0000000
--- a/src/lambertian.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "lambertian.hpp"
-#include "hittable.hpp"
-
-lambertian::lambertian(const color& albedo) : albedo(albedo) {}
-
-bool lambertian::scatter(const ray& r, const struct hit_info& info, color& attenuation, ray& scattered) const {
- // auto scatter_direction = info.normal + random_in_unit_sphere();
- // auto scatter_direction = info.normal + random_unit_vector();
- auto scatter_direction = info.normal + random_in_hemisphere(info.normal);
-
- if (scatter_direction.near_zero()) {
- scatter_direction = info.normal;
- }
-
- scattered = ray { info.point, scatter_direction };
- attenuation = albedo;
- return true;
-}