Remix.run Logo
articulatepang 4 hours ago

I went through this a few months ago in Rust. I wrote all the code by hand, no LLMs. Then I went ahead and added a small "game" on top, plus some special effects like pixelization shaders and chromatic aberration at the edge of a flashlight.

https://github.com/kshitijl/tinyrenderer-rs

if anyone is interested! The repo has lots and lots of in-progress screenshots so you can see the renderer come to life, plus all the hilarious visual bugs along the way.

I learned a lot! My biggest lesson, other than the specifics of how rendering works, was that modern CPUs are really fast: a single-threaded CPU renderer can definitely run an interactive 3D game with some fancy special effects.

0x1ceb00da 2 hours ago | parent [-]

Why does it pull in wgpu if it's a software renderer?

grovesNL 2 hours ago | parent | next [-]

In this case wgpu is just providing the surface texture for the window that the software rendered pixels are drawn into.

2 hours ago | parent [-]
[deleted]
2 hours ago | parent | prev | next [-]
[deleted]
LoganDark an hour ago | parent | prev [-]

You do often need a graphics context to create the surface that displays the framebuffer.