bennett000 / literate-raytracer

a literate raytracer in javascript and web gl

Home Page:https://literate-raytracer.michaeljbennett.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Literate Ray Tracer Fork

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.

See It Live Here

Please report and defects here and we'll attempt to address the issue in the next release

Having Fun With The Code

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.

Installing Dependencies

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

Running in Dev Mode

  • npm run dev or alternatively yarn dev will watch for changes to *.ts files and build an index.js. Open index.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 alternatively yarn build is effectively dev mode but it builds the app once

Building The Book

  • npm run doc or alternatively yarn doc will build the book and put it in the source code's doc folder

License

In the spirit of the base code, this code and accompanying text is released under CC0, or Public Domain where applicable.

About

a literate raytracer in javascript and web gl

https://literate-raytracer.michaeljbennett.info


Languages

Language:TypeScript 94.1%Language:CSS 5.4%Language:HTML 0.4%