diff options
| author | Martin Lehoux <martin@lehoux.net> | 2020-04-04 14:50:39 -0700 |
|---|---|---|
| committer | Martin Lehoux <martin@lehoux.net> | 2020-04-04 14:50:39 -0700 |
| commit | 4fbf7c999dd9aabd19a8b66d32461ad4c2722dc3 (patch) | |
| tree | c4f2d04ce40575f324bacea1efbeb35b536790ff /color.go | |
| parent | d0ad46a4ba7d1b5396a37af1500a8db7ce2be195 (diff) | |
feat - Sky scene
Diffstat (limited to 'color.go')
| -rw-r--r-- | color.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -15,3 +15,8 @@ func LinearBlend(color1 Color, color2 Color, param float64) Color { param*color1.b + (1.0-param)*color2.b, } } + +func RayColor(ray Ray) Color { + 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) +} |
