A simple CPU-based rasterization renderer implemented from scratch as a part of my computer graphics learning journey,
stb_image and stb_image_write for image read and write.
eigen for vector and matrix computation.
argparse for command-line arguments parse.
All of them are located in external already.
- Clone this repository
git clone https://github.com/KeqiZeng/cpurenderer. - Change directory to
cd cpurenderer. make release. The executable file./build/cpurendereris generated.
cpurenderer assets/african_head --camera_position 0.5 0.6 1.6 --light_position 1.5 2.5 2.5
cpurenderer assets/boggie --camera_position 0.4 0.8 1.6 --light_position 1.5 2.5 2.5
cpurenderer assets/boggie_on_floor --camera_position 0.8 1.2 2.4 --light_position 1.5 2.5 2.5
cpurenderer assets/diablo3_pose --camera_position 0.5 0.6 1.6 --light_position 1.5 2.5 2.5
cpurenderer assets/diablo3_pose_on_floor --camera_position 0.8 1.2 2.4 --light_position 1.5 2.5 2.5
cpurenderer assets/floor --camera_position 0.8 1.2 2.4 --light_position 1.5 2.5 2.5
✅ Complete graphics pipeline
✅ View frustum culling for model
✅ Back face culling for primitives
✅ Blinn-Phong reflection model
✅ Phong shader
✅ Texture mapping with bilinear interpolation and perspective correction
✅ Shadow map
✅ Theoretically programmable vertex and fragment shader
❌ Assume the OBJ models are triangulated
❌ No triangle clipping in clip space. If any vertex of an triangle is outside the clip space, the triangle will be discard. (to avoid annoying wrap-around issue). That's why the floor looks incomplete in some pictures.
This project is licensed under the MIT License.





