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

Classes

struct  FParallelUpdateRangeDFO
 
struct  FParallelUpdateRangesDFO
 

Functions

 DECLARE_GPU_STAT (DistanceFields)
 
void AddModifiedBounds (FDistanceFieldSceneData &DistanceFieldSceneData, FGlobalDFCacheType CacheType, const FBox &Bounds)
 
void ProcessDistanceFieldObjectRemoves (FDistanceFieldSceneData &DistanceFieldSceneData, TArray< FSetElementId > &DistanceFieldAssetRemoves)
 
void LogDistanceFieldUpdate (FPrimitiveSceneInfo const *PrimitiveSceneInfo, float BoundingRadius, bool bIsAddOperation)
 
void ProcessPrimitiveUpdate (bool bIsAddOperation, FDistanceFieldSceneData &DistanceFieldSceneData, FPrimitiveSceneInfo *PrimitiveSceneInfo, TArray< FMatrix > &InstanceLocalToWorldTmpStorage, TArray< FDistanceFieldAssetMipId > &DistanceFieldAssetAdds, TArray< FSetElementId > &DistanceFieldAssetRemoves)
 
void UpdateGlobalHeightFieldObjectBuffers (FRDGBuilder &GraphBuilder, const TArray< uint32 > &IndicesToUpdateInHeightFieldObjectBuffers, FDistanceFieldSceneData &DistanceFieldSceneData)
 
void ProcessPendingHeightFieldPrimitiveAddAndRemoveOps (FScene *Scene, TArray< uint32 > &IndicesToUpdateInHeightFieldObjectBuffers)
 
void PrepareDistanceFieldScene (FRDGBuilder &GraphBuilder, FRDGExternalAccessQueue &ExternalAccessQueue, const FSceneRenderUpdateInputs &SceneUpdateInputs)
 

Variables

int32 GDistanceFieldOffsetDataStructure
 
float GMeshDistanceFieldsMaxObjectBoundingRadius = 100000
 
FAutoConsoleVariableRef CVarMeshDistanceFieldsMaxObjectBoundingRadius (TEXT("r.DistanceFields.MaxObjectBoundingRadius"), GMeshDistanceFieldsMaxObjectBoundingRadius, TEXT("Objects larger than this will not be included in the Mesh Distance Field scene, to improve performance."), ECVF_RenderThreadSafe)
 
int32 GDFParallelUpdate = 0
 
FAutoConsoleVariableRef CVarDFParallelUpdate (TEXT("r.DistanceFields.ParallelUpdate"), GDFParallelUpdate, TEXT(""), ECVF_RenderThreadSafe)
 
int32 GDFReverseAtlasAllocationOrder = 0
 
FAutoConsoleVariableRef CVarDFReverseAtlasAllocationOrder (TEXT("r.DistanceFields.ReverseAtlasAllocationOrder"), GDFReverseAtlasAllocationOrder, TEXT(""), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_RenderThreadSafe)
 
float GMeshSDFSurfaceBiasExpand = .25f
 
FAutoConsoleVariableRef CVarMeshSDFSurfaceBiasExpand (TEXT("r.DistanceFields.SurfaceBiasExpand"), GMeshSDFSurfaceBiasExpand, TEXT("Fraction of a Mesh SDF voxel to expand the surface during intersection. Expanding the surface improves representation quality, at the cost of over-occlusion."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;}), ECVF_RenderThreadSafe)
 
int32 GDFPreviousReverseAtlasAllocationOrder = 0
 
const uint32 UpdateObjectsGroupSize = 64
 
bool bVerifySceneIntegrity = false
 

Function Documentation

◆ AddModifiedBounds()

void AddModifiedBounds ( FDistanceFieldSceneData DistanceFieldSceneData,
FGlobalDFCacheType  CacheType,
const FBox Bounds 
)

◆ DECLARE_GPU_STAT()

DECLARE_GPU_STAT ( DistanceFields  )

◆ LogDistanceFieldUpdate()

void LogDistanceFieldUpdate ( FPrimitiveSceneInfo const *  PrimitiveSceneInfo,
float  BoundingRadius,
bool  bIsAddOperation 
)

◆ PrepareDistanceFieldScene()

void PrepareDistanceFieldScene ( FRDGBuilder GraphBuilder,
FRDGExternalAccessQueue ExternalAccessQueue,
const FSceneRenderUpdateInputs SceneUpdateInputs 
)

Prepares the distance field scene for all scene renderers.

◆ ProcessDistanceFieldObjectRemoves()

void ProcessDistanceFieldObjectRemoves ( FDistanceFieldSceneData DistanceFieldSceneData,
TArray< FSetElementId > &  DistanceFieldAssetRemoves 
)

