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

Classes

class  FScreenSpaceShortRangeAOCS
 

Namespaces

namespace  LumenShortRangeAO
 

Functions

FAutoConsoleVariableRef CVarLumenShortRangeAOSlopeCompareToleranceScale (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.SlopeCompareToleranceScale"), GLumenShortRangeAOSlopeCompareToleranceScale, TEXT("Scales the slope threshold that screen space traces use to determine whether there was a hit."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenMaxShortRangeAOMultibounceAlbedo (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.MaxMultibounceAlbedo"), GLumenMaxShortRangeAOMultibounceAlbedo, TEXT("Maximum albedo used for the AO multi-bounce approximation. Useful for forcing near-white albedo to have some occlusion."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef GVarLumenShortRangeAOHairStrandsVoxelTrace (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HairVoxelTrace"), GLumenShortRangeAOHairStrandsVoxelTrace, TEXT("Whether to trace against hair voxel structure for hair casting shadow onto opaques."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef GVarShortRangeAOHairStrandsScreenTrace (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HairScreenTrace"), GLumenShortRangeAOHairStrandsScreenTrace, TEXT("Whether to trace against hair depth for hair casting shadow onto opaques."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeAOScreenSpaceHorizonSearch (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch"), GLumenShortRangeAOScreenSpaceHorizonSearch, TEXT("1: Search the depth buffer along view space slices for the occluded horizon."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.VisibilityBitmask"), GLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask, TEXT("Whether to use a visibility bitmask for the horizon search instead of min/max horizon angles. This method has the potential to handle thin occluders better because it doesn't assume a continuous depth buffer."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeAOScreenSpaceHorizonSearchHZB (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.HZB"), GLumenShortRangeAOScreenSpaceHorizonSearchHZB, TEXT("Whether to use the Hierarchical ZBuffer instead of SceneDepth for occlusion. HZB is slightly faster to sample, especially with a larger AO radius, but loses detail on grass and thin occluders since it is half res depth."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeAOSliceCount (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.SliceCount"), GLumenShortRangeAOSliceCount, TEXT("Number of view space slices to search per pixel. This is a primary scalability control for Horizon ShortRangeAO."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeAOStepsPerSlice (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.StepsPerSlice"), GLumenShortRangeAOStepsPerSlice, TEXT("Number of horizon searching steps per view space slice. This is a primary scalability control for Horizon ShortRangeAO."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeAOForegroundSampleRejectDistanceFraction (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.ForegroundSampleRejectDistanceFraction"), GLumenShortRangeAOForegroundSampleRejectDistanceFraction, TEXT("Controls the Z distance away from the current pixel where neighboring pixels will be considered foreground and have their occlusion rejected, as a fraction of pixel depth."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeAOForegroundSampleRejectPower (TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.ForegroundSampleRejectPower"), GLumenShortRangeAOForegroundSampleRejectPower, TEXT("Controls how strongly foreground occluders contribute to final occlusion."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeGlobalIllumination (TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI"), GLumenShortRangeGlobalIllumination, TEXT("Whether to calculate and apply Short Range Global Illumination, on top of Ambient Occlusion. Experimental feature, not ready for production. "), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeGIHistoryDepthTestRelativeThickness (TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI.HistoryDepthTestRelativeThickness"), GLumenShortRangeGIHistoryDepthTestRelativeThickness, TEXT("Distance between HZB trace hit and previous frame scene depth from which to allow hits, as a relative depth threshold."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeGIMaxScreenFraction (TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI.MaxScreenFraction"), GLumenShortRangeGIMaxScreenFraction, TEXT("Trace distance for GI as a fraction of the screen size."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenShortRangeGIMaxRayIntensity (TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI.MaxRayIntensity"), GLumenShortRangeGIMaxRayIntensity, TEXT("Maximum intensity of a single sample. Used to clamp fireflies, also loses lighting energy."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
bool LumenShortRangeAO::ShouldApplyDuringIntegration ()
 
bool LumenShortRangeAO::UseBentNormal ()
 
EPixelFormat LumenShortRangeAO::GetTextureFormat ()
 
uint32 LumenShortRangeAO::GetRequestedDownsampleFactor ()
 
uint32 LumenShortRangeAO::GetDownsampleFactor ()
 
bool LumenShortRangeAO::UseTemporal ()
 
float LumenShortRangeAO::GetTemporalNeighborhoodClampScale ()
 
float LumenShortRangeAO::GetFoliageOcclusionStrength ()
 
 IMPLEMENT_GLOBAL_SHADER (FScreenSpaceShortRangeAOCS, "/Engine/Private/Lumen/LumenScreenSpaceBentNormal.usf", "ScreenSpaceShortRangeAOCS", SF_Compute)
 
FLumenScreenSpaceBentNormalParameters ComputeScreenSpaceShortRangeAO (FRDGBuilder &GraphBuilder, const FScene *Scene, const FViewInfo &View, const FLumenSceneFrameTemporaries &FrameTemporaries, const FSceneTextures &SceneTextures, FRDGTextureRef LightingChannelsTexture, const FBlueNoise &BlueNoise, FVector2f MaxScreenTraceFraction, float ScreenTraceNoFallbackThicknessScale, ERDGPassFlags ComputePassFlags)
 

Variables

float GLumenShortRangeAOSlopeCompareToleranceScale = .5f
 
float GLumenMaxShortRangeAOMultibounceAlbedo = .5f
 
int32 GLumenShortRangeAOHairStrandsVoxelTrace = 1
 
int32 GLumenShortRangeAOHairStrandsScreenTrace = 0
 
int32 GLumenShortRangeAOScreenSpaceHorizonSearch = 1
 
int32 GLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask = 0
 
int32 GLumenShortRangeAOScreenSpaceHorizonSearchHZB = 1
 
int32 GLumenShortRangeAOSliceCount = 2
 
int32 GLumenShortRangeAOStepsPerSlice = 3
 
float GLumenShortRangeAOForegroundSampleRejectDistanceFraction = .3f
 
float GLumenShortRangeAOForegroundSampleRejectPower = 1.0f
 
int32 GLumenShortRangeGlobalIllumination = 0
 
float GLumenShortRangeGIHistoryDepthTestRelativeThickness = 0.0005f
 
float GLumenShortRangeGIMaxScreenFraction = .1f
 
float GLumenShortRangeGIMaxRayIntensity = 5.0f
 

Function Documentation

◆ ComputeScreenSpaceShortRangeAO()

FLumenScreenSpaceBentNormalParameters ComputeScreenSpaceShortRangeAO ( FRDGBuilder GraphBuilder,
const FScene Scene,
const FViewInfo View,
const FLumenSceneFrameTemporaries FrameTemporaries,
const FSceneTextures SceneTextures,
FRDGTextureRef  LightingChannelsTexture,
const FBlueNoise BlueNoise,
FVector2f  MaxScreenTraceFraction,
float  ScreenTraceNoFallbackThicknessScale,
ERDGPassFlags  ComputePassFlags 
)

◆ CVarLumenMaxShortRangeAOMultibounceAlbedo()

FAutoConsoleVariableRef CVarLumenMaxShortRangeAOMultibounceAlbedo ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.MaxMultibounceAlbedo")  ,
GLumenMaxShortRangeAOMultibounceAlbedo  ,
TEXT("Maximum albedo used for the AO multi-bounce approximation. Useful for forcing near-white albedo to have some occlusion." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOForegroundSampleRejectDistanceFraction()

FAutoConsoleVariableRef CVarLumenShortRangeAOForegroundSampleRejectDistanceFraction ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.ForegroundSampleRejectDistanceFraction")  ,
GLumenShortRangeAOForegroundSampleRejectDistanceFraction  ,
TEXT("Controls the Z distance away from the current pixel where neighboring pixels will be considered foreground and have their occlusion rejected, as a fraction of pixel depth." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOForegroundSampleRejectPower()

FAutoConsoleVariableRef CVarLumenShortRangeAOForegroundSampleRejectPower ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.ForegroundSampleRejectPower")  ,
GLumenShortRangeAOForegroundSampleRejectPower  ,
TEXT("Controls how strongly foreground occluders contribute to final occlusion." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOScreenSpaceHorizonSearch()

FAutoConsoleVariableRef CVarLumenShortRangeAOScreenSpaceHorizonSearch ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch")  ,
GLumenShortRangeAOScreenSpaceHorizonSearch  ,
TEXT("1: Search the depth buffer along view space slices for the occluded horizon." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOScreenSpaceHorizonSearchHZB()

FAutoConsoleVariableRef CVarLumenShortRangeAOScreenSpaceHorizonSearchHZB ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.HZB")  ,
GLumenShortRangeAOScreenSpaceHorizonSearchHZB  ,
TEXT("Whether to use the Hierarchical ZBuffer instead of SceneDepth for occlusion. HZB is slightly faster to sample, especially with a larger AO radius, but loses detail on grass and thin occluders since it is half res depth." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask()

FAutoConsoleVariableRef CVarLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.VisibilityBitmask")  ,
GLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask  ,
TEXT("Whether to use a visibility bitmask for the horizon search instead of min/max horizon angles. This method has the potential to handle thin occluders better because it doesn't assume a continuous depth buffer." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOSliceCount()

FAutoConsoleVariableRef CVarLumenShortRangeAOSliceCount ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.SliceCount")  ,
GLumenShortRangeAOSliceCount  ,
TEXT("Number of view space slices to search per pixel. This is a primary scalability control for Horizon ShortRangeAO." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOSlopeCompareToleranceScale()

FAutoConsoleVariableRef CVarLumenShortRangeAOSlopeCompareToleranceScale ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.SlopeCompareToleranceScale")  ,
GLumenShortRangeAOSlopeCompareToleranceScale  ,
TEXT("Scales the slope threshold that screen space traces use to determine whether there was a hit." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeAOStepsPerSlice()

FAutoConsoleVariableRef CVarLumenShortRangeAOStepsPerSlice ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HorizonSearch.StepsPerSlice")  ,
GLumenShortRangeAOStepsPerSlice  ,
TEXT("Number of horizon searching steps per view space slice. This is a primary scalability control for Horizon ShortRangeAO." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeGIHistoryDepthTestRelativeThickness()

FAutoConsoleVariableRef CVarLumenShortRangeGIHistoryDepthTestRelativeThickness ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI.HistoryDepthTestRelativeThickness")  ,
GLumenShortRangeGIHistoryDepthTestRelativeThickness  ,
TEXT("Distance between HZB trace hit and previous frame scene depth from which to allow hits, as a relative depth threshold." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeGIMaxRayIntensity()

FAutoConsoleVariableRef CVarLumenShortRangeGIMaxRayIntensity ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI.MaxRayIntensity")  ,
GLumenShortRangeGIMaxRayIntensity  ,
TEXT("Maximum intensity of a single sample. Used to clamp fireflies, also loses lighting energy." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeGIMaxScreenFraction()

FAutoConsoleVariableRef CVarLumenShortRangeGIMaxScreenFraction ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI.MaxScreenFraction")  ,
GLumenShortRangeGIMaxScreenFraction  ,
TEXT("Trace distance for GI as a fraction of the screen size." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenShortRangeGlobalIllumination()

FAutoConsoleVariableRef CVarLumenShortRangeGlobalIllumination ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeGI")  ,
GLumenShortRangeGlobalIllumination  ,
TEXT("Whether to calculate and apply Short Range Global Illumination, on top of Ambient Occlusion. Experimental feature, not ready for production. ")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ GVarLumenShortRangeAOHairStrandsVoxelTrace()

FAutoConsoleVariableRef GVarLumenShortRangeAOHairStrandsVoxelTrace ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HairVoxelTrace")  ,
GLumenShortRangeAOHairStrandsVoxelTrace  ,
TEXT("Whether to trace against hair voxel structure for hair casting shadow onto opaques." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ GVarShortRangeAOHairStrandsScreenTrace()

FAutoConsoleVariableRef GVarShortRangeAOHairStrandsScreenTrace ( TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HairScreenTrace")  ,
GLumenShortRangeAOHairStrandsScreenTrace  ,
TEXT("Whether to trace against hair depth for hair casting shadow onto opaques." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ IMPLEMENT_GLOBAL_SHADER()

IMPLEMENT_GLOBAL_SHADER ( FScreenSpaceShortRangeAOCS  ,
"/Engine/Private/Lumen/LumenScreenSpaceBentNormal.usf"  ,
"ScreenSpaceShortRangeAOCS"  ,
SF_Compute   
)

Variable Documentation

◆ GLumenMaxShortRangeAOMultibounceAlbedo

float GLumenMaxShortRangeAOMultibounceAlbedo = .5f

◆ GLumenShortRangeAOForegroundSampleRejectDistanceFraction

float GLumenShortRangeAOForegroundSampleRejectDistanceFraction = .3f

◆ GLumenShortRangeAOForegroundSampleRejectPower

float GLumenShortRangeAOForegroundSampleRejectPower = 1.0f

◆ GLumenShortRangeAOHairStrandsScreenTrace

int32 GLumenShortRangeAOHairStrandsScreenTrace = 0

◆ GLumenShortRangeAOHairStrandsVoxelTrace

int32 GLumenShortRangeAOHairStrandsVoxelTrace = 1

◆ GLumenShortRangeAOScreenSpaceHorizonSearch

int32 GLumenShortRangeAOScreenSpaceHorizonSearch = 1

◆ GLumenShortRangeAOScreenSpaceHorizonSearchHZB

int32 GLumenShortRangeAOScreenSpaceHorizonSearchHZB = 1

◆ GLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask

int32 GLumenShortRangeAOScreenSpaceHorizonSearchVisibilityBitmask = 0

◆ GLumenShortRangeAOSliceCount

int32 GLumenShortRangeAOSliceCount = 2

◆ GLumenShortRangeAOSlopeCompareToleranceScale

float GLumenShortRangeAOSlopeCompareToleranceScale = .5f

◆ GLumenShortRangeAOStepsPerSlice

int32 GLumenShortRangeAOStepsPerSlice = 3

◆ GLumenShortRangeGIHistoryDepthTestRelativeThickness

float GLumenShortRangeGIHistoryDepthTestRelativeThickness = 0.0005f

◆ GLumenShortRangeGIMaxRayIntensity

float GLumenShortRangeGIMaxRayIntensity = 5.0f

◆ GLumenShortRangeGIMaxScreenFraction

float GLumenShortRangeGIMaxScreenFraction = .1f

◆ GLumenShortRangeGlobalIllumination

int32 GLumenShortRangeGlobalIllumination = 0