Skip to main content

XFSDK Hybrid SDF GI

XFSDK Hybrid SDF GI uses the Global Distance Field, placeable probe volumes, and a surfel cache to compute dynamic indirect lighting without hardware ray tracing. The plugin includes optional per-pixel final gather and tools for baking probe volumes.

See Global Illumination in XFSDK Light for Light setup, API names, and xl_gi_ controls.

Requirements and setup​

  1. Install XFSDK Hybrid SDF GI in your project. Enable the plugin under Edit → Plugins and restart the editor.
  2. Enable Generate Mesh Distance Fields in Project Settings → Rendering and restart the editor to rebuild distance-field data.
  3. Use the Enable Hybrid SDF GI Blueprint node or UXFSDK_GI_API::XFSDK_EnableHybridSDFGI() to select the GI mode. See Runtime GI API for the documented API and integration module. The standalone GI console-variable prefix is x_.
  4. Place XFSDK GI Volume actors in the scene as described in Quick start. Keep a Sky Light for sky contribution and fallback outside the volumes.
  5. Optionally bake a volume using Bake GI to avoid runtime tracing for that volume.

This setup targets Unreal Engine 5.8 on Windows with DirectX 12, Shader Model 6, and the deferred renderer. Plugin modules: XFSDK_GI_Core, XFSDK_GI_Render, XFSDK_GI_Runtime.

How it works​

Hybrid SDF GI combines four techniques.

  1. GI volumes (probes). You place volumes in the level. Each fills its box with a regular grid of probes, like NVIDIA's DDGI. Every frame, the probes that visible pixels used on the previous frame cast rays through the global distance field, and a rolling budget refreshes the rest of the volume. Each probe stores the light arriving from all directions plus how far it can see, so light does not leak through walls. Probes stuck inside geometry are moved out or switched off automatically.
  2. Surfel cache. When a probe ray hits a surface, the GI needs that surface's color and lighting. The distance field only knows shape, so the implementation places small disks (surfels) on surfaces the camera has seen, records their material and lighting from the GBuffer, and probe rays read them. This is where emissive light comes from.
  3. Per-pixel lighting. Each pixel blends the nearest probes, weighted by distance and visibility, and adds the result as indirect diffuse light. Pixels outside every volume get sky light, darkened by distance-field occlusion (see Sky occlusion).
  4. Final gather (optional). Probes are 2 m apart by default, so they miss small detail: the dark gap under a rock, light bouncing off a nearby surface. The final gather traces one short ray per pixel to fix that up close. Like id Software's approach for DOOM: The Dark Ages, it does no lighting of its own; it only reads lighting that is already cached.

Quick start​

  1. Follow the setup instructions and enable mesh distance fields; restart the editor if renderer settings change.
  2. Place an XFSDK GI Volume actor (Place Actors panel, search "XFSDK GI Volume") and scale its box over the playable area. Use several volumes for large or multi-room levels.
  3. Look around: probes converge over a few seconds. Use x_gi_dfgi_lite_visualize 3 to see them.
  4. Optionally press Bake GI on the volume to freeze it. See Baking.
Sky Light

Keep a Sky Light in the level. Its lighting feeds the GI's sky rays and lights pixels outside every volume. If the image looks noisy, check the Sky Light's cast shadows first: in testing it was the main source of noise, not the GI.

GI volumes​

PropertyDefaultDescription
Probe Spacing200 cmDistance between probes. Denser volumes catch smaller occluders and cost more.
Priority0Where volumes overlap, higher priority wins. Equal priority prefers the denser volume.
Blend Distance800 cmThe volume fades in over this distance from its edge, so neighbouring volumes blend smoothly.
Blend Cutoff Distance0 cmZero weight this close to the edge, before the fade starts.
Enable VolumetrueA disabled volume neither lights nor updates.
Update Priority1.0This volume's share of the probe update budget compared to other live volumes.
Probe Max Ray Distance100000 cmShorter rays are faster but miss far occluders and see more sky. Rebake after changing.
Normal Bias0.05Moves the lookup off the surface (fraction of probe spacing). Fixes self-shadowing.
View Bias0.2Moves the lookup towards the camera (fraction of probe spacing). Reduces leaks and dark bands.
Light Multiplier1.0Scales this volume's indirect light. Does not change baked data.
Update ModeBakedHow the probes stay current. See Update modes.
Update Interval4Delayed only: frames between traces of each visible probe (2–16).
Start From BaketrueResponsive and Delayed only: start from the volume's bake when it has a valid one, instead of from black.

Size limits. A volume holds up to 128 probes per axis and 262,144 probes in total. If a box needs more, the spacing widens automatically so the whole box stays covered, and the log reports the spacing actually used. Split very large areas into several volumes to keep the density you want.

