A 3D software renderer written in Go from scratch. Every pixel is computed on the CPU into a flat color buffer; no GPU rasterization is used. Ebiten is used only to open a window, blit the finished color buffer to the screen, and handle input, so the renderer itself stays a pure software pipeline that also compiles to WebAssembly and runs in the browser.

This project follows the Pikuma “3D Computer Graphics Programming” course, reimplemented in idiomatic, generic Go rather than the course’s C.

Model is provided by Kenny.nl.

Browse the source code on Github

Because everything on this page is rendered by software instead of hardware, your frame rate will mostly depend on your computer’s CPU.

Live demo

The renderer below is the same single Go codebase compiled to WebAssembly and running in your browser. Click inside the canvas to capture the mouse. WASD + arrow keys move, 16 switch render modes, C/X toggle back-face culling, and Esc releases the mouse. Use Fullscreen for a larger view.

Features

  • Wavefront .obj mesh loading with PNG/JPG diffuse textures
  • Perspective projection with a configurable field of view
  • Matrix transform pipeline (scale, rotate, translate, view/look-at)
  • Back-face culling
  • Frustum clipping against all six planes
  • Flat shading from a directional light
  • Z-buffering for correct depth ordering
  • Two rasterizer backends, selectable at runtime:
    • Flat-bottom/flat-top scanline rasterization
    • Pineda (edge-function / barycentric) rasterization
  • Perspective-correct texture mapping
  • A free-look FPS camera (keyboard, mouse, and on-screen touch controls)
  • Native desktop and WebAssembly browser targets from a single codebase
  • Generic numeric core (float32/float64) via Go generics