https://github.com/kach/voxel
Yet another raytracer, because we don't have enough of those already
https://github.com/kach/voxel
Last synced: 4 months ago
JSON representation
Yet another raytracer, because we don't have enough of those already
- Host: GitHub
- URL: https://github.com/kach/voxel
- Owner: kach
- Created: 2017-03-05T18:10:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-05T18:18:41.000Z (over 9 years ago)
- Last Synced: 2025-06-24T10:11:36.283Z (12 months ago)
- Language: Scheme
- Size: 163 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sometime in June 2016 I decided to revisit raytracers, and to see how much of a
raytracer I could build without looking anything up. `voxel.scm` is a full
recursive raytracer optimized for voxels. It uses the Phong illumination model
(ambient + diffuse + specular). Nothing fancy.
`voxel.scm` contains a homemade BMP encoder, and, with appropriate `load-*`
headers, it should work with any R5RS Scheme implementation. I tested it with
Chicken and Racket, and also with Biwas though Biwas was sadly too slow to be
practical.
This is the kind of thing `voxel.scm` can do very quickly:

It turns out you can find a [CT
scan](http://graphics.stanford.edu/data/voldata/voldata.html#bunny) of the
Stanford Bunny online. This is what you get if you approximate it with a
hundred voxels:

For comparison, here's some output from my old (December 2012) raytracer:
