r/computergraphics • u/antahonist • Oct 28 '26
I wrote a tiny software rasterizer in Lua that renders 3D models straight to pixel art
It runs inside Aseprite as a script. No Blender or shaders, just triangles, a z-buffer and a bunch of rounding.
Turns out rendering big and scaling down looks like garbage, so everything is drawn at its final size (32, 64 or 128 px). Lighting is quantized to 4-5 tones per material, outlines come from depth differences between parts, and hard edges get a 1px highlight. Grain is tied to world position so it doesn't crawl around when the model spins.
Bayer dithering only works on light transitions. On 1-2px strips it just turns into a weird zigzag.
Circuit boards were a pain. Traces use A*, but in 2:1 iso you need 2px between parallel lines or they merge. So on a 32px board you're stuck with a tiny 6x4 grid. Bigger sizes look way better.
Still can't get the dithering to look right during rotation. It's screen-space, so it shimmers like crazy. Anyone figured out a way to keep it stable without it sliding around the surface?


