logoalt Hacker News

Distributed Ray Tracer

32 points • by juliusgeo • yesterday at 7:06 PM • 11 comments • view on HN

Hey HN, I'm Julius, I'm a backend engineer at Hatchet and created this demo to show off some of Hatchet's new features, primarily durable streams and serverless endpoints. Those, however, are just background details that made this significantly easier to scale. By distributing the rendering across many different nodes, orchestrated using Hatchet, it makes it possible to render quite high fidelity scenes fairly quickly. All of this would be possible on a single machine, but would be much slower without dedicated hardware (RT cores, etc).

The renderer itself is using well-known ray tracing techniques, with no special considerations there. The renderer is a slightly modified version of https://github.com/ekzhang/rpt, with additional support for SDF scripting using https://docs.rs/fidget/latest/fidget/. SDFs have been popular in the demoscene community, though perhaps not super well known outside of that, and are capable of creating some fantastic looking scenes: https://www.shadertoy.com/view/ld3Gz2. The coolest part here is using a DSL to represent the SDFs in a rendering pipeline, and using LLMs with a chat interface to create them.

The source is available here: https://github.com/hatchet-dev/distributed-ray-tracer


Comments

keithwinstein • yesterday at 10:40 PM

Cool! You might like our paper/demo on ray-tracing 1 TB-geometry scenes using thousands of AWS Lambda workers spun up just for the job: https://r2e2.dev/

This was led by my former PhD student Sadjad Fouladi who did a lot of creative work involving swarms of short-lived serverless functions for video encoding and distributed LLM inference (https://www.usenix.org/conference/nsdi17/technical-sessions/...) and software compilation (https://github.com/stanfordsnr/gg).

➕ show 1 reply
abelanger • yesterday at 10:25 PM

Some more resources on signed distance fields (SDFs), which I didn't know about until this demo:

- https://iquilezles.org/articles/distfunctions/

- The 2D version: https://iquilezles.org/articles/distfunctions2d/ (discussed here: https://news.ycombinator.com/item?id=46380054)

- How Zed uses (used?) SDFs to render their editor: https://zed.dev/blog/videogame (discussed at the time: https://news.ycombinator.com/item?id=35078464)

carterunworthy • yesterday at 9:34 PM

I love Hatchet! A serverless render farm is such a silly idea, results coming in felt really cool though, I'd love to see this scaled up to frames of an animation.

nla • yesterday at 9:57 PM

Some much needed innovation! Well done, old boy.

ginko • yesterday at 10:01 PM

Isn't exposing something like this to the web asking for huge cloudflare bills?

➕ show 1 reply
amelius • yesterday at 10:21 PM

Does it pass the pelican on a bicycle test?

➕ show 1 reply
xyzsparetimexyz • yesterday at 10:11 PM

Yeah.. Or you could just use a gpu?

➕ show 1 reply
omegaSigma95 • yesterday at 10:04 PM

[flagged]

Woshiwuja • yesterday at 10:15 PM

[flagged]