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

Classes

class  FVirtualSmCopyStatsCS
 
class  FInvalidateInstancePagesLoadBalancerCS
 
class  FProcessInvalidationQueueGPUCS
 
class  FVSMResetInstanceStateCS
 
class  FVSMUpdateViewInstanceStateCS
 
class  FVirtualShadowMapInvalidationSceneRenderer
 

Namespaces

namespace  Nanite
 

Macros

#define LOCTEXT_NAMESPACE   "VirtualShadowMapCacheManager"
 

Typedefs

using FLoadBalancer = TInstanceCullingLoadBalancer< SceneRenderingAllocator >
 

Functions

 CSV_DECLARE_CATEGORY_EXTERN (VSM)
 
 UE_TRACE_CHANNEL_EXTERN (VSMChannel)
 
bool Nanite::IsStatFilterActive (const FString &FilterName)
 
 IMPLEMENT_SCENE_EXTENSION (FVirtualShadowMapArrayCacheManager)
 
 IMPLEMENT_GLOBAL_SHADER (FVirtualSmCopyStatsCS, "/Engine/Private/VirtualShadowMaps/VirtualShadowMapCopyStats.usf", "CopyStatsCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FInvalidateInstancePagesLoadBalancerCS, "/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheLoadBalancer.usf", "InvalidateInstancePagesLoadBalancerCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FProcessInvalidationQueueGPUCS, "/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheGPUInvalidation.usf", "ProcessInvalidationQueueGPUCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FVSMResetInstanceStateCS, "/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheGPUInvalidation.usf", "VSMResetInstanceStateCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FVSMUpdateViewInstanceStateCS, "/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheGPUInvalidation.usf", "VSMUpdateViewInstanceStateCS", SF_Compute)
 
 IMPLEMENT_SCENE_UB_STRUCT (FVirtualShadowMapInvalidationSceneUniforms, VSMCache, GetSceneUBDefaultParameters)
 

Variables

