This project is a continued evolution of my previous OOPWithCpp repository, now named GraphicsProgrammingWithCpp to better reflect its focus to now become a GPU Ray Tracer learning project for a different module of my second year university course.
C++ sandbox/learning project focused on OOP-style architecture with a Vulkan renderer and an SDL3 + Dear ImGui application layer. Then a CPU Ray Tracer implementation as a the main rendering backend which sends renderd Images to the Vulkan renderer for display. The project uses Premake to generate Visual Studio solutions with multiple SIMD builds (SSE4.2, AVX2, AVX512). All SIMD builds must be built as the StartProj will link against them based on CPU detection at runtime.
- Vulkan rendering backend (uses
VULKAN_SDK) - SDL3 windowing/input (
OOPWithCpp/3rdParty/Projects/git/SDL) - Dear ImGui UI (
OOPWithCpp/3rdParty/Projects/git/ImGui) glmmath (OOPWithCpp/3rdParty/HeaderOnly/git/GLM)stb_imageloading (OOPWithCpp/3rdParty/HeaderOnly/git/stbImage)- Premake workspace with multiple SIMD builds (
SSE4.2,AVX2,AVX512) - Visual Studio generator support (
vs2022,vs2026) - CPU Ray Tracer rendering backend
- MSVC and Clang support (though I recommend Clang for better optimisations)
- spheres at the moment
- basic materials (diffuse, metal, dielectric)
- diffuse light sources
- single and multi-threaded rendering
- simple split BVH acceleration structure
- scenes
- single red sphere
- 2 grey spheres
- Dielectric Test
- Metal Test
- earth
- Ray Tracing in one weekend final render like scene
OOPWithCpp/— main library/sourceOOPWithCpp/3rdParty/— third party dependencies (git submodules)StartProj/— console app that depends on the library buildsShaderSrc/— shader sources (Slang)premake5.lua— build generation scriptBin/— build outputs (generated)
- Windows (Premake script links Windows system libs)
- Visual Studio 2022 or Visual Studio 2026
- Vulkan SDK installed and
VULKAN_SDKenvironment variable set
- Clone the repo.
- Install Vulkan SDK and verify
VULKAN_SDKis set (e.g.%VULKAN_SDK%/Includeexists). - Generate project files:
- Open a command prompt in the repo root and run:
or for Visual Studio 2026:
Premake5/Premake5.exe vs2022
or use the provided batch files:Premake5/Premake5.exe vs2026
GenerateVS2022.batGenerateVS2026.bat
- You may need to run both
premake5 vs2022andpremake5 vs2026so that both the sln and slnx files are generated. For some reason, Premake does not want to generate the sln file when using the vs2026 action alone. - If you resize the window before you have enabled the ray tracer, it will not update the ray tracer's resolution. Therefor making the image look distorted, this can be fixed by resizing the window again after enabling the ray tracer.
- some times when moving the camera the whole program will soft lock up, this is due to a deadlock in the ray tracer's multi-threading implementation.
- This File has been created with the assistance of AI. Though I have reviewed and edited it.