NOW LET US – AI RAG SaaS Studio TP.HCM
NOW LET US
Digital Product Studio
Back to news
DEV-TOOLS...1 min read

Jax's true calling: Ray-Marching renderers on WebGL

Share
NOW LET US Article – Jax's true calling: Ray-Marching renderers on WebGL

Exploring how JAX's GPU acceleration and auto-differentiation can be repurposed from machine learning to create high-performance 3D graphics renderers in the browser.

JAX’s true calling: Ray-Marching renderers in Python on WebGL

Why, though?

JAX is widely known for GPU accelerated functions over n-dimensional arrays, built-in compile-time differentiability, and auto-vectorization. While typically used for Machine Learning, it is also an incredible tool for a graphics renderer.

An animated 3D image is essentially a 3-dimensional array (or tensor). By defining its content from the output of a function—starting from mouse position and time input, then applying math—pixels are painted. With JAX, this can be achieved in about 100 lines of Python code, exported to run on the browser via WebGL.

Distances and SDFs

Instead of drawing polygons, this approach uses Signed Distance Functions (SDF). These functions define an object by the distance to its surface (negative inside, positive outside).

  • Composability: You can create unions of objects by taking the minimum of their SDFs, or intersections by taking the maximum.
  • Ray-marching: If the closest point to an object is a length L away, you can move by length L in any direction without hitting it. This is the core of the sphere tracing algorithm.

Vectorization and Gradients

JAX shines in its ability to transform functions:

  • vmap: Using vmap, we can transform functions assigned to single pixels into functions that compute all pixels of an image in parallel.
  • Automatic Differentiation: The gradient of the SDF is the normal to the surface. With JAX's jax.grad, light diffusion and reflection can be calculated at compile-time with mathematical purity, avoiding run-time epsilon tricks.

Mechanical Sympathy for Maths

JAX allows the code to be 70% math, acting as a high-level DSL that stays very close to the metal. It bridges the gap between complex mathematical expressions and high-performance GPU execution.

© 2026 Now Let Us. All rights reserved.

Source: Hacker News

Advertisement
Ad slot ready: 5887729102

More in this category

NOW LET US Related – GLM 5.2 Is Out

dev-tools

GLM 5.2 Is Out

Zhipu AI has officially released GLM-5.2, its most powerful open-source model to date, featuring a 1M context window and advanced long-horizon task capabilities. The release underscores Zhipu's commitment to open-source AI and global scientific collaboration amid rising technological restrictions.

NOW LET US Related – Noise infusion banned from statistical products published by Census Bureau

dev-tools

Noise infusion banned from statistical products published by Census Bureau

The U.S. Department of Commerce has banned "noise infusion" from statistical products published by the Census Bureau, a decision that could have severe consequences for both data utility and privacy protection.

NOW LET US Related – Treating pancreatic tumours may have revealed cancer's master switch

dev-tools

Treating pancreatic tumours may have revealed cancer's master switch

A promising new drug called daraxonrasib has shown breakthrough results in treating pancreatic cancer, doubling median survival times. This achievement could pave the way for an entirely new class of cancer treatments.

NOW LET US Related – Every Frame Perfect

dev-tools

Every Frame Perfect

In UI design, perfection isn't just about the start and end states, but every single transition frame in between. Polishing these micro-interactions is key to building user trust.

NOW LET US Related – Leaving Mozilla

dev-tools

Leaving Mozilla

A poignant and candid reflection from a 15-year Mozilla veteran upon their departure. The author highlights the leadership's missteps in trying to emulate tech giants and urges Mozilla to return to its core values: community and uniqueness.

NOW LET US Related – Shepherd's Dog: A Game by the Most Dangerous AI Model

dev-tools

Shepherd's Dog: A Game by the Most Dangerous AI Model

A developer tested Anthropic's latest, supposedly 'too dangerous' AI model by asking it to build a long-held game idea in a single shot. The model succeeded, generating a complete 2,319-line game after a 45-minute reasoning session.

EXPLORE TOPICS

Discover All Categories

Deep dive into the specific technology sectors that matter most to you.