aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Lehoux <martin@lehoux.net>2020-04-04 19:20:27 -0700
committerMartin Lehoux <martin@lehoux.net>2020-04-04 19:20:27 -0700
commitd233910be5eb6bdf9bb9deb6ffa0fa79f659e902 (patch)
treec277697380b9b59cb3e65ebc3b79336898cddb04
parent23d71549ebf82d9065de978f50d911bc51931635 (diff)
misc - Correct distribution for scattering in lambertian
-rw-r--r--color.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/color.go b/color.go
index 7c7bc58..857bc41 100644
--- a/color.go
+++ b/color.go
@@ -32,6 +32,7 @@ func RayColor(ray Ray, hitable_list HitableList, depth int) Color {
}
hit := hitable_list.Hit(ray, T_MIN, T_MAX)
if hit.time > 0.0 {
+ // TODO: Use the correct distribution
direction := AddVec3D(hit.normal, RandomInUnitSphere())
scattered := Ray{hit.point, direction}
return AttenuateColor(Color{0.5, 0.5, 0.5}, RayColor(scattered, hitable_list, depth+1))