diff options
| author | Martin Lehoux <martin@lehoux.net> | 2020-04-04 15:40:11 -0700 |
|---|---|---|
| committer | Martin Lehoux <martin@lehoux.net> | 2020-04-04 15:40:11 -0700 |
| commit | 1008f463687a373f5c5d4024d25a09125b6c49ec (patch) | |
| tree | 32c05771f90cb72340bb9f51ab4ad61441332f0c /color.go | |
| parent | 19124e8c21b86dccb9e9d874c614aacb05c0fd4a (diff) | |
feat - Use HitRecord
Diffstat (limited to 'color.go')
| -rw-r--r-- | color.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |
