Interactive physically based GPU path tracer from scratch written in C++ using CUDA and OpenGL.
- Interactive camera with thin lens approximation: FOV, defocus blur
- Triangle meshes with an SAH-based BVH (built on the CPU, ray traversal on the GPU)
- The BVH is split into two parts: a top level structure (TLAS) and a bottom level structure (BLAS). This allows for multiple instances of the same mesh as well as dynamic scenes with object transforms
- Model loader: obj, ply, fbx, glb, gltf, 3ds, blend with Assimp
- Texture mapping (diffuse, emissive)
- HDR environment maps
- Materials:
- Diffuse BSDF (Lambertian)
- Rough dielectric BSDF (Beckmann microfacet model based on the paper Microfacet Models for Refraction through Rough Surfaces)
- Rough conductor BSDF
- Importance sampling: cosine weighted for diffuse materials, VNDF for dielectrics
Nexus requires the following:
- Microsoft Visual Studio
- Nvidia's CUDA Toolkit
- CMake 3.22 or higher
-
Clone the repository
git clone --recurse-submodules https://github.com/Patoche692/Nexus
-
Launch the setup.bat script. It will generate a Visual Studio solution in the build folder
Alternatively, you can generate the solution via cmake:
mkdir build cd build cmake ..
-
Open the Visual Studio solution. Right click on the Nexus solution and set it as startup project. Press F5 to build the project
- Go to file -> open to load a new scene. The model loading is not multithreaded and the BVH construction might take some time depending on the model size
- Controls: hold right click and use WASD keys to move and the mouse to change the camera orientation
- You can change the meshes and camera properties in the UI
- GLFW and GLEW
- glm
- CUDA 12.4
- CUDA math helper for common operations on CUDA vector types
- Assimp for model loading
- ImGui for user interface
- stb for importing and exporting images
- Ray Tracing in one weekend series
- Accelerated Ray Tracing in one weekend in CUDA
- Physically based rendering book
- Ray Tracing Gems II: Next Generation Real-Time Rendering with DXR, Vulkan, and OptiX
- The Cherno's Ray tracing series
- ScratchPixel website
- Jacco Bikker's guides on fast SAH-based BVH construction