Software
Everybody needs to make a spinning cube.
Software rendering is the noble art of living without a GPU.
Basic
The basic setup needed is a buffer for all the pixels and a way to set and get a single pixel. If one is true one use a palette color mode with 256 colors only :).
2D
Lines
Palette Map
A palette map is used to modify a palette index. It can be used to set the light level of images of to get a transparent color.
ColorMap: This maps a single palette index into another. Ex one can have 16 light level colormaps that map a image from full bright CM1 to dark CM16. Each colormap is 256 bytes long and map one palette index to another.
ColorTable: Takes two palette index and lookup a table for a new index. Can be used to get a transparent color.
3D
Surface Rendering
Fill Edge List
- Find top vertex.
- Find left edge and right edge from top vertex.
- Use line algorithm to trace each line down and fill in start, end in edge table for line- When hit a new vertex on each edge change to the new line segment.
- Run until at end vertex
Draw Edge List
- Loop scanlines
- Draw along line from start to end from edge list.
- Polygon Filling
- Polygon Drawing - Part 1 and Part 2
- Flight of Fantasy. p 273-293.
- ZEN. p335-343.
- Triangle Rasterization for Dummies - 2009
Shading
Texture Mapping
- Applying the Texture Mapping Technique - 2000
- Texture Mapping - 1999
- Texture Mapping - 1994
- Texture Mapping Part 1, part 2 , part 3
- ZEN. p659-699.
Clipping
- How to Dynamically Slice a Convex Shape - 2014
- Understanding Sutherland-Hodgman Clipping for Physics Engines - 2013
- A trip through the Graphics Pipeline 2011, part 5
- Cohen Sutherland Clipping - 2007
- Clipping
- Flight of Fantasy. p 376-401
Cull
- Frustum planes from the projection matrix - 2012
- View frustum culling - 2010
- Geometry Culling in 3D Engines - 2000
- 3D Backface Culling - 2000
- Z-Buffering - 1999
- Visible Surface Determination
- Culling your scene to the View Frustum
Surface Caching
The polygons of Another World: Amiga 500
http://fabiensanglard.net/another_world_polygons_amiga500/index.html
The polygons of Another World
http://fabiensanglard.net/another_world_polygons/index.html
The polygons of Another World: Atari ST
http://fabiensanglard.net/another_world_polygons_atariST/index.html
The polygons of Another World: IBM PC
http://fabiensanglard.net/another_world_polygons_PC_DOS/index.html
The polygons of Another World: Sega Genesis
http://fabiensanglard.net/another_world_polygons_Genesis/index.html
Reference
- Software renderer - 2016
- 8088 MPH: Sprites? Where we’re going, we don’t need… sprites! - 2015
- 8088 MPH: The polygons - 2015
- 1K colours on CGA: How it's done - 2015
- 8088 PC Speaker MOD player: How it's done - 2015
- More 8088 MPH how it's done - 2015
- 8088 MPH: We Break All Your Emulators - 2015
- 8088 Domination Post-Mortem, Part 1 - 2015
- 8088 Domination Post-Mortem, Conclusion - 2015
- CGA in 1024 Colors - a New Mode: the Illustrated Guide - 2015
- Just keeping it real… old skool style: 1 2 3 4 4.5 4.6 5 5.1 6 7 8 9 10 10.1 1991 - 2012
- Test Drive’s pixelized transition effect - 2012
- Graphics Programming Black Book - 2002
- Bresenham's Line and Circle Algorithms - 1999
- Computer Graphics 5 12 13 15 17 18 -
- Writing a small software renderer - 2017
- Rasterization in One Weekend - Part I, Part II and Part 3 - 2018
- Rasterization: a Practical Implementation