UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LumenReSTIRGather.cpp File Reference

Classes

class  FTemporalResamplingCS
 
class  FClearTemporalHistoryCS
 
class  FSpatialResamplingCS
 
class  FUpsampleAndIntegrateCS
 
class  FTemporalAccumulationCS
 
class  FBilateralFilterCS
 

Namespaces

namespace  LumenReSTIRGather
 
namespace  Lumen
 

Enumerations

enum class  EReSTIRUpsampleMethod : uint8 { JitteredBilinearWithFallback , SpiralPattern , Passthrough , MAX }
 

Functions

FAutoConsoleVariableRef CVarLumenReSTIRDownsampleFactor (TEXT("r.Lumen.ReSTIRGather.DownsampleFactor"), GLumenReSTIRDownsampleFactor, TEXT("Downsample factor from the main viewport to trace rays, create and resample reservoirs at. This is the main performance control for the tracing / resampling part of the algorithm."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRTemporalResampling (TEXT("r.Lumen.ReSTIRGather.TemporalResampling"), GLumenReSTIRTemporalResampling, TEXT("Whether to do a temporal resampling pass on the reservoirs"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRTemporalResamplingValidate (TEXT("r.Lumen.ReSTIRGather.TemporalResampling.ValidateEveryNFrames"), GLumenReSTIRValidateTemporalReservoirsEveryNFrames, TEXT("Validate temporal reservoirs by re-tracing their rays and comparing hit positions and radiance every N frames. Used to reduce lag in lighting changes, but introduces noise."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarReSTIRTemporalResamplingHistoryDistanceThreshold (TEXT("r.Lumen.ReSTIRGather.TemporalResampling.DistanceThreshold"), GLumenReSTIRTemporalResamplingHistoryDistanceThreshold, TEXT(""), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRTemporalResamplingResetHistory (TEXT("r.Lumen.ReSTIRGather.TemporalResampling.ResetHistory"), GLumenReSTIRTemporalResamplingResetHistory, TEXT(""), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRSpatialResampling (TEXT("r.Lumen.ReSTIRGather.SpatialResampling"), GLumenReSTIRSpatialResampling, TEXT("Whether to use spatial resampling passes on the reservoirs"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenNumSpatialResamplingPasses (TEXT("r.Lumen.ReSTIRGather.SpatialResampling.NumPasses"), GLumenReSTIRNumSpatialResamplingPasses, TEXT("The number of spatial resampling passes to do"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRNumSpatialSamples (TEXT("r.Lumen.ReSTIRGather.SpatialResampling.NumSamples"), GLumenReSTIRNumSpatialSamples, TEXT("The number of spatial samples for each resampling pass."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRSpatialResamplingKernelRadius (TEXT("r.Lumen.ReSTIRGather.SpatialResampling.KernelRadius"), GLumenReSTIRSpatialResamplingKernelRadius, TEXT("Radius of the spatial resampling kernel as a fraction of the screen."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRResamplingAngleThreshold (TEXT("r.Lumen.ReSTIRGather.ResamplingAngleThreshold"), GLumenReSTIRResamplingAngleThreshold, TEXT("Largest angle between two reservoirs that will be allowed during reservoir resampling, in degrees"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRSpatialResamplingDepthErrorThreshold (TEXT("r.Lumen.ReSTIRGather.ResamplingDepthErrorThreshold"), GLumenReSTIRResamplingDepthErrorThreshold, TEXT("Largest depth error between two reservoirs that will be allowed during reservoir resampling"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance (TEXT("r.Lumen.ReSTIRGather.SpatialResampling.OcclusionScreenTraceDistance"), GLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance, TEXT("Length of occlusion screen traces used to validate the neighbor's reservoir hit position before reuse, to reduce leaking. As a fraction of the screen size."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRMaxRayIntensity (TEXT("r.Lumen.ReSTIRGather.MaxRayIntensity"), GLumenReSTIRMaxRayIntensity, TEXT("Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRUpsampleMethod (TEXT("r.Lumen.ReSTIRGather.Upsample.Method"), GLumenReSTIRUpsampleMethod, TEXT("2 - Passthrough for debugging. Also effectively disables the bilateral filter as variance is not computed."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRUpsampleKernelSize (TEXT("r.Lumen.ReSTIRGather.Upsample.KernelSize"), GLumenReSTIRUpsampleKernelSize, TEXT("Upsample kernel size, in reservoir texels"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRNumSamples (TEXT("r.Lumen.ReSTIRGather.Upsample.NumSamples"), GLumenReSTIRUpsampleNumSamples, TEXT("Number of reservoir samples to take while upsampling. Only used when r.Lumen.ReSTIRGather.Upsample.Method is set to Spiral Pattern."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherTemporalFilter (TEXT("r.Lumen.ReSTIRGather.Temporal"), GLumenReSTIRGatherTemporalFilter, TEXT("Whether to use a temporal filter"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherHistoryDistanceThreshold (TEXT("r.Lumen.ReSTIRGather.Temporal.DistanceThreshold"), GLumenReSTIRGatherHistoryDistanceThreshold, TEXT("Relative distance threshold needed to discard last frame's lighting results. Lower values reduce ghosting from characters when near a wall but increase flickering artifacts."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherTemporalMaxFramesAccumulated (TEXT("r.Lumen.ReSTIRGather.Temporal.MaxFramesAccumulated"), GLumenReSTIRGatherTemporalMaxFramesAccumulated, TEXT("Lower values cause the temporal filter to propagate lighting changes faster, but also increase flickering from noise."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilter (TEXT("r.Lumen.ReSTIRGather.BilateralFilter"), GLumenReSTIRGatherBilateralFilter, TEXT("Whether to do a bilateral filter as a last step in denoising Lumen ReSTIRGathers."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterSpatialKernelRadius (TEXT("r.Lumen.ReSTIRGather.BilateralFilter.SpatialKernelRadius"), GLumenReSTIRGatherBilateralFilterSpatialKernelRadius, TEXT("Spatial kernel radius, as a fraction of the viewport size"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterNumSamples (TEXT("r.Lumen.ReSTIRGather.BilateralFilter.NumSamples"), GLumenReSTIRGatherBilateralFilterNumSamples, TEXT("Number of bilateral filter samples."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterDepthWeightScale (TEXT("r.Lumen.ReSTIRGather.BilateralFilter.DepthWeightScale"), GLumenReSTIRGatherBilateralFilterDepthWeightScale, TEXT("Scales the depth weight of the bilateral filter"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale (TEXT("r.Lumen.ReSTIRGather.BilateralFilter.NormalAngleThresholdScale"), GLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale, TEXT("Scales the Normal angle threshold of the bilateral filter"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold (TEXT("r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold"), GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold, TEXT("Pixels whose variance from the spatial resolve filter are higher than this value get a stronger bilateral blur."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef GVarLumenReSTIRGatherShortRangeAO (TEXT("r.Lumen.ReSTIRGather.ShortRangeAO"), GLumenReSTIRGatherShortRangeAmbientOcclusion, TEXT("Whether to compute a short range, full resolution AO to add high frequency occlusion (contact shadows) which ReSTIR GI lacks due to spatial filtering."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction (TEXT("r.Lumen.ReSTIRGather.ShortRangeAO.MaxScreenTraceFraction"), GLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction, TEXT("Short range AO tracing distance, as a fraction of the screen size."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
int32 LumenReSTIRGather::GetScreenDownsampleFactor (const FViewInfo &View)
 
bool DoesPlatformSupportLumenReSTIRGather (EShaderPlatform Platform)
 
bool Lumen::UseReSTIRGather (const FSceneViewFamily &ViewFamily, EShaderPlatform ShaderPlatform)
 
 IMPLEMENT_GLOBAL_SHADER (FTemporalResamplingCS, "/Engine/Private/Lumen/LumenReSTIRGather.usf", "TemporalResamplingCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FClearTemporalHistoryCS, "/Engine/Private/Lumen/LumenReSTIRGather.usf", "ClearTemporalHistoryCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FSpatialResamplingCS, "/Engine/Private/Lumen/LumenReSTIRGather.usf", "SpatialResamplingCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FUpsampleAndIntegrateCS, "/Engine/Private/Lumen/LumenReSTIRGather.usf", "UpsampleAndIntegrateCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FTemporalAccumulationCS, "/Engine/Private/Lumen/LumenReSTIRGather.usf", "TemporalAccumulationCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FBilateralFilterCS, "/Engine/Private/Lumen/LumenReSTIRGather.usf", "BilateralFilterCS", SF_Compute)
 
void DispatchTemporalAccumulation (FRDGBuilder &GraphBuilder, const FViewInfo &View, const FSceneTextures &SceneTextures, FLumenSceneFrameTemporaries &FrameTemporaries, bool bPropagateGlobalLightingChange, bool bUseBilaterialFilter, FRDGTextureRef &DiffuseIndirect, FRDGTextureRef &RoughSpecularIndirect, FRDGTextureRef &ResolveVariance, ERDGPassFlags ComputePassFlags)
 
FReservoirTextures AllocateReservoirTextures (FRDGBuilder &GraphBuilder, FLumenSceneFrameTemporaries &FrameTemporaries, FIntPoint ReservoirBufferSize, FIntPoint ReservoirViewExtent)
 
FReservoirUAVs CreateReservoirUAVs (FRDGBuilder &GraphBuilder, const FReservoirTextures &Textures)
 

Variables

int32 GLumenReSTIRDownsampleFactor = 2
 
int32 GLumenReSTIRGatherFixedJitterIndex = -1
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherFixedJitterIndex (TEXT("r.Lumen.ReSTIRGather.FixedJitterIndex"), GLumenReSTIRGatherFixedJitterIndex, TEXT("When 0 or larger, overrides the frame index with a constant for debugging"), ECVF_RenderThreadSafe)
 
int32 GLumenReSTIRTemporalResampling = 1
 
int32 GLumenReSTIRValidateTemporalReservoirsEveryNFrames = 0
 
float GLumenReSTIRTemporalResamplingHistoryDistanceThreshold = .005f
 
int32 GLumenReSTIRTemporalResamplingResetHistory = 0
 
int32 GLumenReSTIRSpatialResampling = 1
 
int32 GLumenReSTIRNumSpatialResamplingPasses = 2
 
int32 GLumenReSTIRNumSpatialSamples = 4
 
float GLumenReSTIRSpatialResamplingKernelRadius = .05f
 
float GLumenReSTIRResamplingAngleThreshold = 25.0f
 
float GLumenReSTIRResamplingDepthErrorThreshold = .01f
 
float GLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance = .2f
 
float GLumenReSTIRMaxRayIntensity = 100
 
int32 GLumenReSTIRUpsampleMethod = 1
 
float GLumenReSTIRUpsampleKernelSize = 3.0f
 
int32 GLumenReSTIRUpsampleNumSamples = 16
 
int32 GLumenReSTIRGatherTemporalFilter = 1
 
int32 GLumenReSTIRGatherClearHistoryEveryFrame = 0
 
FAutoConsoleVariableRef CVarLumenReSTIRGatherClearHistoryEveryFrame (TEXT("r.Lumen.ReSTIRGather.Temporal.ClearHistoryEveryFrame"), GLumenReSTIRGatherClearHistoryEveryFrame, TEXT("Whether to clear the history every frame for debugging"), ECVF_RenderThreadSafe)
 
float GLumenReSTIRGatherHistoryDistanceThreshold = .005f
 
float GLumenReSTIRGatherTemporalMaxFramesAccumulated = 10.0f
 
int32 GLumenReSTIRGatherBilateralFilter = 1
 
float GLumenReSTIRGatherBilateralFilterSpatialKernelRadius = .002f
 
int32 GLumenReSTIRGatherBilateralFilterNumSamples = 8
 
float GLumenReSTIRGatherBilateralFilterDepthWeightScale = 10000.0f
 
float GLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale = .2f
 
float GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold = .5f
 
int32 GLumenReSTIRGatherShortRangeAmbientOcclusion = 1
 
float GLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction = .02f
 

Enumeration Type Documentation

◆ EReSTIRUpsampleMethod

Enumerator
JitteredBilinearWithFallback 
SpiralPattern 
Passthrough 
MAX 

Function Documentation

◆ AllocateReservoirTextures()

FReservoirTextures AllocateReservoirTextures ( FRDGBuilder GraphBuilder,
FLumenSceneFrameTemporaries FrameTemporaries,
FIntPoint  ReservoirBufferSize,
FIntPoint  ReservoirViewExtent 
)

◆ CreateReservoirUAVs()

FReservoirUAVs CreateReservoirUAVs ( FRDGBuilder GraphBuilder,
const FReservoirTextures Textures 
)

◆ CVarLumenNumSpatialResamplingPasses()

FAutoConsoleVariableRef CVarLumenNumSpatialResamplingPasses ( TEXT("r.Lumen.ReSTIRGather.SpatialResampling.NumPasses")  ,
GLumenReSTIRNumSpatialResamplingPasses  ,
TEXT("The number of spatial resampling passes to do" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRDownsampleFactor()

FAutoConsoleVariableRef CVarLumenReSTIRDownsampleFactor ( TEXT("r.Lumen.ReSTIRGather.DownsampleFactor")  ,
GLumenReSTIRDownsampleFactor  ,
TEXT("Downsample factor from the main viewport to trace rays, create and resample reservoirs at. This is the main performance control for the tracing / resampling part of the algorithm." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherBilateralFilter()

FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilter ( TEXT("r.Lumen.ReSTIRGather.BilateralFilter")  ,
GLumenReSTIRGatherBilateralFilter  ,
TEXT("Whether to do a bilateral filter as a last step in denoising Lumen ReSTIRGathers." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherBilateralFilterDepthWeightScale()

FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterDepthWeightScale ( TEXT("r.Lumen.ReSTIRGather.BilateralFilter.DepthWeightScale")  ,
GLumenReSTIRGatherBilateralFilterDepthWeightScale  ,
TEXT("Scales the depth weight of the bilateral filter" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale()

FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale ( TEXT("r.Lumen.ReSTIRGather.BilateralFilter.NormalAngleThresholdScale")  ,
GLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale  ,
TEXT("Scales the Normal angle threshold of the bilateral filter" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherBilateralFilterNumSamples()

FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterNumSamples ( TEXT("r.Lumen.ReSTIRGather.BilateralFilter.NumSamples")  ,
GLumenReSTIRGatherBilateralFilterNumSamples  ,
TEXT("Number of bilateral filter samples." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherBilateralFilterSpatialKernelRadius()

FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterSpatialKernelRadius ( TEXT("r.Lumen.ReSTIRGather.BilateralFilter.SpatialKernelRadius")  ,
GLumenReSTIRGatherBilateralFilterSpatialKernelRadius  ,
TEXT("Spatial kernel radius, as a fraction of the viewport size" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold()

FAutoConsoleVariableRef CVarLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold ( TEXT("r.Lumen.ReSTIRGather.BilateralFilter.StrongBlurVarianceThreshold")  ,
GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold  ,
TEXT("Pixels whose variance from the spatial resolve filter are higher than this value get a stronger bilateral blur." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherHistoryDistanceThreshold()

FAutoConsoleVariableRef CVarLumenReSTIRGatherHistoryDistanceThreshold ( TEXT("r.Lumen.ReSTIRGather.Temporal.DistanceThreshold")  ,
GLumenReSTIRGatherHistoryDistanceThreshold  ,
TEXT("Relative distance threshold needed to discard last frame's lighting results. Lower values reduce ghosting from characters when near a wall but increase flickering artifacts." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction()

FAutoConsoleVariableRef CVarLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction ( TEXT("r.Lumen.ReSTIRGather.ShortRangeAO.MaxScreenTraceFraction")  ,
GLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction  ,
TEXT("Short range AO tracing distance, as a fraction of the screen size." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherTemporalFilter()

FAutoConsoleVariableRef CVarLumenReSTIRGatherTemporalFilter ( TEXT("r.Lumen.ReSTIRGather.Temporal")  ,
GLumenReSTIRGatherTemporalFilter  ,
TEXT("Whether to use a temporal filter" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRGatherTemporalMaxFramesAccumulated()

FAutoConsoleVariableRef CVarLumenReSTIRGatherTemporalMaxFramesAccumulated ( TEXT("r.Lumen.ReSTIRGather.Temporal.MaxFramesAccumulated")  ,
GLumenReSTIRGatherTemporalMaxFramesAccumulated  ,
TEXT("Lower values cause the temporal filter to propagate lighting changes faster, but also increase flickering from noise." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRMaxRayIntensity()

FAutoConsoleVariableRef CVarLumenReSTIRMaxRayIntensity ( TEXT("r.Lumen.ReSTIRGather.MaxRayIntensity")  ,
GLumenReSTIRMaxRayIntensity  ,
TEXT("Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRNumSamples()

FAutoConsoleVariableRef CVarLumenReSTIRNumSamples ( TEXT("r.Lumen.ReSTIRGather.Upsample.NumSamples")  ,
GLumenReSTIRUpsampleNumSamples  ,
TEXT("Number of reservoir samples to take while upsampling. Only used when r.Lumen.ReSTIRGather.Upsample.Method is set to Spiral Pattern." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRNumSpatialSamples()

FAutoConsoleVariableRef CVarLumenReSTIRNumSpatialSamples ( TEXT("r.Lumen.ReSTIRGather.SpatialResampling.NumSamples")  ,
GLumenReSTIRNumSpatialSamples  ,
TEXT("The number of spatial samples for each resampling pass." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRResamplingAngleThreshold()

FAutoConsoleVariableRef CVarLumenReSTIRResamplingAngleThreshold ( TEXT("r.Lumen.ReSTIRGather.ResamplingAngleThreshold")  ,
GLumenReSTIRResamplingAngleThreshold  ,
TEXT("Largest angle between two reservoirs that will be allowed during reservoir resampling, in degrees" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRSpatialResampling()

FAutoConsoleVariableRef CVarLumenReSTIRSpatialResampling ( TEXT("r.Lumen.ReSTIRGather.SpatialResampling")  ,
GLumenReSTIRSpatialResampling  ,
TEXT("Whether to use spatial resampling passes on the reservoirs" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRSpatialResamplingDepthErrorThreshold()

FAutoConsoleVariableRef CVarLumenReSTIRSpatialResamplingDepthErrorThreshold ( TEXT("r.Lumen.ReSTIRGather.ResamplingDepthErrorThreshold")  ,
GLumenReSTIRResamplingDepthErrorThreshold  ,
TEXT("Largest depth error between two reservoirs that will be allowed during reservoir resampling" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRSpatialResamplingKernelRadius()

FAutoConsoleVariableRef CVarLumenReSTIRSpatialResamplingKernelRadius ( TEXT("r.Lumen.ReSTIRGather.SpatialResampling.KernelRadius")  ,
GLumenReSTIRSpatialResamplingKernelRadius  ,
TEXT("Radius of the spatial resampling kernel as a fraction of the screen." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance()

FAutoConsoleVariableRef CVarLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance ( TEXT("r.Lumen.ReSTIRGather.SpatialResampling.OcclusionScreenTraceDistance")  ,
GLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance  ,
TEXT("Length of occlusion screen traces used to validate the neighbor's reservoir hit position before reuse, to reduce leaking. As a fraction of the screen size." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRTemporalResampling()

FAutoConsoleVariableRef CVarLumenReSTIRTemporalResampling ( TEXT("r.Lumen.ReSTIRGather.TemporalResampling")  ,
GLumenReSTIRTemporalResampling  ,
TEXT("Whether to do a temporal resampling pass on the reservoirs" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRTemporalResamplingResetHistory()

FAutoConsoleVariableRef CVarLumenReSTIRTemporalResamplingResetHistory ( TEXT("r.Lumen.ReSTIRGather.TemporalResampling.ResetHistory")  ,
GLumenReSTIRTemporalResamplingResetHistory  ,
TEXT("")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRTemporalResamplingValidate()

FAutoConsoleVariableRef CVarLumenReSTIRTemporalResamplingValidate ( TEXT("r.Lumen.ReSTIRGather.TemporalResampling.ValidateEveryNFrames")  ,
GLumenReSTIRValidateTemporalReservoirsEveryNFrames  ,
TEXT("Validate temporal reservoirs by re-tracing their rays and comparing hit positions and radiance every N frames. Used to reduce lag in lighting changes, but introduces noise." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRUpsampleKernelSize()

FAutoConsoleVariableRef CVarLumenReSTIRUpsampleKernelSize ( TEXT("r.Lumen.ReSTIRGather.Upsample.KernelSize")  ,
GLumenReSTIRUpsampleKernelSize  ,
TEXT("Upsample kernel size, in reservoir texels" ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenReSTIRUpsampleMethod()

FAutoConsoleVariableRef CVarLumenReSTIRUpsampleMethod ( TEXT("r.Lumen.ReSTIRGather.Upsample.Method")  ,
GLumenReSTIRUpsampleMethod  ,
TEXT("2 - Passthrough for debugging. Also effectively disables the bilateral filter as variance is not computed." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarReSTIRTemporalResamplingHistoryDistanceThreshold()

FAutoConsoleVariableRef CVarReSTIRTemporalResamplingHistoryDistanceThreshold ( TEXT("r.Lumen.ReSTIRGather.TemporalResampling.DistanceThreshold")  ,
GLumenReSTIRTemporalResamplingHistoryDistanceThreshold  ,
TEXT("")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ DispatchTemporalAccumulation()

void DispatchTemporalAccumulation ( FRDGBuilder GraphBuilder,
const FViewInfo View,
const FSceneTextures SceneTextures,
FLumenSceneFrameTemporaries FrameTemporaries,
bool  bPropagateGlobalLightingChange,
bool  bUseBilaterialFilter,
FRDGTextureRef DiffuseIndirect,
FRDGTextureRef RoughSpecularIndirect,
FRDGTextureRef ResolveVariance,
ERDGPassFlags  ComputePassFlags 
)

◆ DoesPlatformSupportLumenReSTIRGather()

bool DoesPlatformSupportLumenReSTIRGather ( EShaderPlatform  Platform)

◆ GVarLumenReSTIRGatherShortRangeAO()

FAutoConsoleVariableRef GVarLumenReSTIRGatherShortRangeAO ( TEXT("r.Lumen.ReSTIRGather.ShortRangeAO")  ,
GLumenReSTIRGatherShortRangeAmbientOcclusion  ,
TEXT("Whether to compute a short range, full resolution AO to add high frequency occlusion (contact shadows) which ReSTIR GI lacks due to spatial filtering." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ IMPLEMENT_GLOBAL_SHADER() [1/6]

IMPLEMENT_GLOBAL_SHADER ( FBilateralFilterCS  ,
"/Engine/Private/Lumen/LumenReSTIRGather.usf"  ,
"BilateralFilterCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/6]

IMPLEMENT_GLOBAL_SHADER ( FClearTemporalHistoryCS  ,
"/Engine/Private/Lumen/LumenReSTIRGather.usf"  ,
"ClearTemporalHistoryCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [3/6]

IMPLEMENT_GLOBAL_SHADER ( FSpatialResamplingCS  ,
"/Engine/Private/Lumen/LumenReSTIRGather.usf"  ,
"SpatialResamplingCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [4/6]

IMPLEMENT_GLOBAL_SHADER ( FTemporalAccumulationCS  ,
"/Engine/Private/Lumen/LumenReSTIRGather.usf"  ,
"TemporalAccumulationCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [5/6]

IMPLEMENT_GLOBAL_SHADER ( FTemporalResamplingCS  ,
"/Engine/Private/Lumen/LumenReSTIRGather.usf"  ,
"TemporalResamplingCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [6/6]

IMPLEMENT_GLOBAL_SHADER ( FUpsampleAndIntegrateCS  ,
"/Engine/Private/Lumen/LumenReSTIRGather.usf"  ,
"UpsampleAndIntegrateCS"  ,
SF_Compute   
)

Variable Documentation

◆ CVarLumenReSTIRGatherClearHistoryEveryFrame

FAutoConsoleVariableRef CVarLumenReSTIRGatherClearHistoryEveryFrame(TEXT("r.Lumen.ReSTIRGather.Temporal.ClearHistoryEveryFrame"), GLumenReSTIRGatherClearHistoryEveryFrame, TEXT("Whether to clear the history every frame for debugging"), ECVF_RenderThreadSafe) ( TEXT("r.Lumen.ReSTIRGather.Temporal.ClearHistoryEveryFrame")  ,
GLumenReSTIRGatherClearHistoryEveryFrame  ,
TEXT("Whether to clear the history every frame for debugging" ,
ECVF_RenderThreadSafe   
)

◆ CVarLumenReSTIRGatherFixedJitterIndex

FAutoConsoleVariableRef CVarLumenReSTIRGatherFixedJitterIndex(TEXT("r.Lumen.ReSTIRGather.FixedJitterIndex"), GLumenReSTIRGatherFixedJitterIndex, TEXT("When 0 or larger, overrides the frame index with a constant for debugging"), ECVF_RenderThreadSafe) ( TEXT("r.Lumen.ReSTIRGather.FixedJitterIndex")  ,
GLumenReSTIRGatherFixedJitterIndex  ,
TEXT("When 0 or larger, overrides the frame index with a constant for debugging" ,
ECVF_RenderThreadSafe   
)

◆ GLumenReSTIRDownsampleFactor

int32 GLumenReSTIRDownsampleFactor = 2

◆ GLumenReSTIRGatherBilateralFilter

int32 GLumenReSTIRGatherBilateralFilter = 1

◆ GLumenReSTIRGatherBilateralFilterDepthWeightScale

float GLumenReSTIRGatherBilateralFilterDepthWeightScale = 10000.0f

◆ GLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale

float GLumenReSTIRGatherBilateralFilterNormalAngleThresholdScale = .2f

◆ GLumenReSTIRGatherBilateralFilterNumSamples

int32 GLumenReSTIRGatherBilateralFilterNumSamples = 8

◆ GLumenReSTIRGatherBilateralFilterSpatialKernelRadius

float GLumenReSTIRGatherBilateralFilterSpatialKernelRadius = .002f

◆ GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold

float GLumenReSTIRGatherBilateralFilterStrongBlurVarianceThreshold = .5f

◆ GLumenReSTIRGatherClearHistoryEveryFrame

int32 GLumenReSTIRGatherClearHistoryEveryFrame = 0

◆ GLumenReSTIRGatherFixedJitterIndex

int32 GLumenReSTIRGatherFixedJitterIndex = -1

◆ GLumenReSTIRGatherHistoryDistanceThreshold

float GLumenReSTIRGatherHistoryDistanceThreshold = .005f

◆ GLumenReSTIRGatherShortRangeAmbientOcclusion

int32 GLumenReSTIRGatherShortRangeAmbientOcclusion = 1

◆ GLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction

float GLumenReSTIRGatherShortRangeAOMaxScreenTraceFraction = .02f

◆ GLumenReSTIRGatherTemporalFilter

int32 GLumenReSTIRGatherTemporalFilter = 1

◆ GLumenReSTIRGatherTemporalMaxFramesAccumulated

float GLumenReSTIRGatherTemporalMaxFramesAccumulated = 10.0f

◆ GLumenReSTIRMaxRayIntensity

float GLumenReSTIRMaxRayIntensity = 100

◆ GLumenReSTIRNumSpatialResamplingPasses

int32 GLumenReSTIRNumSpatialResamplingPasses = 2

◆ GLumenReSTIRNumSpatialSamples

int32 GLumenReSTIRNumSpatialSamples = 4

◆ GLumenReSTIRResamplingAngleThreshold

float GLumenReSTIRResamplingAngleThreshold = 25.0f

◆ GLumenReSTIRResamplingDepthErrorThreshold

float GLumenReSTIRResamplingDepthErrorThreshold = .01f

◆ GLumenReSTIRSpatialResampling

int32 GLumenReSTIRSpatialResampling = 1

◆ GLumenReSTIRSpatialResamplingKernelRadius

float GLumenReSTIRSpatialResamplingKernelRadius = .05f

◆ GLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance

float GLumenReSTIRSpatialResamplingOcclusionScreenTraceDistance = .2f

◆ GLumenReSTIRTemporalResampling

int32 GLumenReSTIRTemporalResampling = 1

◆ GLumenReSTIRTemporalResamplingHistoryDistanceThreshold

float GLumenReSTIRTemporalResamplingHistoryDistanceThreshold = .005f

◆ GLumenReSTIRTemporalResamplingResetHistory

int32 GLumenReSTIRTemporalResamplingResetHistory = 0

◆ GLumenReSTIRUpsampleKernelSize

float GLumenReSTIRUpsampleKernelSize = 3.0f

◆ GLumenReSTIRUpsampleMethod

int32 GLumenReSTIRUpsampleMethod = 1

◆ GLumenReSTIRUpsampleNumSamples

int32 GLumenReSTIRUpsampleNumSamples = 16

◆ GLumenReSTIRValidateTemporalReservoirsEveryNFrames

int32 GLumenReSTIRValidateTemporalReservoirsEveryNFrames = 0