一个基于Vulkan的实时路径跟踪渲染器,目标是实现 质量 和 效率 能用于 实时 的路径跟踪渲染。
不同于目前游戏中实装的各种光追辅助技术,本项目的目标是最接近GroundTruth的路径跟踪, 并提供最接近游戏的运行时环境,验证实时光追的可行性,并实验最新的GPU特性,为下一代渲染架构作准备。
本项目的初衷是:学习,验证,进步。因此,会激进的使用最新技术,有意的规避陈旧技术,利用新c++规范和标准库,全时跨平台开发。
- 渲染器: 主项目,路径追踪,benchmark
- 编辑器: 基于imgui的编辑器框架,用于编辑场景,完全依赖glb的读写
- MagicaLego: 类似MagicaVoxel的乐高搭建游戏,全实时路径追踪渲染,用以验证目标
githubShow.mp4
10 seconds Showcase Video
RayTracing Renderer - QX50
RayTracing Renderer - City
RayTracing Renderer - Still
RayTracing Renderer - PlayGround
RayTracing Renderer - LuxBall
RayTracing Renderer - Kitchen
RayTracing Renderer - Living Room
Hybrid Renderer (Android) - QX50
Hybrid Renderer (Android) - Complex Cubes
-
Rendering
- Importance Sampling
- VNDF Sampling for GGX, by tigrazone
- Adaptive Sampling, thanks tigrazone
- Ground Truth Path Tracing
- Phsyical Light Unit
- Temporal Reproject
- High Performance Bilateral Filter Denoiser
- OpenImageDenoise Denoiser* (need sdk)
- RayQuery on Android
- Visibiliy Buffer Rendering
- Legacy Rendering
- RayTraced Hybrid Rendering
- Realtime Renderer Switch
- GPU Draw
- GPU Raycast
-
Scene Management
- Wavefront OBJ File PBR Scene Support
- Full GLTF Scene File Support
-
System
- CrossPlatform support for Windows/Linux/MacOS/Android
- EditorApp including node based MaterialEditor
- Global Bindless TexturePool
- MultiThread Resource Loading
- HDR Display Support
- Benchmark System
- Screenshot HDR and encode to avif / jpg
- 下载最新Release版本,通过bin/*.exe直接启动
- 从头构建运行
首先,需要安装 Vulkan SDK。各个平台根据lunarG的指引,完成安装。其他的依赖都基于 Microsoft's vcpkg 构建,执行后续的脚本即可完成编译。
项目的Github Action包含windows,linux,android的自动ci脚本,作者会维护其正确性。如有任何环境问题可参阅解决。
本地开发环境部署完成后,各平台可按一下脚本构建
Windows (Visual Studio 2022)
vcpkg_windows.bat
build_windows.bat
Windows (MinGW)
init the MSYS2 MINGW64 shell with following packages,the MSYS2's cmake is not competible with vcpkg, so use cmake inside.
pacman -S --needed git base-devel mingw-w64-x86_64-toolchain ninja
cmake's module FindVulkan has a little bug on MingGW, try modified FindVulkan.cmake as below set(_Vulkan_library_name vulkan) -> set(_Vulkan_library_name vulkan-1) then, execute scripts bellow
vcpkg_mingw.sh
build_mings.sh
Android On Windows
JAVA SDK should be JAVA17 or higher Install Android Studio or Android SDK Tool, with NDK 25.1.8937393 installed
set ANDROID_NDK_HOME=\path\to\ndk
#like: set ANDROID_NDK_HOME=C:\Android\Sdk\ndk\25.1.8937393
vcpkg_android.bat
build_android.bat
deploy_android.bat
Linux
各平台需要提前安装对应的依赖,vcpkg才可以正确运行。
例如,ubuntu
sudo apt-get install ninja-dev curl unzip tar libxi-dev libxinerama-dev libxcursor-dev xorg-dev
./vcpkg_linux.sh
./build_linux.sh
SteamDeck Archlinux
sudo steamos-readonly disable
sudo pacman -S devel-base ninja
./vcpkg_linux.sh
./build_linux.sh
MacOS
brew install molten-vk
brew install glslang
brew install ninja
./vcpkg_macos.sh
./build_macos.sh
- Pure GPU AuxRenderer, display gpu helpers
- WireFrame Rendering
- Realtime Renderer Switch
- GPU Frustum / Occulusion Culling
- GPU Lod Swtiching
- Dynamic Scene Management
- Multi Material Execution
- Huge Landscape
项目的发展,学习心得,一些随感,记录于 Thoughts.md,随时更新。