diff options
Diffstat (limited to 'lib/camera.rb')
-rw-r--r-- | lib/camera.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/camera.rb b/lib/camera.rb index f8721bb..6a3b190 100644 --- a/lib/camera.rb +++ b/lib/camera.rb @@ -1,8 +1,9 @@ class Camera - def initialize(width = 100, aspect = 1.0, aliasing = 10) + def initialize(width = 100, aspect = 1.0, aliasing = 10, depth = 10) @width = width @aspect = aspect @aliasing = aliasing + @depth = depth # Height @height = (@width / @aspect).to_i @@ -40,7 +41,7 @@ class Camera @width.times do |col| p_colour = Colour.new @aliasing.times do - p_colour += get_ray(row, col).colour(world) + p_colour += get_ray(row, col).colour(world, @depth) end puts (p_colour / @aliasing).to_ppm end |