GrooveStomp's 3D Software Renderer  0.1.0
GrooveStomp's 3D Software Renderer

Introduction

This software renderer is based heavily off of the OneLoneCoder 3D Engine, thus, it also preserves that copyleft license.

This documentation is split into several pages:

Features

Triangle polygons only

There is no automatic tesselation of higher order polygons into triangles, only triangles are supported.

Backface culling

Triangles facing away from the camera are not rendered.

View frustum culling

Triangles outside of the view frustum are not rendered.

View frustum clipping

Triangles that protrude outside of the viewing frustum are subdivided into triangles that lie entirely within the viewing frustum.

Near and far plane clipping

Triangles that protrude outside of the near or far view planes are subdivided into triangles that lie entirely between those two planes.

Obj model loading

Obj files are supported provided the following rules are followed:

The software engine currently assumes which texture will be applied and explicitly loads it out-of-band.

See also
MeshInitFromObj()

Render scaling

An integer scale can be specified as a scale factor. This works by being multiplied separately against the window width and window height; so, for example, an integer scale factor of 3 results in (width x 3) and (height x 3), for a total scaling factor of (3 ^ 2). The scaling works internally by duplicating pixels. So with a scaling parameter of 3 we saw that the resulting scaling factor is 9; what this means is that any given pixel results in 9 total pixels being drawn.

See also
GraphicsInit()

Texture mapping

Perspective-correct texture mapping.

Note that this is only pixel-accurate, so there is substantial aliasing; particularly when render scaling is used.

Solid color polygons

Wireframe polygons

Key Mapping

This 3D renderer is configured to use traditional first person shooter keys.

Key Action
w Move forward
a Move backward
s Strafe left
d Strafe right
left Turn Left
right Turn right

Screenshots

3dsw-texture-cube.png

This screenshot illustrates a fully textured 3d obj file.

3dsw-clipping-terrain.png

This screenshot illustrates debug coloring for the clipping algorithm.

Blue, red and green triangles illustrate where larger triangle polygons have been subdivided into smaller triangles that fit within the viewing frustum and near clipping planes.