Run x_gi_dfgi_lite_list_volumes to log every volume: enabled, registered, size, probe grid, update mode and bake state.

Update modes​

ModeBehaviour
ResponsiveProbes the visible pixels use are traced every frame, so moving lights and emissive objects are followed within a few frames. The rest of the volume updates on the rolling budget.
DelayedLike Responsive, but each visible probe is traced every Update Interval frames, staggered across probes. Costs 1/N as much; lighting changes fade in over up to 8 × N frames.
BakedUses the baked probes and never traces. Without a valid bake the volume runs Responsive, so it can be baked.

Volumes saved before Update Mode existed are converted on load: Use Bake If Available becomes Baked, and Keep Updating (Warm Start) becomes Responsive with Start From Bake on.

Baking​

A volume with Update Mode Baked and a valid bake stores its probes in the level and stops updating: no probe rays, no surfels. It is the cheapest way to run the GI, and the right choice for static lighting. Responsive and Delayed volumes can use their bake as a starting point (Start From Bake).

  1. Keep the editor viewport camera inside or near the volume, with x_gi_method 2.
  2. Press Bake GI on the volume (or run x_gi_dfgi_lite_bake_volumes to bake every volume that is not already frozen). Baking keeps the volume's Update Mode.
  3. Wait until the log reports the bake (LogXFSDKGI, "[GI Volume]"), then save the level.

Things to know:

  • One bake covers every quality level and the final gather. Quality and final gather work on top of the probes at runtime.
  • Probes learn material colors and emissive light from surfels, which come from what the camera has seen. Look around the volume while it bakes, especially at emissive objects, or their light will be missing from the bake.
  • A bake goes stale when the volume moves or its box or probe spacing changes; the volume then runs live until you rebake. Rebake by hand after changing lights, geometry or Probe Max Ray Distance. Clear Baked GI removes it. A frozen (Baked) volume can't be rebaked in place: clear its bake or switch it to Responsive first.
  • Bakes are stored as compact half-float binary data.

Quality​

Each level adds to the previous one.

