diff options
Diffstat (limited to 'raytracer.hs')
-rw-r--r-- | raytracer.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/raytracer.hs b/raytracer.hs index fa960f8..0ade439 100644 --- a/raytracer.hs +++ b/raytracer.hs @@ -55,10 +55,10 @@ beta2 = 120 * degrees floorscale = 4 -w = 192 * 6 -h = 108 * 6 +w = 192 * 8 +h = 108 * 8 -oversampling = 2 -- each pixel is oversampling^2 rays +oversampling = 4 -- each pixel is oversampling^2 rays black :: Color black = (0,0,0) @@ -187,9 +187,9 @@ checkerboard_pattern x y attn intersect_floor :: Coord -> Direction -> (Coord, Double, Color) intersect_floor source (alpha, beta) + | beta <= 90*degrees = ((x, y, z), 0, (128, 128, 128))--checkerboard_pattern x y 128) | x > (-0.5) && x < 0.5 = ((x, y, z), t, (0, attn, attn)) -- x near 0 : cyan | y > (-0.5) && y < 0.5 = ((x, y, z), t, (attn, attn, 0)) -- y near 0 : yellow - | beta <= 90*degrees = ((x, y, z), 0, (128, 128, 128))--checkerboard_pattern x y 128) | otherwise = ((x, y, z), t, checkerboard_pattern x y attn) where attn = max 0 (round (255 - 4*(sqrt $ abs t))) ((x, y, z), t) = intersect_point_floor source (alpha, beta) |