Skip to content

kddial/ray-tracing-tutorial

Repository files navigation

ray tracing in your browser

Ray tracing a 3d world in the browser using javascript and math calulations are utilizing GPU hardware for fast performance

  • try it out! at https://3d.kevindial.com/
  • on desktop, use WASD to move player and mouse to move screen
  • on mobile, touch bottom left quadrant to move player and touch bottom right quadrant to move screen

video

3d-preview-video.mov

learning ray tracing (path tracer)

resource: https://raytracing.github.io/books/RayTracingInOneWeekend.html

vector library source: https://github.com/evanw/lightgl.js/blob/master/src/vector.js

yarn start
yarn build

benchmarks

Should aim for 16ms.

1. simple javascript
249 ms to render 256 x 256

to debug gpu.js

window.kernalFn = kernal.toString(cameraOrigin, cameraAngle)
console.log(window.kernalFn);

About

Using computer's GPU to ray trace a 3D world in the browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages