Remix.run Logo
▲ Distributed Ray Tracer(ray.hatchet.run)
47 points by juliusgeo a day ago | 18 comments

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

▲leecommamichael 12 hours ago | parent | next [-]

> This demo renders images through a ray-tracing technique called Signed Distance Fields.

The first sentence on the site demonstrates a lack of understanding of the program. Signed distance fields are a representation of an implicit surface, which is sampled by fragments (pixels.) They have mathematical properties which make them simple to render in a realistic manner via something like ray-tracing or ray-marching. These properties also enable the fields to compose into more complex shapes.

▲juliusgeo 8 hours ago | parent [-]

Yeah, I think that phrasing was slightly misleading. I was attempting to make it more understandable for the non graphics programmer audience, but you are of course right that SDFs are not necessarily a technique solely for ray tracing, though I haven't really seen them used outside of ray/path tracers.

▲keithwinstein a day ago | parent | prev | next [-]

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).

▲abelanger a day ago | parent [-]

(I work on Hatchet)

This is really neat! Especially the global illumination that passes ray data between nodes, much fancier than what we've done here. You could imagine each component as an actor that receives messages via async channels (though perhaps it's more deterministic than that?).

I think bursting on serverless for massively parallelizable problems is a really interesting use-case. We were partially inspired for this demo by one of our users doing energy simulations at massive scale, who built a library called Scythe for this purpose: https://github.com/szvsw/scythe

▲abelanger a day ago | parent | prev | next [-]

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 a day ago | parent | prev | next [-]

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 a day ago | parent | prev | next [-]

Some much needed innovation! Well done, old boy.

▲ginko a day ago | parent | prev | next [-]

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

▲juliusgeo a day ago | parent [-]

Yes, we have a lot of various infra credits that we are using to serve this. Cloudflare workers are pretty cheap, though.

▲amelius a day ago | parent | prev | next [-]

Does it pass the pelican on a bicycle test?

▲abelanger a day ago | parent [-]

I'm not sure if "pass" is the right word, but it does _something_: https://imgur.com/a/WSYUh89

▲keyle a day ago | parent | prev | next [-]

Who is paying for the SOL tokens?

▲ a day ago | parent | prev | next [-]
[deleted]
▲xyzsparetimexyz a day ago | parent | prev | next [-]

Yeah.. Or you could just use a gpu?

▲juliusgeo a day ago | parent [-]

Unfortunately GPUs are also expensive. This is more so an exploration of the idea--there's a lot more performance that could be squeezed out of the actual rendering itself. Hatchet does let you use serverless operators with essentially anything that can serve two REST endpoints, though, so modifying this to use GPUs to render would be relatively trivial.

▲ a day ago | parent | prev | next [-]
[deleted]
▲omegaSigma95 a day ago | parent | prev | next [-]

[flagged]

▲Woshiwuja a day ago | parent | prev [-]

[flagged]