~/talk

It's So Shiny! A Pure JavaScript Ray-Tracer

Talkat Build Stuff 2022 · 2022-11-09..11-11· [javascript, creative-coding]
slides:none on file

Pure JavaScript ray tracer that is built from scratch and actually renders shiny spheres on a chessboard in the browser, implementing RGB colors, vectors, spheres/planes/boxes, surface normals, shadows, Phong-like highlights (shininess 0–1) and recursive reflections with a depth cap of 16. Performance gets usable by offloading work to Web Workers, batching pixels via Uint8ClampedArray/ImageData and partitioning into workers roughly equal to physical CPU cores; a 1280-wide scene renders in about 1.55 seconds in the demo and the approach works end-to-end.

AI-written summary · about

  1. 0:00🚀 Build Stuff Conference – Get Your Tickets!
  2. 0:37Introduction to Ray Tracing
  3. 5:11Why Ray Tracing is Slow but So Shiny
  4. 10:43Understanding Ray Tracing with Light and Colors
  5. 15:07Building the Basic Ray Tracer in JavaScript
  6. 20:58Using Vectors for Positioning and Direction in 3D
  7. 25:24Handling Shapes, Intersections, and Rendering Logic
  8. 32:37Adding Lighting, Shadows, and Reflectivity
  9. 39:17Using Web Workers for Optimization in Ray Tracing
  10. 43:21Implementing a Chessboard Scene and Final Thoughts
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.