This is a CPU Renderer that renders objects using the CPU , you can use either a ray tracer or a rasterizer to render models, i made this project to learn the graphics pipeline and Windows API , although now it uses FSWindow , a windowing library i made for linux and windows. This project supports rendering OBJ files, with basic lighting (blinn-phong) and includes features for visualization and debugging.
- W, A, S, D: Move the camera.
- Space/CTRL: Move the camera up/down.
- SHIFT: Increase moving speed.
- Mouse: Rotate the camera.
- Key Bindings:
R: Toggle ray tracing/rasterization.X: Change lighting modesG: Lock/unlock the mouse.N: set debugstate to normal modeT: set debugstate to wireframe modeV: disable debugstate.M: set debugstate to depth modeB: Show/hide bounding boxes.C: Toggle backface culling.P: Export the current frame to a PPM file.Q: Reset camera position and rotation.L: Display model details.F: Toggle FXAA anti-aliasing.ESC: Exit the application.
Note : you can also use g++ & gcc or Visual Studio but clang will have least problems as i use it for development
- install clang, cmake and ninja
winget install cmake
winget install LLVM.LLVM
winget install Ninja-build.Ninja
- clone the repo.
git clone --recursive https://github.com/fahad-cpp/Renderer Renderer
cd Renderer
- build using cmake (clang)
cmake --preset clang-release
cmake --build --preset clang-release
bin\Renderer.exe
(use clang-debug for debug build)
other presets that may be available on windows:
gcc-debug/gcc-release # gcc compiler with ninja
vs-debug/vs-release # MSVC compiler with Visual Studio
to check available presets, run:
cmake --list-presets- install clang, cmake and ninja using your package manager
sudo pacman -S clang ninja cmake lld
- clone the repo
git clone --recursive https://github.com/fahad-cpp/Renderer Renderer
cd Renderer
- build using cmake (clang)
cmake --preset clang-release
cmake --build --preset clang-release
./bin/Renderer
(use clang-debug for debug build)
other presets that may be available on linux:
gcc-debug/gcc-release # gcc compiler with ninja
to check available presets, run:
cmake --list-presetsNote:
on Wayland systems the mouse locking does not work so mouse will go out of window
disable mouse lock by pressing G.
you can also move camera using arrow keys




