deemount / goxgl

My little software 3D renderer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

goxgl

A purely software (no OpenGL or DirectX) realtime 3D renderer, that I’m trying to build to learn some math and magic behind 3D graphics. It uses raylib for window management and delivering pixels to the screen, but all the rendering is done from scratch in Go with no external libraries.

render-demo.mp4

Result of loading a model of a Doom map converted to OBJ format

Building

For this, you may need a C compiler and additional dependencies required by raylib. See https://github.com/gen2brain/raylib-go#requirements for details.

$ make build

Running

$ ./goxgl models/suzanne.obj

Camera uses WASD + mouse to move around (like in most first-person games). ESC key closes the window. There is also a bunch of keys to toggle different rendering options like wireframe, texturing, backface culling, etc.

Features

  • Wireframe rendering
  • Backface culling
  • Affine texture mapping
  • Perspective correct texture mapping
  • Flat shading
  • Z-buffering
  • View frustum clipping
  • OBJ file support (with MTL files) - only triangulated
  • Parallel tile-based rendering
  • Multi-object scenes support

Resources

About

My little software 3D renderer


Languages

Language:Go 98.9%Language:Makefile 1.1%