A minimal software rasterizer in C++
- Supports flat, Gouraud, and Phong shading
- Loads
.obj
models and.tga
textures - Outputs rendered images
Wireframes:
Here are some sample outputs demonstrating different shading techniques:
Flat Shading | Gouraud Shading | Phong Shading |
![]() |
![]() |
![]() |
Diablo3 Character:
-
Clone the repository:
git clone https://github.com/Sachinkry/tinyrenderer.git cd tinyrenderer
-
Build the project using CMake:
mkdir build cd build cmake .. make
-
Run the executable:
./main
- A C++ compiler with C++17 support (e.g., g++)
- CMake (version 3.10 or higher)
- The rendered images are saved in the
assets/outputs
directory. - The
.vscode
directory and themain
executable are ignored by Git (see.gitignore
).
g++ -std=c++17 -ggdb -g -pg -O0 -Iinclude -o main src/main.cpp src/tgaimage.cpp src/model.cpp src/shaders.cpp
./main