https://github.com/jsdf/applescript-raytracer
a raytracer written in applescript
https://github.com/jsdf/applescript-raytracer
Last synced: 4 months ago
JSON representation
a raytracer written in applescript
- Host: GitHub
- URL: https://github.com/jsdf/applescript-raytracer
- Owner: jsdf
- Created: 2021-01-19T07:48:50.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-01T15:55:50.000Z (over 5 years ago)
- Last Synced: 2025-12-31T11:59:27.794Z (6 months ago)
- Language: AppleScript
- Size: 773 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# applescript-raytracer
an implementation of [raytracing in one weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html) in applescript
example render:

this render took about 1 hour parallelized across 8 cpu cores
to run it yourself:
```sh
./raytracer.applescript
```
this will output a [ppm image file](https://en.wikipedia.org/wiki/Netpbm#PPM_example) named `output_[timestamp].ppm`
to spawn multiple worker processes, to take advantage of multiple cpu cores, run the script with the `smp` argument. no logging of incremental progress will be shown in this mode
```sh
./raytracer.applescript smp
```
you can edit `renderConfig` property [defined at the top of raytracer.applescript](raytracer.applescript#L7) to adjust the resolution, rays per pixel, and max bounces per ray, which will substantially affect the time taken to render.
you can also change the `randomSeed` property to generate a different random layout of the smaller spheres
with a few small changes the code also [runs on classic mac os](https://twitter.com/ur_friend_james/status/1353168983122464769)