Jax's true calling: Ray-Marching renderers on WebGL
5 hours ago
- #ray-marching
- #WebGL
- #JAX
- JAX enables GPU-accelerated functions over n-dimensional arrays with built-in compile-time differentiability and auto-vectorization.
- The article demonstrates using JAX for a ray-marching graphics renderer with Signed Distance Functions (SDFs) in Python, which can run on WebGL in a browser.
- SDFs are composable (e.g., using min for union, max for intersection), allow safe movement via sphere tracing, and their gradients provide surface normals for lighting.
- JAX's vmap enables vectorization to compute all image pixels in parallel, and its grad function simplifies normal calculation without run-time epsilon tricks.
- Potential future explorations include WebGPU support via jax-js, geometric algebra with JAXGA, and linking neural networks to SDFs using JAX's experimental features.