◆ ProcessPendingHeightFieldPrimitiveAddAndRemoveOps()

void ProcessPendingHeightFieldPrimitiveAddAndRemoveOps ( FScene Scene,
TArray< uint32 > &  IndicesToUpdateInHeightFieldObjectBuffers 
)

◆ ProcessPrimitiveUpdate()

void ProcessPrimitiveUpdate ( bool  bIsAddOperation,
FDistanceFieldSceneData DistanceFieldSceneData,
FPrimitiveSceneInfo PrimitiveSceneInfo,
TArray< FMatrix > &  InstanceLocalToWorldTmpStorage,
TArray< FDistanceFieldAssetMipId > &  DistanceFieldAssetAdds,
TArray< FSetElementId > &  DistanceFieldAssetRemoves 
)

Gathers the information needed to represent a single object's distance field and appends it to the upload buffers.

◆ UpdateGlobalHeightFieldObjectBuffers()

void UpdateGlobalHeightFieldObjectBuffers ( FRDGBuilder GraphBuilder,
const TArray< uint32 > &  IndicesToUpdateInHeightFieldObjectBuffers,
FDistanceFieldSceneData DistanceFieldSceneData 
)

Variable Documentation

◆ bVerifySceneIntegrity

bool bVerifySceneIntegrity = false

◆ CVarDFParallelUpdate

FAutoConsoleVariableRef CVarDFParallelUpdate(TEXT("r.DistanceFields.ParallelUpdate"), GDFParallelUpdate, TEXT(""), ECVF_RenderThreadSafe) ( TEXT("r.DistanceFields.ParallelUpdate")  ,
GDFParallelUpdate  ,
TEXT("")  ,
ECVF_RenderThreadSafe   
)

◆ CVarDFReverseAtlasAllocationOrder

FAutoConsoleVariableRef CVarDFReverseAtlasAllocationOrder(TEXT("r.DistanceFields.ReverseAtlasAllocationOrder"), GDFReverseAtlasAllocationOrder, TEXT(""), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context; }), ECVF_RenderThreadSafe) ( TEXT("r.DistanceFields.ReverseAtlasAllocationOrder")  ,
GDFReverseAtlasAllocationOrder  ,
TEXT("")  ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_RenderThreadSafe   
)

◆ CVarMeshDistanceFieldsMaxObjectBoundingRadius

FAutoConsoleVariableRef CVarMeshDistanceFieldsMaxObjectBoundingRadius(TEXT("r.DistanceFields.MaxObjectBoundingRadius"), GMeshDistanceFieldsMaxObjectBoundingRadius, TEXT("Objects larger than this will not be included in the Mesh Distance Field scene, to improve performance."), ECVF_RenderThreadSafe) ( TEXT("r.DistanceFields.MaxObjectBoundingRadius")  ,
GMeshDistanceFieldsMaxObjectBoundingRadius  ,
TEXT("Objects larger than this will not be included in the Mesh Distance Field scene, to improve performance." ,
ECVF_RenderThreadSafe   
)

◆ CVarMeshSDFSurfaceBiasExpand

FAutoConsoleVariableRef CVarMeshSDFSurfaceBiasExpand(TEXT("r.DistanceFields.SurfaceBiasExpand"), GMeshSDFSurfaceBiasExpand, TEXT("Fraction of a Mesh SDF voxel to expand the surface during intersection. Expanding the surface improves representation quality, at the cost of over-occlusion."), FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context; }), ECVF_RenderThreadSafe) ( TEXT("r.DistanceFields.SurfaceBiasExpand")  ,
GMeshSDFSurfaceBiasExpand  ,
TEXT("Fraction of a Mesh SDF voxel to expand the surface during intersection. Expanding the surface improves representation quality, at the cost of over-occlusion." ,
FConsoleVariableDelegate::CreateLambda([](IConsoleVariable *InVariable) { FGlobalComponentRecreateRenderStateContext Context;})  ,
ECVF_RenderThreadSafe   
)

◆ GDFParallelUpdate

int32 GDFParallelUpdate = 0

◆ GDFPreviousReverseAtlasAllocationOrder

int32 GDFPreviousReverseAtlasAllocationOrder = 0

◆ GDFReverseAtlasAllocationOrder

int32 GDFReverseAtlasAllocationOrder = 0

◆ GDistanceFieldOffsetDataStructure

int32 GDistanceFieldOffsetDataStructure
extern

◆ GMeshDistanceFieldsMaxObjectBoundingRadius

float GMeshDistanceFieldsMaxObjectBoundingRadius = 100000

◆ GMeshSDFSurfaceBiasExpand

float GMeshSDFSurfaceBiasExpand = .25f

◆ UpdateObjectsGroupSize

const uint32 UpdateObjectsGroupSize = 64