A lightweight C++20 software rasterizer with no third-party dependencies.
- No External Libraries – Pure C++20 implementation.
- Deferred Rendering – Efficient lighting and shading.
- Global Illumination – Supports advanced techniques:
- Reflective Shadow Maps (RSM)
- Screen Space Reflections (SSR)
- Screen Space Ambient Occlusion (SSAO)
- Texture Sampling – Supports uv coordinates.
- Normal Mapping – Enhances surface detail.
- Exponential Fog – Realistic atmospheric effects.
- Shadow Mapping – Real-time shadow rendering.
- Anti-Aliasing – High-quality edge smoothing.
- Super Sampling Anti-Aliasing (SSAA)
- Fast Approximate Anti-Aliasing (FXAA)
- Performance Optimization – Utilizes OpenMP and tile-based rendering.
I can compile successfully on Windows using MSVC (VS 2022) and GCC (MinGW).
cmake -G "Visual Studio 17 2022" -B build
cmake --build build --config Releasecmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -B build
cd build
mingw32-make.exeThe program uses std::cout to output in PPM (P3) format and outputs to a .ppm file using the following command line.
.\rasterizer.exe > xxx.ppmUsing 4x SSAA will cost more memory and time.
4x SSAA: Off
Application Set Up: 0.0924653 seconds
Shadow Passes: 0.145654 seconds
Geometry Passes: 0.170903 seconds
SSAO Passes: 1.1425 seconds
Shading Pass: 1.21045 seconds
SSR Pass: 1.31 seconds
FXAA Pass: 1.43453 seconds
Done.This project is licensed under the MIT License.




