This is a shader-based software renderer written from scratch. It is written in C89 with minimal dependencies, available for Windows, macOS, and Linux.
- Cross-platform (Windows, macOS, and Linux)
- Minimal dependencies
- Shader-based
- Real-time
- Blinn–Phong reflection model
- Physically based rendering (PBR)
- Metalness workflow
- Specular workflow
- Image-based lighting (IBL)
- Normal mapping
- Shadow mapping
- Cubemapped skybox
- Skeletal animation
- Orbit camera control
- Back-face culling
- Homogeneous clipping
- Perspective-correct interpolation
- Depth testing
- Alpha testing
- Alpha Blending
- Mesh loading (obj, gltf)
- Image loading (tga, hdr)
Binaries for Windows, macOS, and Linux are available.
To build the renderer from source, a C89 compiler and development files for your window system are required.
Install Visual Studio and
run build_win32.bat
.
Install Xcode and
run build_macos.sh
.
Install GCC and Xlib with the following commands and run build_linux.sh
.
sudo apt install gcc libx11-dev
sudo dnf install gcc libX11-devel
sudo zypper install gcc libX11-devel
If the renderer is launched without arguments, one of the available scenes (see below) will be chosen randomly. To display a specific scene, additional arguments should be supplied. The command line syntax is:
Viewer [test_name [scene_name]]
- Orbit: left click and drag
- Pan: right click and drag
- Zoom: scroll up or down
- Rotate lighting: A D S W
- Reset everything: Space
Scene | Screenshot | Command |
---|---|---|
Azura | Viewer blinn azura |
|
Centaur | Viewer blinn centaur |
|
Craftsman | Viewer blinn craftsman |
|
Elf Girl | Viewer blinn elfgirl |
|
Kgirl | Viewer blinn kgirl |
|
McCree | Viewer blinn mccree |
|
NieR 2B | Viewer blinn nier2b |
|
Phoenix | Viewer blinn phoenix |
|
Witch | Viewer blinn witch |
|
Assassin | Viewer pbr assassin |
|
Crab | Viewer pbr crab |
|
Dieselpunk | Viewer pbr dieselpunk |
|
Drone | Viewer pbr drone |
|
Helmet | Viewer pbr helmet |
|
Junkrat | Viewer pbr junkrat |
|
Ornitier | Viewer pbr ornitier |
|
Pony Car | Viewer pbr ponycar |
|
Spheres | Viewer pbr sphere |