x_gi_dfgi_lite_qualityAdds
0 LowPer-probe linear spherical harmonics. Cheapest.
1 Medium (default)Smoother probe blending, deringing, and ZH3 reconstruction for better contrast.
2 HighDistance-field cone occlusion below probe resolution (as in UE4's DFGI).
3 EpicRough specular from the probes, fading in above x_gi_dfgi_lite_specular_min_roughness (0.35).

The quality level also sets the per-ray work of the probe updates, unless the matching console variable overrides it:

Probe ray workLowMediumHighEpic
Emissive surfels tested per ray (x_gi_dfgi_lite_probe_emitter_samples)0064128
Neighbour surfel search (x_gi_dfgi_lite_probe_surfel_neighbours)offoffoff6 face cells
Local lights at ray hits (x_gi_dfgi_lite_local_lights)offunshadowedshadowedshadowed

Emitters picked up by a ray hitting their surfel are always counted; the emitter samples only add small emitters that the probe rays miss. Shadowed local lights trace one shadow ray per hit by default (see x_gi_dfgi_lite_local_light_shadow_sampling).

Sky occlusion​

Pixels outside every GI volume are lit by the Sky Light. The distance-field cone occlusion darkens that sky light in corners and under overhangs (as UE4's distance-field AO did), so Unreal's own DFAO (r.DistanceFieldAO) is not needed. It is traced only where it is not already traced for quality 2 occlusion, and skips pixels fully inside a GI volume, so it costs nothing there. Turn it off with x_gi_dfgi_lite_sky_occlusion 0.

Final gather​

x_gi_dfgi_lite_final_gather=1

Every pixel traces one short ray (3 m by default) through the distance field. The hit is answered from caches only, with no lighting of its own:

  1. Last frame's screen, when the hit is visible. Its indirect bounce comes from the GI already applied last frame.
  2. Otherwise the GI volumes at the hit, times a neutral surface color.

The difference to the probe lighting is added on top, so the final gather only brings the near-field detail the probes miss, and replaces the quality 2 cone occlusion. Rays that hit nothing within range add nothing.

Three things keep it cheap:

  • Freeze. While the lighting is static (every volume baked or settled, the sun unchanged), pixels whose history is fully converged skip their ray. Each one is still re-traced once every x_gi_dfgi_lite_final_gather_freeze_refresh frames.
  • Trace resolution. x_gi_dfgi_lite_final_gather_resolution 1 traces one pixel per 2×2 block per frame, rotating through the four; the others reuse it through the temporal filter.

One ray per pixel is noisy, so it is filtered in two steps:

  1. Temporal: each pixel averages its own history (up to x_gi_dfgi_lite_final_gather_history frames), reprojected with motion vectors.
  2. Spatial: 2–5 edge-aware à-trous passes that respect depth and normals.

This is built to be stable without TAA. Areas that keep losing their history, like moving leaves, fade towards the probe GI instead of flickering.

Console variableDefaultDescription
x_gi_dfgi_lite_final_gather0Turns the final gather on.
x_gi_dfgi_lite_final_gather_distance300Ray length in cm. About one probe spacing works well.
x_gi_dfgi_lite_final_gather_rays1Rays per pixel (1–8). More rays lower noise at a linear cost.
x_gi_dfgi_lite_final_gather_history32Frames averaged at most. Higher is smoother but reacts slower.
x_gi_dfgi_lite_final_gather_filter_passes4À-trous passes (2–5). 4 passes cover 31×31 pixels.
x_gi_dfgi_lite_final_gather_confidence_samples8Samples needed for full strength. Higher is calmer on foliage.
x_gi_dfgi_lite_final_gather_screen_traces1Shade hits from last frame's screen when possible.
x_gi_dfgi_lite_final_gather_max_ray_intensity10Brightest value a single ray may return. Stops sparkles from small bright sources.
x_gi_dfgi_lite_final_gather_resolution00 traces every pixel; 1 traces one pixel per 2×2 per frame.
x_gi_dfgi_lite_final_gather_freeze1Skip the ray for converged pixels while the lighting is static.
x_gi_dfgi_lite_final_gather_freeze_refresh16Frames (2–64) over which every frozen pixel is re-traced once.
x_gi_dfgi_lite_final_gather_screen_bounce1Screen hits keep the bounce already in last frame's GI. 0 is the older, slower path.
x_gi_dfgi_lite_final_gather_hit_shading01 shades off-screen hits from surfels, local lights and the sun (older, slower path).

Settings​

Console variableDefaultDescription
x_gi_dfgi_lite_intensity1.0Overall indirect light intensity.
x_gi_dfgi_lite_quality1See Quality.
x_gi_dfgi_lite_probe_update_budget2048Probes retraced per frame across all live volumes, nearest first. Baked volumes never trace.
x_gi_dfgi_lite_probe_realtime_budget16384Most probes traced per frame because visible pixels used them, on top of the update budget. 0 puts every probe on the rolling budget.
x_gi_dfgi_lite_probe_realtime_interval1Minimum frames between traces of each visible probe, for every live volume. A Delayed volume's own interval applies when larger.
x_gi_dfgi_lite_probe_realtime_hysteresis0.85History kept by visible probes on each update. DDGI's rules apply on top: large changes still come through within a frame or two, and sudden jumps are limited to a quarter per update.
x_gi_dfgi_lite_surfel_drop_floating1Drops surfels left behind by moved objects: floating in front of the visible surface, or buried inside other geometry. Without it, a moved emitter keeps lighting its old place.
x_gi_dfgi_lite_sky_fallback0.5Sky light strength outside every volume. 0 leaves those pixels without indirect light.
x_gi_dfgi_lite_sky_occlusion1Distance-field occlusion of the sky light outside every volume. See Sky occlusion.
x_gi_dfgi_lite_local_lights-1Local lights at probe ray hits. -1 follows quality; 0 off, 1 unshadowed, 2 shadowed.
x_gi_dfgi_lite_local_light_shadow_sampling11 traces one shadow ray per hit, to a light picked by its brightness and weighted back. 0 traces one per light (slower with many lights).
x_gi_dfgi_lite_probe_emitter_samples-1Emissive surfels each probe ray tests. -1 follows quality (0 / 0 / 64 / 128).
x_gi_dfgi_lite_probe_surfel_neighbours-1Hits without a covering surfel also search the 6 face-neighbouring cells. -1 follows quality (Epic only).
x_gi_dfgi_lite_volume_view_distance50000Volumes further than this (cm) are ignored.
x_gi_dfgi_lite_visibility_max_distance20000Distance (cm) where the quality 2 cone occlusion has faded out.
x_gi_dfgi_lite_specular_min_roughness0.35Quality 3: roughness where probe specular starts.

Runtime GI API​

The plugin exposes mode selection to Blueprint and C++.

Blueprint functions​

Blueprint nodeC++ functionDescription
Enable Lumen Lite GIXFSDK_EnableLumenLiteGISelects Unreal Engine Lumen and applies the Medium GI scalability level used by Lumen Lite.
Enable Hybrid SDF GIXFSDK_EnableHybridSDFGISelects XFSDK Hybrid SDF GI.
Disable GIXFSDK_DisableGIDisables dynamic global illumination.
Get GI ModeXFSDK_GetGIModeReturns the currently selected GI mode.

The three mode-selection functions return true when the complete configuration was applied. They return false when a required console variable is unavailable.

Failures are reported through the corresponding XFSDK diagnostics system as non-fatal errors.

GI modes​

The shared logical modes are:

ModeDescription
DisabledDynamic global illumination is disabled.
LumenLiteUnreal Engine Lumen is selected with sg.GlobalIlluminationQuality 1.
HybridSDFGIXFSDK Hybrid SDF GI is selected.

Lumen Lite configuration changes global illumination only. The API does not modify reflection quality.

Standalone Hybrid SDF GI C++ usage​

Add the runtime module to your game module's dependencies.

PrivateDependencyModuleNames.AddRange(
new string[]
{
"XFSDK_GI_Runtime"
});

Include the standalone API header:

#include "XFSDK_GI_Runtime_API.h"

Use the standalone API class:

UXFSDK_GI_API::XFSDK_EnableHybridSDFGI();

const EXFSDK_GI_Mode Mode =
UXFSDK_GI_API::XFSDK_GetGIMode();

Select Lumen Lite or disable GI:

UXFSDK_GI_API::XFSDK_EnableLumenLiteGI();
UXFSDK_GI_API::XFSDK_DisableGI();

Blueprint usage​

The Blueprint nodes perform the same complete configuration as the C++ functions.

A typical graphics-settings flow is:

  1. Present Off, Lumen Lite, and Hybrid SDF GI to the player.
  2. Call the corresponding GI API node.
  3. Check the returned Boolean.
  4. Save the player's selected mode only when the call succeeds.
  5. Use Get GI Mode to initialize or refresh the settings UI.

Do not combine direct writes to the underlying GI method variables with the public API. Doing so may produce a configuration that no longer corresponds to one of the supported modes.

Debug views​

x_gi_dfgi_lite_visualizeShows
1Distance-field occlusion (quality 2+).
2Surfel coverage: yellow partial, green covered. Shows where probe rays find real materials.
3GI volume probes. Magenta = inactive.
4GI volume irradiance.
5Volume weights: red = live, green = baked, blue = sky fallback.
6Final gather correction: green adds light, red occludes.
7Final gather history: red = rejected this frame, white = 16+ frames.

Limitations​

  • Only geometry with mesh distance fields affects the GI. Very thin walls (below distance field resolution) can leak light; use thicker walls or denser volumes.
  • Surfels are spawned from what is on screen. Probe rays that hit surfaces the camera has not seen yet use a neutral grey (30%) material until they are seen.
  • Deferred shading only.
  • Emissive objects light the probes through their surfels: up to 1,024 emissive surfels per frame are collected, and each probe ray tests a stable subset of them (see Quality). Emitters must have been on screen to be picked up.
  • With many shadowed local lights, the default one-shadow-ray sampling can make local-light bounce slightly noisier on hard-to-reach surfaces. Set x_gi_dfgi_lite_local_light_shadow_sampling 0 if that is visible.

References​

  • Z. Majercik, J.-P. Guertin, D. Nowrouzezahrai, M. McGuire. Dynamic Diffuse Global Illumination with Ray-Traced Irradiance Fields. JCGT, 2019. jcgt.org/published/0008/02/01
  • Z. Majercik, A. Marrs, J. Spjut, M. McGuire. Scaling Probe-Based Real-Time Dynamic Global Illumination for Production. JCGT, 2021. jcgt.org/published/0010/02/01
  • NVIDIA. RTXGI (DDGI) Unreal Engine plugin. github.com/NVIDIAGameWorks/RTXGI-DDGI
  • D. Wright. Dynamic Occlusion with Signed Distance Fields. SIGGRAPH 2015, Advances in Real-Time Rendering.
  • H. Halén, A. Brinck, K. Hayward, X. Bei. Global Illumination Based on Surfels. SIGGRAPH 2021, Advances in Real-Time Rendering (EA SEED).
  • R. Wang. SurfelPlus. github.com/WANG-Ruipeng/SurfelPlus
  • T. Roughton, P.-P. Sloan, A. Silvennoinen, M. Iwanicki, P. Shirley. ZH3: Quadratic Zonal Harmonics. Activision, I3D 2024.
  • P.-P. Sloan. Deringing Spherical Harmonics. SIGGRAPH Asia 2017 Technical Briefs.
  • T. Sousa. Fast as Hell: idTech 8 Global Illumination. SIGGRAPH 2025, Advances in Real-Time Rendering in Games (DOOM: The Dark Ages).
  • H. Dammertz, D. Sewtz, J. Hanika, H. Lensch. Edge-Avoiding À-Trous Wavelet Transform for Fast Global Illumination Filtering. HPG 2010.
  • C. Schied et al. Spatiotemporal Variance-Guided Filtering. HPG 2017.
  • D. Wright, K. Narkowicz, P. Kelly. Lumen: Real-time Global Illumination in Unreal Engine 5. SIGGRAPH 2022, Advances in Real-Time Rendering.
  • Activision. VRRT. SIGGRAPH 2026 (re-cast rays reuse their random numbers, slide 58).