Skip to content

jabberwock/rasterm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

rasterm

A 3D software renderer written in Rust, rendered entirely in the terminal. No GPU required.

A software rasterizer built from scratch in Rust. No GPU, no OpenGL β€” pure CPU rasterization rendered to the terminal via ANSI escape codes.

rasterm demo video thumbnail

Features

  • Software rasterization with programmable vertex/fragment shaders
  • Sutherland-Hodgman near-plane frustum clipping
  • Per-pixel depth buffering with bounding-box edge-function rasterizer
  • Perspective-correct texture mapping with bilinear sampling
  • Directional lighting with two-sided Lambertian diffuse + Blinn-Phong specular
  • Keyframe animation system with linear, smooth, and step interpolation
  • Morph target vertex animation (Suzanne smile demo)
  • OBJ model loading with automatic triangle reduction
  • ASCII and 24-bit true color rendering modes
  • Parallel terminal output via rayon
  • Adaptive resolution on terminal resize
  • 5 built-in demo scenes with choreographed camera paths
  • Interactive camera controls (orbit, zoom, pause)

Usage

# ASCII mode (default) - launches demo reel
cargo run --release

# 24-bit true color mode (recommended)
cargo run --release -- --color

# Load a custom OBJ model
cargo run --release -- model.obj --color

# Load with a texture
cargo run --release -- model.obj --texture diffuse.png --color

Controls

Key Action
1-5 Switch demo scene
Tab Next demo
WASD / Arrows Orbit camera (manual override)
+/- Zoom in/out
Space Pause/resume
Q Quit

Demo Scenes

  1. Triforce - Golden Triforce with breathing orbit camera
  2. Suzanne - Blender's monkey head with animated smile morph
  3. Torus - Golden torus with swooping camera
  4. Spaceship - Hand-modeled ship with flyby camera
  5. Goblet - Lathe-turned golden goblet with elegant orbit

Architecture

src/
β”œβ”€β”€ engine/
β”‚   β”œβ”€β”€ raster/       # Rasterizer, clipping, shaders, depth buffer
β”‚   β”œβ”€β”€ render/       # Scene, camera, renderer, materials, textures
β”‚   β”œβ”€β”€ terminal/     # ASCII & color terminal output (parallel)
β”‚   └── animation/    # Keyframe animation with interpolation
β”œβ”€β”€ loader/           # OBJ file loading & geometry reduction
└── main.rs           # App, demos, camera choreography
models/               # Bundled OBJ models (Blender exports)

Building

cargo build --release

License

MIT

About

That thing you never knew you needed πŸ’

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors