diff options
| author | Martin Lehoux <martin@lehoux.net> | 2020-04-04 15:30:25 -0700 |
|---|---|---|
| committer | Martin Lehoux <martin@lehoux.net> | 2020-04-04 15:30:25 -0700 |
| commit | 19124e8c21b86dccb9e9d874c614aacb05c0fd4a (patch) | |
| tree | dfa93ca17be594f1e12f375918c3a85203ffebab /color.go | |
| parent | 4fbf7c999dd9aabd19a8b66d32461ad4c2722dc3 (diff) | |
feat - Display sphere
Diffstat (limited to 'color.go')
| -rw-r--r-- | color.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -16,7 +16,10 @@ func LinearBlend(color1 Color, color2 Color, param float64) Color { } } -func RayColor(ray Ray) Color { +func RayColor(ray Ray, hitable Hitable) Color { + if hitable.Hit(ray) { + return Color{1.0, 0.0, 0.0} + } param := 0.5 * (ray.direction.Unit().y + 1) return LinearBlend(Color{0.5, 0.7, 1.0}, Color{1.0, 1.0, 1.0}, param) } |
