Uncategorized

A Software Rasterizer in Rust

Posted on

Two things I wanted to learn recently: the Rust language, and low-level graphics programming techniques. I also wanted to gain some freedom from the Unity engine. I had previously gone through the excellent book Raytracing in One Weekend, and wanted more! Building a software renderer seemed like a good way to go. Check out the code on Github Project goals: Learn to implement basic versions of modern graphics staples behind rasterization pipelines. No existing libraries may be used for graphics. I write all the code that produces a buffer of [R,G,B] pixels, and that gets sent to the screen. Derive proofs of all theorems used I may be guided by derivations done by others as guides, but I want to have gone through, and grokked, all of the algebra. I’ve long felt that I lacked proper mathematical background, so this was a big one. As a test: a week after learning a new trick I would sit down and re-derive it on my own, on paper, from first principles Along the way I’ve used several key resources to piece things together: ScratchAPixel’s Rasterization tutorials Fabian Giesen’s series on rasterization Eric Lengyel’s Foundations of Game Engine Development N.J. Wildberger’s Linear Algebra course on youtube From those places in turn there are lots of juicy papers to find. I chose SDL2 as a means to show CPU-side pixel buffer on the screen, and to enable user input later. With that included in the project, I was ready to get going. Bresenham‘s line […]

Uncategorized

Some Open Source Projects

Posted on

Hey folks! After Volo Airsport I’ve worked on a number of things, among which some personal open source projects. Today I’d like to show you a few of them! Rain World Mod Loader First up, here’s Rain World Mod Loader: It consists of: A patcher that takes the Unity assembly from the game files, and injects the hooks needed to start loading custom code. A small modding framework with which to start writing mods. Each mod is built as a separate assembly, which receives a callback on initialization. From there each mod can start hooking into Rain Word’s existing systems. I had a lot of fun learning about the nuts and bolts of DotNot assemblies, the assembly-like Intermediate Language found within, and getting it to do my bidding. This also introduced me to the wonderful tool called dnSpy, which you can use to decompile and browse any DotNot executable or assembly! Well, as long as the code has not been obfuscated. Ever since using this to explore Rain World’s code, any time I come across a new Unity-based game I’ll open it up in dnSpy. It’s such a great opportunity to learn, as you can see how other programmer did particular things. Burst Renderer Here’s Burst Renderer: It’s a CPU-based ray tracer based on Peter Shirley’s Raytracing in one Weekend book series, which I can strongly recommend if you’re looking to try your hand at some graphics programming. Specifically, this was one of my first non-trivial projects for which I […]

Uncategorized

Hello world!

Posted on

It’s time for a new blog! There’s lots of writing on programming and design I want to share, and I need a place to put it all. Expect posts on: Rust Unity Real-time simulation Graphics Machine Learning & AI Sound & Music While I’m setting things up, here’s a random snipped of C# for you to look at.