This is a hobby project using DirectX 12 and DirectX RayTracing (DXR). This project is inspired by Peter Shirley and his ray tracing book series: In One Weekend, The Next Week, The Rest of Your Life, Alan Wolfe's blog post series on causual shadertoy path tracing and lastly Physically Based Rendering: From Theory to Implementation by Matt Pharr, Wenzel Jakob, and Greg Humphreys. For those of you who haven't read any of these and would like to explore ray tracing, I highly recommend them!
- Progressive stochastic path tracing
- Importance sampling of BSDFs and multiple importance sampling of lights
- Lambertian, Mirror, Glass, and Disney BSDFs
- Point and quad lights
- ECS with the following implemented components:
- Tag: used to identify a game object
- Transform: controls position, scale, orientation of GameObject
- Camera: controls camera parameters for scene viewing
- Light: used to illuminate the scene, controls light parameters
- Supported types:
- Point
- Quad
- Supported types:
- Mesh Filter: references a mesh in the asset window to be rendered
- Mesh Renderer: controls material parameters and submits the referenced mesh to RaytracingAccelerationStructure for path tracing
- Supported BSDFs:
- Lambertian
- Mirror
- Glass
- Disney
- Supported BSDFs:
- NativeScript: C++ scripting
- Collider: Adds collider to the entity to detect collisions with other rigidbodies with a collider
- Supported Collider:
- Box Collider
- Capsule Collider
- Mesh Collider (WIP)
- Supported Collider:
- Rigid Body: Adds rigidbody physics to the entity and can be applied forces and velocities
- Static Rigid Body
- Dynamic Rigid Body
- Custom scene serialization using json
- Asynchronous resource loading
- Bindless resource
- Utilization of graphics and asynchronous compute queues
- Acceleration structure compaction
- Implement spectral path tracing
- Implement bi-directional path tracing
- Implement wavefront path tracer
- Implement volumetric scattering and sub-surface scattering
- Implement anti-aliasing techniques
- Implement more materials
- Implement more light types (spot, directional, spherical)
- Implement denoising
- Implement custom memory allocator for D3D12 based on resource usage
- Implement D3D12 resource residency management
- SM6.6 Dynamic resource binding
- Add environment lights (Portal-masked environment map sampling) and geometry area lights (Spherical triangle sampling)
- Upgrade from DXR 1.0 to DXR 1.1 (inline raytracing)
- Visual Studio 2019
- GPU that supports DXR
- Windows SDK Version 10.0.19041.0
- Windows 10 Version: 20H2
- CMake Version 3.15
- C++ 20
-
Initialize submodules after you have cloned, use CMake GUI to configure and generate visual studio solution. (I ran bfg-repo cleaner on this repo because I was committing all my assets, the repo is way smaller now with the downside of unable to see old commit file changes)
-
Download assets from ProjectAssets repo and extract the contents into a directory named assets in the root directory of the repo. (There's a build event that'll copy contents from asset to the executable directory)
-
When the project is build, all the assets and required dlls will be copied to the directory of the executable. There is a folder containing all the scenes in the asset directory for the showcase, those can be loaded from the context menu of the Hierarchy window of the application's UI.
Let me know if you have any trouble setting up the project and getting it up and running!
- FidelityFX Super Resolution 1.0 (FSR)
- D3D12 Agility SDK
- DirectX Shader Compiler
- DirectXTex
- WinPixEventRuntime
- EnTT
- imgui
- ImGuizmo
- spdlog
- wil
- json
- assimp
- NVIDIA PhysX
Thanks to Benedikt Bitterli for rendering resources!
- 3D Game Programming with DirectX 12 Book by Frank D Luna
- Direct3D 12 programming guide from MSDN
- DirectX Specs
- Physically Based Rendering: From Theory to Implementation by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
- Ray Tracing Gems: High-Quality and Real-Time Rendering with DXR and Other APIs
- Ray Tracing book series (In One Weekend, The Next Week, The Rest of Your Life) by Peter Shirley
- Real-Time Rendering, Fourth Edition by Eric Haines, Naty Hoffman, and Tomas Möller
- Casual Shadertoy Path Tracing series by Alan Wolfe
- Light Sampling
- Solid angle quadrilateral light sampling: https://www.arnoldrenderer.com/research/egsr2013_spherical_rectangle.pdf