FAutoConsoleVariableRef CVarCacheDeformableMeshesInvalidate (TEXT("r.Shadow.Virtual.Cache.DeformableMeshesInvalidate"), GVSMCacheDeformableMeshesInvalidate, TEXT("If enabled, Primitive Proxies that are marked as having deformable meshes (HasDeformableMesh() == true) cause invalidations regardless of whether their transforms are updated."), ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarCacheDebugSkipRevealedPrimitivesInvalidate (TEXT("r.Shadow.Virtual.Cache.DebugSkipRevealedPrimitivesInvalidation"), GVSMCacheDebugSkipRevealedPrimitivesInvalidate, TEXT("Debug skip invalidation of revealed Non-Nanite primitives, i.e. they go from being culled on the CPU to unculled."), ECVF_RenderThreadSafe)
 
int32 GVSMMaxPageAgeSinceLastRequest = 1000
 
FAutoConsoleVariableRef CVarVSMMaxPageAgeSinceLastRequest (TEXT("r.Shadow.Virtual.Cache.MaxPageAgeSinceLastRequest"), GVSMMaxPageAgeSinceLastRequest, TEXT("The maximum number of frames to allow cached pages that aren't requested in the current frame to live. 0=disabled."), ECVF_RenderThreadSafe)
 
TAutoConsoleVariable< floatCVarVSMDynamicResolutionMaxLodBias (TEXT("r.Shadow.Virtual.DynamicRes.MaxResolutionLodBias"), 2.0f, TEXT("This is the maximum LOD bias to clamp to for global dynamic shadow resolution reduction. 0 = disabled"), ECVF_RenderThreadSafe)
 
TAutoConsoleVariable< floatCVarVSMDynamicResolutionMaxLodBiasDirectional (TEXT("r.Shadow.Virtual.DynamicRes.MaxComputeResolutionLodBiasDirectional"), 99999.0f, TEXT("This variable applies to directional lights only."), ECVF_RenderThreadSafe)
 
TAutoConsoleVariable< floatCVarVSMDynamicResolutionMaxLodBiasLocal (TEXT("r.Shadow.Virtual.DynamicRes.MaxComputeResolutionLodBiasLocal"), 99999.0f, TEXT("This variable applies to local lights only."), ECVF_RenderThreadSafe)
 
int32 GVSMLightRadiusInvalidationCulling = 1
 
FAutoConsoleVariableRef CVarVSMLightRadiusCulling (TEXT("r.Shadow.Virtual.Cache.CPUCullInvalidationsOutsideLightRadius"), GVSMLightRadiusInvalidationCulling, TEXT("CPU culls invalidations that are outside a local light's radius."), ECVF_RenderThreadSafe)
 
int32 GVSMAllowScreenOverflowMessages = 1
 
FAutoConsoleVariableRef CVarVSMAllowScreenOverflowMessages (TEXT("r.Shadow.Virtual.AllowScreenOverflowMessages"), GVSMAllowScreenOverflowMessages, TEXT("Can be used to disable on-screen VSM-related overflow messages. Even with the messages disabled, overflows will still be logged and can result in visual corruption."), ECVF_RenderThreadSafe)
 

Macro Definition Documentation

◆ LOCTEXT_NAMESPACE

#define LOCTEXT_NAMESPACE   "VirtualShadowMapCacheManager"

Typedef Documentation

◆ FLoadBalancer

Function Documentation

◆ CSV_DECLARE_CATEGORY_EXTERN()

CSV_DECLARE_CATEGORY_EXTERN ( VSM  )

◆ IMPLEMENT_GLOBAL_SHADER() [1/5]

IMPLEMENT_GLOBAL_SHADER ( FInvalidateInstancePagesLoadBalancerCS  ,
"/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheLoadBalancer.usf"  ,
"InvalidateInstancePagesLoadBalancerCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/5]

IMPLEMENT_GLOBAL_SHADER ( FProcessInvalidationQueueGPUCS  ,
"/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheGPUInvalidation.usf"  ,
"ProcessInvalidationQueueGPUCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [3/5]

IMPLEMENT_GLOBAL_SHADER ( FVirtualSmCopyStatsCS  ,
"/Engine/Private/VirtualShadowMaps/VirtualShadowMapCopyStats.usf"  ,
"CopyStatsCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [4/5]

IMPLEMENT_GLOBAL_SHADER ( FVSMResetInstanceStateCS  ,
"/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheGPUInvalidation.usf"  ,
"VSMResetInstanceStateCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [5/5]

IMPLEMENT_GLOBAL_SHADER ( FVSMUpdateViewInstanceStateCS  ,
"/Engine/Private/VirtualShadowMaps/VirtualShadowMapCacheGPUInvalidation.usf"  ,
"VSMUpdateViewInstanceStateCS"  ,
SF_Compute   
)

◆ IMPLEMENT_SCENE_EXTENSION()

IMPLEMENT_SCENE_EXTENSION ( FVirtualShadowMapArrayCacheManager  )

◆ IMPLEMENT_SCENE_UB_STRUCT()

IMPLEMENT_SCENE_UB_STRUCT ( FVirtualShadowMapInvalidationSceneUniforms  ,
VSMCache  ,
GetSceneUBDefaultParameters   
)

◆ UE_TRACE_CHANNEL_EXTERN()

UE_TRACE_CHANNEL_EXTERN ( VSMChannel  )

Variable Documentation

◆ CVarCacheDebugSkipRevealedPrimitivesInvalidate

FAutoConsoleVariableRef CVarCacheDebugSkipRevealedPrimitivesInvalidate(TEXT("r.Shadow.Virtual.Cache.DebugSkipRevealedPrimitivesInvalidation"), GVSMCacheDebugSkipRevealedPrimitivesInvalidate, TEXT("Debug skip invalidation of revealed Non-Nanite primitives, i.e. they go from being culled on the CPU to unculled."), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.Cache.DebugSkipRevealedPrimitivesInvalidation")  ,
GVSMCacheDebugSkipRevealedPrimitivesInvalidate  ,
TEXT("Debug skip invalidation of revealed Non-Nanite primitives, i.e. they go from being culled on the CPU to unculled." ,
ECVF_RenderThreadSafe   
)

◆ CVarCacheDeformableMeshesInvalidate

FAutoConsoleVariableRef CVarCacheDeformableMeshesInvalidate(TEXT("r.Shadow.Virtual.Cache.DeformableMeshesInvalidate"), GVSMCacheDeformableMeshesInvalidate, TEXT("If enabled, Primitive Proxies that are marked as having deformable meshes (HasDeformableMesh() == true) cause invalidations regardless of whether their transforms are updated."), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.Cache.DeformableMeshesInvalidate")  ,
GVSMCacheDeformableMeshesInvalidate  ,
TEXT("If enabled, Primitive Proxies that are marked as having deformable meshes (HasDeformableMesh() == true) cause invalidations regardless of whether their transforms are updated." ,
ECVF_RenderThreadSafe   
)

◆ CVarVSMAllowScreenOverflowMessages

FAutoConsoleVariableRef CVarVSMAllowScreenOverflowMessages(TEXT("r.Shadow.Virtual.AllowScreenOverflowMessages"), GVSMAllowScreenOverflowMessages, TEXT("Can be used to disable on-screen VSM-related overflow messages. Even with the messages disabled, overflows will still be logged and can result in visual corruption."), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.AllowScreenOverflowMessages")  ,
GVSMAllowScreenOverflowMessages  ,
TEXT("Can be used to disable on-screen VSM-related overflow messages. Even with the messages disabled, overflows will still be logged and can result in visual corruption." ,
ECVF_RenderThreadSafe   
)

◆ CVarVSMDynamicResolutionMaxLodBias

TAutoConsoleVariable< float > CVarVSMDynamicResolutionMaxLodBias(TEXT("r.Shadow.Virtual.DynamicRes.MaxResolutionLodBias"), 2.0f, TEXT("This is the maximum LOD bias to clamp to for global dynamic shadow resolution reduction. 0 = disabled"), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.DynamicRes.MaxResolutionLodBias")  ,
2.  0f,
TEXT("This is the maximum LOD bias to clamp to for global dynamic shadow resolution reduction. 0 = disabled" ,
ECVF_RenderThreadSafe   
)

◆ CVarVSMDynamicResolutionMaxLodBiasDirectional

TAutoConsoleVariable< float > CVarVSMDynamicResolutionMaxLodBiasDirectional(TEXT("r.Shadow.Virtual.DynamicRes.MaxComputeResolutionLodBiasDirectional"), 99999.0f, TEXT("This variable applies to directional lights only."), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.DynamicRes.MaxComputeResolutionLodBiasDirectional")  ,
99999.  0f,
TEXT("This variable applies to directional lights only." ,
ECVF_RenderThreadSafe   
)

◆ CVarVSMDynamicResolutionMaxLodBiasLocal

TAutoConsoleVariable< float > CVarVSMDynamicResolutionMaxLodBiasLocal(TEXT("r.Shadow.Virtual.DynamicRes.MaxComputeResolutionLodBiasLocal"), 99999.0f, TEXT("This variable applies to local lights only."), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.DynamicRes.MaxComputeResolutionLodBiasLocal")  ,
99999.  0f,
TEXT("This variable applies to local lights only." ,
ECVF_RenderThreadSafe   
)

◆ CVarVSMLightRadiusCulling

FAutoConsoleVariableRef CVarVSMLightRadiusCulling(TEXT("r.Shadow.Virtual.Cache.CPUCullInvalidationsOutsideLightRadius"), GVSMLightRadiusInvalidationCulling, TEXT("CPU culls invalidations that are outside a local light's radius."), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.Cache.CPUCullInvalidationsOutsideLightRadius")  ,
GVSMLightRadiusInvalidationCulling  ,
TEXT("CPU culls invalidations that are outside a local light's radius." ,
ECVF_RenderThreadSafe   
)

◆ CVarVSMMaxPageAgeSinceLastRequest

FAutoConsoleVariableRef CVarVSMMaxPageAgeSinceLastRequest(TEXT("r.Shadow.Virtual.Cache.MaxPageAgeSinceLastRequest"), GVSMMaxPageAgeSinceLastRequest, TEXT("The maximum number of frames to allow cached pages that aren't requested in the current frame to live. 0=disabled."), ECVF_RenderThreadSafe) ( TEXT("r.Shadow.Virtual.Cache.MaxPageAgeSinceLastRequest")  ,
GVSMMaxPageAgeSinceLastRequest  ,
TEXT("The maximum number of frames to allow cached pages that aren't requested in the current frame to live. 0=disabled." ,
ECVF_RenderThreadSafe   
)

◆ GVSMAllowScreenOverflowMessages

int32 GVSMAllowScreenOverflowMessages = 1

◆ GVSMLightRadiusInvalidationCulling

int32 GVSMLightRadiusInvalidationCulling = 1

◆ GVSMMaxPageAgeSinceLastRequest

int32 GVSMMaxPageAgeSinceLastRequest = 1000