How invertedgames-dev/rtxgi-ue-5.7-plugin works
1. This repository is an Unreal Engine plugin for RTXGI, organized as two UE modules plus a shader set. The runtime module is RTXGI, the editor module is RTXGIEditor, and the GPU work lives in /Shaders/Private with shared .ush SDK headers.
2. The top-level plugin descriptor RTXGI.uplugin wires the modules into Unreal’s plugin system. The README makes the main boundary explicit: the plugin only works as a dynamic GI solution when UE is using DirectX 12 with ray tracing enabled, and it falls back to static probe data when ray tracing is unavailable.
3. The runtime module centers on the DDGIVolume feature. DDGIVolume is the in-world actor, DDGIVolumeComponent exposes runtime and Blueprint-accessible controls, and the surrounding runtime code manages lifecycle, settings, serialization, scheduling, and rendering integration.
4. Probe management is the core data flow. A placed volume defines a 3D probe grid; the system updates probe irradiance and distance data over time, stores that data in textures/buffers, and uses it later during lighting application. Volumes are updated in a weighted round-robin manner, with per-volume update priority and a project-level probe ray budget limiting cost.
5. The GPU pipeline is split into discrete shader passes. The ProbeUpdateRGS.usf and ProbeViewRGS.usf ray-generation shaders handle ray-traced probe updates and visualization, while compute shaders such as ProbeRelocationCS.usf, ProbeStateClassifierCS.usf, ProbeBorderUpdateCS.usf, and ProbeBlendingCS.usf implement relocation, classification, edge handling, and temporal blending. ApplyLightingDeferred.usf and UpscaleLighting.usf connect probe results back into UE’s lighting path.
6. The shader SDK under Shaders/Private/SDK provides shared definitions and data layouts used across passes. Files like DDGIVolumeDefines.ush, DDGIVolumeDescGPU.ush, and ddgi/ProbeCommon.ush act as the contract between C++ volume state and HLSL kernels.
7. The runtime C++ side is responsible for preparing GPU-visible volume descriptions and orchestrating updates. Files such as DDGIVolumeDescGPU.h, DDGIVolumeUpdate.cpp, DDGIUtilities.cpp, and DDGIVolumeVisualize.cpp indicate a clear split between CPU-side volume state, update scheduling, and debug/visualization support.
8. RTXGIPlugin.cpp and RTXGIPluginSettings.cpp define the plugin’s integration and configuration surface. The project settings exposed in UE control probe storage formats, visualization defaults, serialization, and performance limits; cvars like r.RTXGI.DDGI and r.RTXGI.DDGI.LightingPass.Scale act as runtime switches for the render path.
9. RTXGIEditor is a thin editor-only layer. Its main job is to customize how RTXGI content appears in the Unreal editor, especially via RTXGIDetails.cpp, which likely extends the details panel for DDGIVolume actors and components so artists can tune GI behavior without touching code.
10. The main user-facing workflow is: enable the plugin, place one or more DDGIVolume actors, configure volume and probe settings, and let the runtime choose which volume to update and which volume contributes lighting in the camera frustum. Blueprint access goes through DDGIVolumeComponent, which means runtime gameplay logic can manipulate the GI system without directly talking to render internals.
11. There are two important runtime modes. In DXR-capable environments, probes update dynamically via ray tracing; without ray tracing, the plugin loads previously serialized probe data and behaves statically. That makes persistence/serialization part of the architecture, not just a convenience feature.
12. The repo’s main architectural boundary is between UE gameplay/editor objects and the render pipeline. On one side are actors, components, project settings, Blueprint calls, and editor customization; on the other are GPU passes, ray-tracing shaders, probe textures, and deferred lighting integration. The plugin exists to translate between those domains.
13. If you’re drawing the system, the most important external dependencies are Unreal Engine itself, the DirectX 12/DXR runtime, and the GPU driver/hardware stack. Everything else in the repo is in service of plugging DDGI probe simulation into UE’s rendering and authoring workflow.
Main entry points: DDGIVolumeUpdate.cpp Volume update · Common.ush Shader SDK · RTXGIPlugin.cpp RTXGI plugin · DDGIVolume.cpp DDGIVolume
Components 21
Plugin boundary
Unreal plugin descriptor and integration surface.
- RTXGI.uplugin · Registers the plugin and its UE modules.
RTXGI.uplugin - README · Explains DX12/DXR requirements, runtime modes, and usage.
README.md
Runtime module
Gameplay-facing DDGIVolume system and render integration.
- RTXGI plugin · Runtime-side plugin entry and configuration wiring.
Source/RTXGI/Private/RTXGIPlugin.cpp - Plugin settings · Project settings and runtime cvars for DDGI behavior.
Source/RTXGI/Private/RTXGIPluginSettings.cpp - DDGIVolume · Placed volume that defines the probe grid and GI region.
Source/RTXGI/Private/DDGIVolume.cpp - Volume component · Runtime and Blueprint-accessible control surface for volumes.
Source/RTXGI/Private/DDGIVolumeComponent.cpp - Volume update · Orchestrates weighted update order, budgets, and frame execution.
Source/RTXGI/Private/DDGIVolumeUpdate.cpp - GPU desc · CPU-to-GPU volume description and layout used by shaders.
Source/RTXGI/Private/DDGIVolumeDescGPU.h - Utilities · Shared runtime helpers for DDGI setup and lookup.
Source/RTXGI/Private/DDGIUtilities.cpp - Visualize DDGI · Runtime visualization of probe volumes and probe state.
Source/RTXGI/Private/DDGIVolumeVisualize.cpp
Editor module
Unreal editor customization for RTXGI content.
- RTXGIEditor · UE editor-only module bootstrap.
Source/RTXGIEditor/Private/RTXGIEditor.cpp - RTXGI details · Customizes DDGIVolume details in the Unreal editor.
Source/RTXGIEditor/Private/RTXGIDetails.cpp
Shader pipeline
GPU passes and shared shader SDK.
- Probe update · Ray-traced probe update pass.
Shaders/Private/ProbeUpdateRGS.usf - Probe view · Probe visualization and inspection pass.
Shaders/Private/ProbeViewRGS.usf - Relocation · Probe relocation and stabilization pass.
Shaders/Private/SDK/ddgi/ProbeRelocationCS.usf - Classifier · Classifies probe state before later passes.
Shaders/Private/SDK/ddgi/ProbeStateClassifierCS.usf - Border update · Updates edges and border probes.
Shaders/Private/SDK/ddgi/ProbeBorderUpdateCS.usf - Probe blending · Temporal blending of probe irradiance and distance.
Shaders/Private/SDK/ddgi/ProbeBlendingCS.usf - Apply lighting · Applies DDGI results into UE lighting.
Shaders/Private/ApplyLightingDeferred.usf - Upscale lighting · Scales lighting for the final render path.
Shaders/Private/UpscaleLighting.usf - Shader SDK · Common definitions and data layouts shared by all passes.
Shaders/Private/SDK/Common.ush
Connections 29
- RTXGI.uplugin → RTXGI plugin: loads · Plugin descriptor registers the runtime module.
- RTXGI.uplugin → RTXGIEditor: loads · Plugin descriptor registers the editor module.
- README → RTXGI.uplugin: describes · Documentation explains plugin usage and boundary conditions.
- RTXGI plugin → Plugin settings: reads · Runtime integration consumes project settings and cvars.
- RTXGI plugin → DDGIVolume: exposes · Runtime module provides the DDGIVolume actor.
- RTXGI plugin → Volume component: exposes · Runtime module provides the component API.
- DDGIVolume → Volume component: owns · Actor delegates runtime control to the component.
- Volume component → Utilities: uses · Blueprint/runtime control path uses shared helpers.
- DDGIVolume → Volume update: feeds · Placed volumes enter the scheduling/update system.
- Volume update → GPU desc: builds · CPU state is marshaled into GPU-visible descriptions.
- Volume update → Probe update: dispatches · Update scheduler drives the ray-traced probe pass.
- Volume update → Relocation: dispatches · Update scheduler drives relocation work.
- Volume update → Classifier: dispatches · Update scheduler drives probe classification.
- Volume update → Border update: dispatches · Update scheduler drives border handling.
- Volume update → Probe blending: dispatches · Update scheduler drives temporal blending.
- Visualize DDGI → Probe view: uses · Visualization path uses the probe view shader.
- RTXGI plugin → Apply lighting: integrates · Runtime module hooks probe data into deferred lighting.
- RTXGI plugin → Upscale lighting: integrates · Runtime module supports lighting upscaling path.
- Probe update → Shader SDK: includes · Shader pass depends on shared SDK definitions.
- Probe view → Shader SDK: includes · Shader pass depends on shared SDK definitions.
- Relocation → Shader SDK: includes · Compute pass depends on shared SDK definitions.
- Classifier → Shader SDK: includes · Compute pass depends on shared SDK definitions.
- Border update → Shader SDK: includes · Compute pass depends on shared SDK definitions.
- Probe blending → Shader SDK: includes · Compute pass depends on shared SDK definitions.
- Apply lighting → Shader SDK: includes · Lighting pass depends on shared SDK definitions.
- Upscale lighting → Shader SDK: includes · Upscale pass depends on shared SDK definitions.
- RTXGI details → DDGIVolume: customizes · Editor panel edits DDGIVolume properties.
- RTXGI details → Volume component: customizes · Editor panel edits component-exposed settings.
- RTXGIEditor → RTXGI details: registers · Editor module registers details customization.