Performant TypeScript shaders: breaking down the Jelly Slider
summary
Shows TypeScript compiled to GPU code using TypeGPU compiles TypeScript to GPU shaders, not by running JS on the GPU, and uses that to build a jelly slider renderer and physics engine. Implements ray marching with SDFs, caches a 2D distance field into a 256x128 precomputed distance texture to cut work from ~9 ms to ~0.3 ms per frame, and runs a 60 MB neural depth model on-device at 7–8 ms inference, all real-time in the browser.
AI-written summary · about
chapters (19)
- 0:00Introduction to talk
- 1:50What is a shader
- 3:15TypeScript to GPU compilation
- 5:00GPU memory types
- 6:46Dispatching GPU threads
- 8:12Why TypeScript shaders
- 9:17Advantages of browser GPU
- 10:19Breaking down abstractions
- 12:47Rendering triangles to screen
- 14:13Beyond triangles with ray marching
- 16:20Distance fields for rendering
- 19:10Shading and transparency
- 21:18Jelly slider representation
- 22:41Ambient occlusion basics
- 24:45Optimizing ray marching
- 26:50Texture caching benefits
- 27:34Resource-based optimization
- 28:17Neural networks on GPU
- 30:24TypeGPU resources and demos
