← projects

graphics · sub-star

cpu_rasterizer

a 3d rendering pipeline in plain javascript, no graphics api at all.



readme

A real-time software rasterizer that runs in the browser with no WebGL and no Three.js. Every triangle of a procedurally generated torus is transformed by hand-written matrices, culled, shaded, depth-tested and written pixel by pixel into a raw byte buffer, which is then blitted to a canvas with putImageData. A GPU does this thousands of times faster, which is not the point: after writing one, nothing in a graphics API is magic anymore.

artifact

solid + z-buffer · toggle below

not simulated: the real pipeline, shrunk. barycentric fill and a 1/w depth test, per pixel.

signal log

built with

JavaScriptReactViteCanvas

open the live demo →
view repository →