This is a substitute for computing screen probes in Lumen from UE5. For every 16 pixels, it places a probe and sampling the world, recording the samples in spherical harmonic functions.
This project is a part of work testing collaborative rendering based on UE5 backend(using screen probes to transfer indirect lighting). It aims to provide a way to precompute screen probes and store them into JSON files, which can be used in the renderer later.
- Vulkan SDK
- Cmake
- Windows system and graphic card supports hardware Ray Tracing(e.g. Nvidia RTX series)
- Optional(easy to compile): Vscode(recommended)/Visual Studio
It is based on SaschaWillems's Vulkan code, using Vulkan Ray Tracing Pipeline to fully utilize GPU power. It supports point lights and GLTF models with normal map.
Path tracing result
Indirect irradiance result
It includes 2 targets: a GPU path tracing and screen probes precompute.
You can modify the parameters in cpp and shader files to change the output.
Modify the code in file 'shaders/glsl/ssprobe/raygen.rgen'
imageStore(image,ivec2(gl_LaunchIDEXT.xy),vec4(loadSH(bias+i),1.));
// i : the index of the parameter of SH
the SH layout is in 'shaders/glsl/ssprobe/SH.glsl'
tips: you need to run 'compileshaders.py' each time you modify any shader file in ./shaders/
- Less recursive depth/light bounces(faster, but the indirect lighting is weaker than expect)
- more samples(slower and does not make much sense if it is greater than 10k)
- more lights(recommended)
- clamp the radiance samples(need to be modified in shaders and will make the result a little darker)
// e.g. in shaders/glsl/ssprobe/raygen.rgen
radiance=clamp(radiance,0.,80.);