My very first 3D engine! This is a simple 3D rendering engine using CPU (no GPU), for learning purpose. The main goal of this project was to understand the low-level components of a 3D engine (e.g., rendering pipeline, drawing algorithm, maths for 3D, rendering loop), as well as learning the C++ language. Therefore, I used few libraries and tried to re-implements everything, such as math library and drawing algorithms.
- Math library
- Vectors 2
- Vectors 3
- Vectors 4
- Matrix 3
- Matrix 4
- Matrix Transformations
- Translation
- Scaling
- Rotations
- LookAt
- Perspective
- Project 3D point into 2D screen
- Mesh
- Loading from JSON (.babylon format)
- Rendering
- Draw line
- DDA algo
- Draw filled triangle
- Scanline Algorithm
- Scanline Algorithm with z-buffering
- Scanline Algorithm with z-buffering and Flat-Shading
- Scanline Algorithm with z-buffering and Gouraud Shading
- Draw line
- Render engine
- Render loaded meshes (by default, renders Suzanne monkey)
- Zoom in / out
- SSE4.1 optimization (used by the math library)
Dependencies marked with (CMake) are automatically downloaded by CMake and placed in the dependencies folder. The Others must be installed manually (generally system-wide install).
- SDL2 (Must be installed system-wide)
- Boost property tree (Must be installed system-wide)
- GoogleTest (Downloaded by CMake)
- Uses C++11
- Requires
pragma once
support
# Manual instructions
mkdir build
cd build
cmake ..
make -j2
make runEngine
# Automated script
./build.sh
mkdir build
cd build
cmake ..
make -j2
make runAllTests
# Automated script
./build.sh
As you may see, Gnu and Panda have been working really hard on this project! Sometime, they even forgot to eat the bamboo. (At least Panda, Gnu probably prefers the emacs source code).
Constantin Masson (geekymoose)