From 1008f463687a373f5c5d4024d25a09125b6c49ec Mon Sep 17 00:00:00 2001 From: Martin Lehoux Date: Sat, 4 Apr 2020 15:40:11 -0700 Subject: feat - Use HitRecord --- color.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'color.go') diff --git a/color.go b/color.go index 3514be6..dbcb47a 100644 --- a/color.go +++ b/color.go @@ -17,7 +17,8 @@ func LinearBlend(color1 Color, color2 Color, param float64) Color { } func RayColor(ray Ray, hitable Hitable) Color { - if hitable.Hit(ray) { + hit := hitable.Hit(ray) + if hit.time > 0 { return Color{1.0, 0.0, 0.0} } param := 0.5 * (ray.direction.Unit().y + 1) -- cgit v1.3