This project is a reimplementation of my previous raytracer in C#, created in the hopes of making the code more legible, coherent, and usable in a web-based environment.
The limitations of plain JavaScript and scope of the project means that this raytracer, despite its ability to render PBR-based materials, remains single-threaded for the time being. This means high resolutions are likely to make your browser sluggish; 320x240 is recommended for most PCs. WebGL / WebGPU would likely be a better solution for a rewrite in the future than web workers.
You can download the project for yourself and modify index.js
to customize the rendered image; work is in progress to allow you to modify the scene setup from the webpage directly. You can save the final image by right-clicking on the on-screen canvas!
Try a render for yourself at this GitHub pages link!
This project makes use of the seedrandom.js library, which can be found on GitHub at this link.