Projects / 2018
lucis
A ray tracer written in Rust with Lua-scripted scene modelling, faster than a similar C++ implementation.
lucis is a ray tracer I built from scratch in Rust: meshes, hierarchical transforms, reflections, soft shadows, the whole classic feature list, rendered one bounced ray at a time.
Two things made it fun. First, I wrote it in Rust at a time when the expected choice was C++, and it ended up outperforming a comparable C++ implementation, an early lesson that you rarely have to trade safety for speed. Second, scenes aren’t described in some rigid config format: they’re Lua scripts. Modelling a scene becomes programming: loops to scatter objects, functions to build recursive structures, which turns out to be a far more natural way to think about composing a world.
I later ported the renderer to WebAssembly as lucis-web, so all of it, Lua scripting included, runs in a browser tab.