edin / raytracer

Performance comparison of various compilers
MIT License
57 stars 22 forks source link

crystal-raytracer.cr #9

Closed jzakiya closed 3 years ago

jzakiya commented 3 years ago

Crystal translation of Ruby raytracer. Many times faster. Requires stumpy_png shard. Compile and run as follows.

  1. To use stumpy_png shard, create file (provided): shard.yml
  2. Place it in the same dir|folder as the source crystal-raytracer.cr file.
  3. Run (need internet connection): $ shards init then $ shards install
  4. Compile source file: $ crystal build crystal-raytracer.cr --release
  5. Run compiled code: $ ./crystal-raytracer
  6. A crystal-raytracer.png file will be created in dir|folder which you can view.
jzakiya commented 3 years ago

Shard file is:

shard.yml

name: shards
version: 1.2.3
crystal: '>= 0.34.0'

dependencies:
  stumpy_png:
    github: stumpycr/stumpy_png
    version: "~> 5.0"