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

Classes

class  FLumenCardGPUData
 
struct  FLumenMeshCardsGPUData
 
struct  FLumenPrimitiveGroupGPUData
 
class  FLumenMergedMeshCards
 

Functions

FAutoConsoleVariableRef CVarLumenMeshCardsMergeComponents (TEXT("r.LumenScene.SurfaceCache.MeshCardsMergeComponents"), GLumenMeshCardsMergeComponents, TEXT("Whether to merge all components with the same RayTracingGroupId into a single MeshCards."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenMeshCardsMergeInstances (TEXT("r.LumenScene.SurfaceCache.MeshCardsMergeInstances"), GLumenMeshCardsMergeInstances, TEXT("Whether to merge all instances of a Instanced Static Mesh Component into a single MeshCards."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenMeshCardsMergedCardMinSurfaceArea (TEXT("r.LumenScene.SurfaceCache.MeshCardsMergedCardMinSurfaceArea"), GLumenMeshCardsMergedCardMinSurfaceArea, TEXT("Minimum area to spawn a merged card."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio (TEXT("r.LumenScene.SurfaceCache.MeshCardsMergeInstancesMaxSurfaceAreaRatio"), GLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio, TEXT("Only merge if the (combined box surface area) / (summed instance box surface area) < MaxSurfaceAreaRatio"), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenMeshCardsMergedResolutionScale (TEXT("r.LumenScene.SurfaceCache.MeshCardsMergedResolutionScale"), GLumenMeshCardsMergedResolutionScale, TEXT("Scale on the resolution calculation for a merged MeshCards. This compensates for the merged box getting a higher resolution assigned due to being closer to the viewer."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenMeshCardsMergedMaxWorldSize (TEXT("r.LumenScene.SurfaceCache.MeshCardsMergedMaxWorldSize"), GLumenMeshCardsMergedMaxWorldSize, TEXT("Only merged bounds less than this size on any axis are considered, since Lumen Scene streaming relies on object granularity."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarLumenMeshCardsCullFaces (TEXT("r.LumenScene.SurfaceCache.MeshCardsCullFaces"), GLumenMeshCardsCullFaces, TEXT(""), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
void UpdateLumenMeshCards (FRDGBuilder &GraphBuilder, FRDGScatterUploadBuilder &UploadBuilder, const FScene &Scene, const FDistanceFieldSceneData &DistanceFieldSceneData, FLumenSceneFrameTemporaries &FrameTemporaries, FLumenSceneData &LumenSceneData)
 
void BuildMeshCardsDataForHeightfield (const FLumenPrimitiveGroup &PrimitiveGroup, FMeshCardsBuildData &MeshCardsBuildData, FMatrix &MeshCardsLocalToWorld)
 
void BuildMeshCardsDataForMergedInstances (const FLumenPrimitiveGroup &PrimitiveGroup, FMeshCardsBuildData &MeshCardsBuildData, FMatrix &MeshCardsLocalToWorld)
 
bool IsMatrixOrthogonal (const FMatrix &Matrix)
 
bool MeshCardCullTest (const FLumenCardBuildData &CardBuildData, const FVector3f LocalToWorldScale, float MinFaceSurfaceArea, int32 CardIndex)
 

Variables

TAutoConsoleVariable< floatCVarLumenMeshCardsMinSize (TEXT("r.LumenScene.SurfaceCache.MeshCardsMinSize"), 10.0f, TEXT("Minimum mesh cards world space size to be included in Lumen Scene."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_Scalability|ECVF_RenderThreadSafe)
 
int32 GLumenMeshCardsMergeComponents = 1
 
int32 GLumenMeshCardsMergeInstances = 0
 
float GLumenMeshCardsMergedCardMinSurfaceArea = 0.05f
 
float GLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio = 1.7f
 
float GLumenMeshCardsMergedResolutionScale = .3f
 
float GLumenMeshCardsMergedMaxWorldSize = 10000.0f
 
int32 GLumenMeshCardsCullFaces = 1
 
int32 GLumenMeshCardsDebugSingleCard = -1
 
FAutoConsoleVariableRef CVarLumenMeshCardsDebugSingleCard (TEXT("r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard"), GLumenMeshCardsDebugSingleCard, TEXT("Spawn only a specified card on mesh. Useful for debugging."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_RenderThreadSafe)
 

Function Documentation

◆ BuildMeshCardsDataForHeightfield()

void BuildMeshCardsDataForHeightfield ( const FLumenPrimitiveGroup PrimitiveGroup,
FMeshCardsBuildData MeshCardsBuildData,
FMatrix MeshCardsLocalToWorld 
)

◆ BuildMeshCardsDataForMergedInstances()

void BuildMeshCardsDataForMergedInstances ( const FLumenPrimitiveGroup PrimitiveGroup,
FMeshCardsBuildData MeshCardsBuildData,
FMatrix MeshCardsLocalToWorld 
)

◆ CVarLumenMeshCardsCullFaces()

FAutoConsoleVariableRef CVarLumenMeshCardsCullFaces ( TEXT("r.LumenScene.SurfaceCache.MeshCardsCullFaces")  ,
GLumenMeshCardsCullFaces  ,
TEXT("")  ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenMeshCardsMergeComponents()

FAutoConsoleVariableRef CVarLumenMeshCardsMergeComponents ( TEXT("r.LumenScene.SurfaceCache.MeshCardsMergeComponents")  ,
GLumenMeshCardsMergeComponents  ,
TEXT("Whether to merge all components with the same RayTracingGroupId into a single MeshCards." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenMeshCardsMergedCardMinSurfaceArea()

FAutoConsoleVariableRef CVarLumenMeshCardsMergedCardMinSurfaceArea ( TEXT("r.LumenScene.SurfaceCache.MeshCardsMergedCardMinSurfaceArea")  ,
GLumenMeshCardsMergedCardMinSurfaceArea  ,
TEXT("Minimum area to spawn a merged card." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenMeshCardsMergedMaxWorldSize()

FAutoConsoleVariableRef CVarLumenMeshCardsMergedMaxWorldSize ( TEXT("r.LumenScene.SurfaceCache.MeshCardsMergedMaxWorldSize")  ,
GLumenMeshCardsMergedMaxWorldSize  ,
TEXT("Only merged bounds less than this size on any axis are considered, since Lumen Scene streaming relies on object granularity." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenMeshCardsMergedResolutionScale()

FAutoConsoleVariableRef CVarLumenMeshCardsMergedResolutionScale ( TEXT("r.LumenScene.SurfaceCache.MeshCardsMergedResolutionScale")  ,
GLumenMeshCardsMergedResolutionScale  ,
TEXT("Scale on the resolution calculation for a merged MeshCards. This compensates for the merged box getting a higher resolution assigned due to being closer to the viewer." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenMeshCardsMergeInstances()

FAutoConsoleVariableRef CVarLumenMeshCardsMergeInstances ( TEXT("r.LumenScene.SurfaceCache.MeshCardsMergeInstances")  ,
GLumenMeshCardsMergeInstances  ,
TEXT("Whether to merge all instances of a Instanced Static Mesh Component into a single MeshCards." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio()

FAutoConsoleVariableRef CVarLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio ( TEXT("r.LumenScene.SurfaceCache.MeshCardsMergeInstancesMaxSurfaceAreaRatio")  ,
GLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio  ,
TEXT("Only merge if the (combined box surface area) / (summed instance box surface area) < MaxSurfaceAreaRatio" ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ IsMatrixOrthogonal()

bool IsMatrixOrthogonal ( const FMatrix Matrix)

◆ MeshCardCullTest()

bool MeshCardCullTest ( const FLumenCardBuildData CardBuildData,
const FVector3f  LocalToWorldScale,
float  MinFaceSurfaceArea,
int32  CardIndex 
)

◆ UpdateLumenMeshCards()

void UpdateLumenMeshCards ( FRDGBuilder GraphBuilder,
FRDGScatterUploadBuilder UploadBuilder,
const FScene Scene,
const FDistanceFieldSceneData DistanceFieldSceneData,
FLumenSceneFrameTemporaries FrameTemporaries,
FLumenSceneData LumenSceneData 
)

Variable Documentation

◆ CVarLumenMeshCardsDebugSingleCard

FAutoConsoleVariableRef CVarLumenMeshCardsDebugSingleCard(TEXT("r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard"), GLumenMeshCardsDebugSingleCard, TEXT("Spawn only a specified card on mesh. Useful for debugging."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context; }), ECVF_RenderThreadSafe) ( TEXT("r.LumenScene.SurfaceCache.MeshCardsDebugSingleCard")  ,
GLumenMeshCardsDebugSingleCard  ,
TEXT("Spawn only a specified card on mesh. Useful for debugging." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_RenderThreadSafe   
)

◆ CVarLumenMeshCardsMinSize

TAutoConsoleVariable< float > CVarLumenMeshCardsMinSize(TEXT("r.LumenScene.SurfaceCache.MeshCardsMinSize"), 10.0f, TEXT("Minimum mesh cards world space size to be included in Lumen Scene."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context; }), ECVF_Scalability|ECVF_RenderThreadSafe) ( TEXT("r.LumenScene.SurfaceCache.MeshCardsMinSize")  ,
10.  0f,
TEXT("Minimum mesh cards world space size to be included in Lumen Scene." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ GLumenMeshCardsCullFaces

int32 GLumenMeshCardsCullFaces = 1

◆ GLumenMeshCardsDebugSingleCard

int32 GLumenMeshCardsDebugSingleCard = -1

◆ GLumenMeshCardsMergeComponents

int32 GLumenMeshCardsMergeComponents = 1

◆ GLumenMeshCardsMergedCardMinSurfaceArea

float GLumenMeshCardsMergedCardMinSurfaceArea = 0.05f

◆ GLumenMeshCardsMergedMaxWorldSize

float GLumenMeshCardsMergedMaxWorldSize = 10000.0f

◆ GLumenMeshCardsMergedResolutionScale

float GLumenMeshCardsMergedResolutionScale = .3f

◆ GLumenMeshCardsMergeInstances

int32 GLumenMeshCardsMergeInstances = 0

◆ GLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio

float GLumenMeshCardsMergeInstancesMaxSurfaceAreaRatio = 1.7f