aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorMartin Lehoux <martin@lehoux.net>2020-04-04 19:10:08 -0700
committerMartin Lehoux <martin@lehoux.net>2020-04-04 19:10:08 -0700
commit23d71549ebf82d9065de978f50d911bc51931635 (patch)
tree1edde1bf0c646c8a45c2b7cfca40940a08320473 /main.go
parentba7682a761343302fd65f315b0406abc470c482f (diff)
feat - Add ray bouncing
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.go b/main.go
index 61ab73c..291e60f 100644
--- a/main.go
+++ b/main.go
@@ -11,6 +11,7 @@ const WIDTH = 200
const T_MIN = 0.001
const T_MAX = 1000
const RAY_PER_PIXEL = 100
+const MAX_DEPTH = 50
func main() {
LOWER_LEFT_CORNER := Vec3D{-2.0, -1.0, -1.0}
@@ -32,7 +33,7 @@ func main() {
u := (float64(y) + rand.Float64()) / float64(WIDTH)
v := (float64(x) + rand.Float64()) / float64(HEIGHT)
ray := CAMERA.GetRay(u, v)
- color_list[it] = RayColor(ray, WORLD)
+ color_list[it] = RayColor(ray, WORLD, 0)
}
color := ColorMeanSquare(color_list)
frame[HEIGHT-1-x][y] = color.ToPixel()