A Ray Tracer Implementation in NodeJS based on the book Ray Tracing in A Weekend by Peter Shirley.
DeltaManiac gave a challenge to try Ray Tracing In A Weekend in NodeJS, which he implemented himself in Rust-Lang in here.
Run
npm run cover
under the cloned folder to get this beautiful cover image, rendered purely using JavaScript. It may take a while to render as it involves heavy computation. This image took 46 minutes to render in a i5 6300U Mobile CPU with 16GB RAM. GPU does not affect render times, as it is a software based rendering.
-
Clone/Download this repository
-
Install NodeJS
-
cd
into the cloned folder and runnpm install
to install Jimp for PNG encoding
npm run ex1
npm run ex2
npm run ex3
npm run ex4
npm run ex5
npm run ex6
npm run ex7
npm run ex8
npm run ex9
npm run ex10
npm run ex11
npm run ex12
npm run ex13
npm run ex14
npm run ex15
MIT License
Copyright (c) 2019 Merbin J Anselm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.