A dynamic diffuse global illumination system built on Unity URP 14.0 + DXR, based on the NVIDIA RTXGI SDK. Light probes are placed on a uniform 3D grid, with hardware ray tracing updating irradiance / distance atlases each frame to provide real-time indirect lighting.
Per Frame:
Build RTAS → Dispatch Rays → G-Buffer
→ [Probe Relocation] → [Probe Classification]
→ LightingCombined (Direct + Indirect + Radiance, single pass)
→ Monte Carlo Integration (Irradiance + Distance Atlas)
→ [Variability Reduction] → Border Update → Ping-Pong Swap
Apply GI (URP RendererFeature):
Depth → World Pos → Sample DDGI Atlas (trilinear + Chebyshev) → Additive Composite
| Direct Irradiance | Indirect Irradiance | Outgoing Radiance | Irradiance |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
- Direct lighting, indirect light sampling, and radiance compositing compressed into a single compute pass (LightingCombined), eliminating intermediate buffers
- Atlas uses ping-pong double buffering — writes to Current, reads from Prev — zero-copy swap
- Ray directions based on Fibonacci sphere uniform distribution + Halton sequence per-frame random rotation
- Monte Carlo integration uses exponential moving average (hysteresis); irradiance uses gamma encoding (γ=5.0) for improved dark region precision
- Probe Relocation automatically moves probes embedded in geometry; Classification marks invalid probes based on backface hit ratio
- Variability Reduction via multi-level reduction + AsyncGPUReadback drives adaptive update frequency
- Light leak suppression: surface bias, Chebyshev visibility test, weight crushing
- GI application stage: trilinear interpolation + Chebyshev visibility-weighted sampling of surrounding 8 probes
Assets/DDGILightProbe/
├── Runtime/
│ ├── Core/ DDGIVolume, DDGIRaytracingManager, DDGIProbeUpdater,
│ │ DDGIAtlasManager, DDGIApplyGIRendererFeature,
│ │ DDGIProbeVisualizer, DDGISkyOnlyValidator ...
│ └── Shaders/
│ ├── DDGILightingCombined.compute Combined lighting pass
│ ├── DDGIMonteCarloIntegration.compute Monte Carlo integration + Border Update
│ ├── DDGIProbeRelocation.compute Probe relocation
│ ├── DDGIProbeClassification.compute Probe classification
│ ├── DDGIVariabilityReduction.compute Variability reduction
│ ├── DDGISampling.hlsl Atlas sampling utilities
│ ├── DDGIApplyGI.shader Full-screen GI composite
│ └── DDGIRaytracing/ RayGen, ClosestHit, Miss, GBuffer
└── Editor/ Volume / Updater / Visualizer / Validator Inspector
- Unity 2022.3+, Windows, DirectX 12
- GPU with DXR 1.0 support (NVIDIA RTX / AMD RX 6000+)
- URP 14.0+, Deferred Rendering Path
- Add
DDGIApplyGIRendererFeatureto the URP Renderer - Create a GameObject → Light → DDGI Volume in the scene
- Set
DDGIProbeUpdaterto Raytracing mode, click "Auto Find Shaders" - Adjust Volume parameters; enter Play Mode to see real-time GI
- NVIDIA RTXGI SDK
- Majercik et al., Dynamic Diffuse Global Illumination with Ray-Traced Irradiance Fields, JCGT 2019
- Majercik et al., Scaling Probe-Based Real-Time Dynamic Global Illumination for Production, JCGT 2021
This project contains Sponza scene assets under the following licenses:
- Sponza model: CC BY 3.0 — © 2010 Frank Meinl, Crytek
- NoEmotion HDRs textures: CC BY-ND 4.0 — © 2022 Peter Sanitra
See Assets/com.unity.sponza-urp@5665fb87d0/copyright.txt for full copyright information.





