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

Classes

class  FCullMeshSDFObjectsForViewCS
 
class  FCombineObjectIndexBuffersCS
 
class  FMeshSDFObjectCullVS
 
class  FMeshSDFObjectCullPS
 
class  FCompactCulledObjectsCS
 
class  FComputeCulledObjectsStartOffsetCS
 
class  FObjectCullingContext
 
class  FCullHeightfieldObjectsForViewCS
 

Functions

FAutoConsoleVariableRef CVarMeshSDFAverageCulledCount (TEXT("r.Lumen.DiffuseIndirect.MeshSDF.AverageCulledCount"), GMeshSDFAverageCulledCount, TEXT(""), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarMeshSDFRadiusThreshold (TEXT("r.Lumen.DiffuseIndirect.MeshSDF.RadiusThreshold"), GMeshSDFRadiusThreshold, TEXT(""), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarMeshSDFNotCoveredExpandSurfaceScale (TEXT("r.Lumen.DiffuseIndirect.MeshSDF.NotCoveredExpandSurfaceScale"), GMeshSDFNotCoveredExpandSurfaceScale, TEXT("Scales the surface expand used for Mesh SDFs that contain mostly two sided materials (foliage)"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarMeshSDFNotCoveredMinStepScale (TEXT("r.Lumen.DiffuseIndirect.MeshSDF.NotCoveredMinStepScale"), GMeshSDFNotCoveredMinStepScale, TEXT("Scales the min step size to improve performance, for Mesh SDFs that contain mostly two sided materials (foliage)"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarMeshSDFDitheredTransparencyStepThreshold (TEXT("r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold"), GMeshSDFDitheredTransparencyStepThreshold, TEXT("Per-step stochastic semi-transparency threshold, for tracing users that have dithered transparency enabled, for Mesh SDFs that contain mostly two sided materials (foliage)"), ECVF_Scalability|ECVF_RenderThreadSafe)
 
void SetupLumenMeshSDFTracingParameters (FRDGBuilder &GraphBuilder, const FScene *Scene, const FViewInfo &View, FLumenMeshSDFTracingParameters &OutParameters)
 
 IMPLEMENT_GLOBAL_SHADER (FCullMeshSDFObjectsForViewCS, "/Engine/Private/Lumen/LumenMeshSDFCulling.usf", "CullMeshSDFObjectsForViewCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FCombineObjectIndexBuffersCS, "/Engine/Private/Lumen/LumenMeshSDFCulling.usf", "CombineObjectIndexBuffersCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FMeshSDFObjectCullVS, "/Engine/Private/Lumen/LumenMeshSDFCulling.usf", "MeshSDFObjectCullVS", SF_Vertex)
 
 IMPLEMENT_GLOBAL_SHADER (FMeshSDFObjectCullPS, "/Engine/Private/Lumen/LumenMeshSDFCulling.usf", "MeshSDFObjectCullPS", SF_Pixel)
 
 IMPLEMENT_GLOBAL_SHADER (FCompactCulledObjectsCS, "/Engine/Private/Lumen/LumenMeshSDFCulling.usf", "CompactCulledObjectsCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FComputeCulledObjectsStartOffsetCS, "/Engine/Private/Lumen/LumenMeshSDFCulling.usf", "ComputeCulledObjectsStartOffsetCS", SF_Compute)
 
void InitObjectCullingContext (FRDGBuilder &GraphBuilder, uint32 NumCullGridCells, FObjectCullingContext &Context)
 
void FillGridParameters (FRDGBuilder &GraphBuilder, const FScene *Scene, const FViewInfo &View, const FObjectCullingContext *Context, FLumenMeshSDFGridParameters &OutGridParameters)
 
 IMPLEMENT_GLOBAL_SHADER (FCullHeightfieldObjectsForViewCS, "/Engine/Private/Lumen/LumenMeshSDFCulling.usf", "CullHeightfieldObjectsForViewCS", SF_Compute)
 
void CombineObjectIndexBuffers (FRDGBuilder &GraphBuilder, const FScene *Scene, const FViewInfo &View, bool bCullMeshSDFObjects, bool bCullHeightfieldObjects, FObjectCullingContext &Context, FRDGBufferRef &CombinedObjectIndexBuffer)
 
void CullHeightfieldObjectsForView (FRDGBuilder &GraphBuilder, const FScene *Scene, const FViewInfo &View, const FLumenSceneFrameTemporaries &FrameTemporaries, float MaxMeshSDFInfluenceRadius, float CardTraceEndDistanceFromCamera, FRDGBufferRef &NumHeightfieldCulledObjects, FRDGBufferRef &HeightfieldObjectIndexBuffer, FRDGBufferRef &HeightfieldObjectIndirectArguments)
 
void CullMeshSDFObjectsForView (FRDGBuilder &GraphBuilder, const FScene *Scene, const FViewInfo &View, float MaxMeshSDFInfluenceRadius, float CardTraceEndDistanceFromCamera, FObjectCullingContext &Context)
 
void CompactCulledObjectArray (FRDGBuilder &GraphBuilder, const FScene *Scene, const FViewInfo &View, FObjectCullingContext &Context, ERDGPassFlags ComputePassFlags)
 
void CullObjectsToGrid (const FViewInfo &View, const FScene *Scene, const FLumenSceneFrameTemporaries &FrameTemporaries, float MaxMeshSDFInfluenceRadius, float CardTraceEndDistanceFromCamera, int32 GridPixelsPerCellXY, int32 GridSizeZ, FVector ZParams, FIntVector CullGridSize, FRDGBuilder &GraphBuilder, FRDGBufferRef ObjectIndexBuffer, FObjectCullingContext &Context)
 
void CullMeshObjectsToViewGrid (const FViewInfo &View, const FScene *Scene, const FLumenSceneFrameTemporaries &FrameTemporaries, float MaxMeshSDFInfluenceRadius, float CardTraceEndDistanceFromCamera, int32 GridPixelsPerCellXY, int32 GridSizeZ, FVector ZParams, FRDGBuilder &GraphBuilder, FLumenMeshSDFGridParameters &OutGridParameters, ERDGPassFlags ComputePassFlags)
 

Variables

int32 GMeshSDFAverageCulledCount = 512
 
float GMeshSDFRadiusThreshold = 30
 
float GMeshSDFNotCoveredExpandSurfaceScale = .6f
 
float GMeshSDFNotCoveredMinStepScale = 32
 
float GMeshSDFDitheredTransparencyStepThreshold = .1f
 
uint32 CullMeshSDFObjectsForViewGroupSize = 64
 
uint32 ComputeCulledMeshSDFObjectsStartOffsetGroupSize = 64
 

Function Documentation

◆ CombineObjectIndexBuffers()

void CombineObjectIndexBuffers ( FRDGBuilder GraphBuilder,
const FScene Scene,
const FViewInfo View,
bool  bCullMeshSDFObjects,
bool  bCullHeightfieldObjects,
FObjectCullingContext Context,
FRDGBufferRef CombinedObjectIndexBuffer 
)

◆ CompactCulledObjectArray()

void CompactCulledObjectArray ( FRDGBuilder GraphBuilder,
const FScene Scene,
const FViewInfo View,
FObjectCullingContext Context,
ERDGPassFlags  ComputePassFlags 
)

◆ CullHeightfieldObjectsForView()

void CullHeightfieldObjectsForView ( FRDGBuilder GraphBuilder,
const FScene Scene,
const FViewInfo View,
const FLumenSceneFrameTemporaries FrameTemporaries,
float  MaxMeshSDFInfluenceRadius,
float  CardTraceEndDistanceFromCamera,
FRDGBufferRef NumHeightfieldCulledObjects,
FRDGBufferRef HeightfieldObjectIndexBuffer,
FRDGBufferRef HeightfieldObjectIndirectArguments 
)

◆ CullMeshObjectsToViewGrid()

void CullMeshObjectsToViewGrid ( const FViewInfo View,
const FScene Scene,
const FLumenSceneFrameTemporaries FrameTemporaries,
float  MaxMeshSDFInfluenceRadius,
float  CardTraceEndDistanceFromCamera,
int32  GridPixelsPerCellXY,
int32  GridSizeZ,
FVector  ZParams,
FRDGBuilder GraphBuilder,
FLumenMeshSDFGridParameters OutGridParameters,
ERDGPassFlags  ComputePassFlags 
)

◆ CullMeshSDFObjectsForView()

void CullMeshSDFObjectsForView ( FRDGBuilder GraphBuilder,
const FScene Scene,
const FViewInfo View,
float  MaxMeshSDFInfluenceRadius,
float  CardTraceEndDistanceFromCamera,
FObjectCullingContext Context 
)

◆ CullObjectsToGrid()

void CullObjectsToGrid ( const FViewInfo View,
const FScene Scene,
const FLumenSceneFrameTemporaries FrameTemporaries,
float  MaxMeshSDFInfluenceRadius,
float  CardTraceEndDistanceFromCamera,
int32  GridPixelsPerCellXY,
int32  GridSizeZ,
FVector  ZParams,
FIntVector  CullGridSize,
FRDGBuilder GraphBuilder,
FRDGBufferRef  ObjectIndexBuffer,
FObjectCullingContext Context 
)

◆ CVarMeshSDFAverageCulledCount()

FAutoConsoleVariableRef CVarMeshSDFAverageCulledCount ( TEXT("r.Lumen.DiffuseIndirect.MeshSDF.AverageCulledCount")  ,
GMeshSDFAverageCulledCount  ,
TEXT("")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarMeshSDFDitheredTransparencyStepThreshold()

FAutoConsoleVariableRef CVarMeshSDFDitheredTransparencyStepThreshold ( TEXT("r.Lumen.DiffuseIndirect.MeshSDF.DitheredTransparencyStepThreshold")  ,
GMeshSDFDitheredTransparencyStepThreshold  ,
TEXT("Per-step stochastic semi-transparency threshold, for tracing users that have dithered transparency enabled, for Mesh SDFs that contain mostly two sided materials (foliage)")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarMeshSDFNotCoveredExpandSurfaceScale()

FAutoConsoleVariableRef CVarMeshSDFNotCoveredExpandSurfaceScale ( TEXT("r.Lumen.DiffuseIndirect.MeshSDF.NotCoveredExpandSurfaceScale")  ,
GMeshSDFNotCoveredExpandSurfaceScale  ,
TEXT("Scales the surface expand used for Mesh SDFs that contain mostly two sided materials (foliage)")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarMeshSDFNotCoveredMinStepScale()

FAutoConsoleVariableRef CVarMeshSDFNotCoveredMinStepScale ( TEXT("r.Lumen.DiffuseIndirect.MeshSDF.NotCoveredMinStepScale")  ,
GMeshSDFNotCoveredMinStepScale  ,
TEXT("Scales the min step size to improve performance, for Mesh SDFs that contain mostly two sided materials (foliage)")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarMeshSDFRadiusThreshold()

FAutoConsoleVariableRef CVarMeshSDFRadiusThreshold ( TEXT("r.Lumen.DiffuseIndirect.MeshSDF.RadiusThreshold")  ,
GMeshSDFRadiusThreshold  ,
TEXT("")  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ FillGridParameters()

void FillGridParameters ( FRDGBuilder GraphBuilder,
const FScene Scene,
const FViewInfo View,
const FObjectCullingContext Context,
FLumenMeshSDFGridParameters OutGridParameters 
)

◆ IMPLEMENT_GLOBAL_SHADER() [1/7]

IMPLEMENT_GLOBAL_SHADER ( FCombineObjectIndexBuffersCS  ,
"/Engine/Private/Lumen/LumenMeshSDFCulling.usf"  ,
"CombineObjectIndexBuffersCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/7]

IMPLEMENT_GLOBAL_SHADER ( FCompactCulledObjectsCS  ,
"/Engine/Private/Lumen/LumenMeshSDFCulling.usf"  ,
"CompactCulledObjectsCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [3/7]

IMPLEMENT_GLOBAL_SHADER ( FComputeCulledObjectsStartOffsetCS  ,
"/Engine/Private/Lumen/LumenMeshSDFCulling.usf"  ,
"ComputeCulledObjectsStartOffsetCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [4/7]

IMPLEMENT_GLOBAL_SHADER ( FCullHeightfieldObjectsForViewCS  ,
"/Engine/Private/Lumen/LumenMeshSDFCulling.usf"  ,
"CullHeightfieldObjectsForViewCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [5/7]

IMPLEMENT_GLOBAL_SHADER ( FCullMeshSDFObjectsForViewCS  ,
"/Engine/Private/Lumen/LumenMeshSDFCulling.usf"  ,
"CullMeshSDFObjectsForViewCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [6/7]

IMPLEMENT_GLOBAL_SHADER ( FMeshSDFObjectCullPS  ,
"/Engine/Private/Lumen/LumenMeshSDFCulling.usf"  ,
"MeshSDFObjectCullPS"  ,
SF_Pixel   
)

◆ IMPLEMENT_GLOBAL_SHADER() [7/7]

IMPLEMENT_GLOBAL_SHADER ( FMeshSDFObjectCullVS  ,
"/Engine/Private/Lumen/LumenMeshSDFCulling.usf"  ,
"MeshSDFObjectCullVS"  ,
SF_Vertex   
)

◆ InitObjectCullingContext()

void InitObjectCullingContext ( FRDGBuilder GraphBuilder,
uint32  NumCullGridCells,
FObjectCullingContext Context 
)

◆ SetupLumenMeshSDFTracingParameters()

void SetupLumenMeshSDFTracingParameters ( FRDGBuilder GraphBuilder,
const FScene Scene,
const FViewInfo View,
FLumenMeshSDFTracingParameters OutParameters 
)

Variable Documentation

◆ ComputeCulledMeshSDFObjectsStartOffsetGroupSize

uint32 ComputeCulledMeshSDFObjectsStartOffsetGroupSize = 64

◆ CullMeshSDFObjectsForViewGroupSize

uint32 CullMeshSDFObjectsForViewGroupSize = 64

◆ GMeshSDFAverageCulledCount

int32 GMeshSDFAverageCulledCount = 512

◆ GMeshSDFDitheredTransparencyStepThreshold

float GMeshSDFDitheredTransparencyStepThreshold = .1f

◆ GMeshSDFNotCoveredExpandSurfaceScale

float GMeshSDFNotCoveredExpandSurfaceScale = .6f

◆ GMeshSDFNotCoveredMinStepScale

float GMeshSDFNotCoveredMinStepScale = 32

◆ GMeshSDFRadiusThreshold

float GMeshSDFRadiusThreshold = 30