Skip to content

xxx/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raytracer

A small ray tracer written in Ruby, based on this excellent series of posts, since I'd never written one before.

Installation

  1. Install Ruby 2.3+
  2. Download this repo
  3. bundle
  4. ruby script.rb

Rendering is done in 4 threads and goes pretty quickly, but the final step of drawing the image can take awhile (sometimes a few minutes, increasing with the size of the output image). This drawing step is handled by ImageMagick.

script.rb has examples of image-based and programmatic textures, and changing to save the rendered image to a file instead of displaying it is a one line change to call .write(filename) rather than display.

http://i.imgur.com/YQpHy0e.png is an example render from this tracer.

About

A little ray tracer written in Ruby

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages