This is a fork of literate-ray-tracer
This is a literate raytracer, written in Javascript. The are all one part: you can understand the implementation by reading it in combination with literate-style code comments.
This is intended as a learning platform for those trying to connect the mathematical and engineering explanations of raytracing and understand the behavior of the algorithm well enough to do interesting things.
Please report and defects here and we'll attempt to address the issue in the next release
Unlike the original, the JavaScript parts of this codebase are written in TypeScript, consequently you'll need some tooling to play.
By JS community standards the requirements are minimal... if there's demand to include the raw JS we can arrange that.
Right now the source is all under src/
in TypeScript files.
You'll need a relatively modern version of node js. With that installed navigate to the source folder and npm install
or alternatively yarn install
npm run dev
or alternativelyyarn dev
will watch for changes to*.ts
files and build anindex.js
. Openindex.html
(the one in the source root) and refresh it to play. Every time you change TS files, the project will auto rebuild, you just need to refresh the browser.npm run build
or alternativelyyarn build
is effectivelydev
mode but it builds the app once
npm run doc
or alternativelyyarn doc
will build the book and put it in the source code'sdoc
folder
In the spirit of the base code, this code and accompanying text is released under CC0, or Public Domain where applicable.