UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FProjectedShadowInfo Class Reference

#include <ShadowRendering.h>

+ Inheritance diagram for FProjectedShadowInfo:

Public Types

enum class  EGatherDynamicMeshElementsPass : uint8 { All , Parallel , Serial }
 
typedef TArray< const FPrimitiveSceneInfo *, SceneRenderingAllocatorPrimitiveArrayType
 

Public Member Functions

void ComputeScissorRectOptim ()
 
 FProjectedShadowInfo ()
 
 ~FProjectedShadowInfo ()
 
bool SetupPerObjectProjection (FLightSceneInfo *InLightSceneInfo, const FPrimitiveSceneInfo *InParentSceneInfo, const FPerObjectProjectedShadowInitializer &Initializer, bool bInPreShadow, uint32 InResolutionX, uint32 MaxShadowResolutionY, uint32 InBorderSize, float InMaxScreenPercent, bool bInTranslucentShadow)
 
void SetupWholeSceneProjection (FLightSceneInfo *InLightSceneInfo, FViewInfo *InDependentView, const FWholeSceneProjectedShadowInitializer &Initializer, uint32 InResolutionX, uint32 InResolutionY, uint32 InSnapResolutionX, uint32 InSnapResolutionY, uint32 InBorderSize)
 
void SetupClipmapProjection (FLightSceneInfo *InLightSceneInfo, FViewInfo *InDependentView, const TSharedPtr< FVirtualShadowMapClipmap > &VirtualShadowMapClipmap, float InMaxNonFarCascadeDistance)
 
FViewMatrices GetShadowDepthRenderingViewMatrices (int32 CubeFaceIndex=-1, bool bUseForVSMCubeFaceWorkaround=false) const
 
float GetShaderDepthBias () const
 
float GetShaderSlopeDepthBias () const
 
float GetShaderMaxSlopeDepthBias () const
 
float GetShaderReceiverDepthBias () const
 
void SetStateForView (FRHICommandList &RHICmdList, bool bRequiresBorderClamp=false) const
 
FIntRect GetInnerViewRect () const
 
FIntRect GetOuterViewRect () const
 
void SetStateForDepth (FMeshPassProcessorRenderState &DrawRenderState) const
 
void ClearDepth (FRHICommandList &RHICmdList) const
 
void RenderTranslucencyDepths (FRDGBuilder &GraphBuilder, class FSceneRenderer *SceneRenderer, const FRenderTargetBindingSlots &RenderTargets, FInstanceCullingManager &InstanceCullingManager)
 
bool UseShadowStencilCulling (const FViewInfo &View) const
 
FRHIBlendStateGetBlendStateForProjection (bool bProjectingForForwardShading, bool bMobileModulatedProjections) const
 
void RenderProjection (FRDGBuilder &GraphBuilder, const FShadowProjectionPassParameters &CommonPassParameters, int32 ViewIndex, const FViewInfo *View, const FLightSceneProxy *LightSceneProxy, const FSceneRenderer *SceneRender, bool bProjectingForForwardShading, bool bSubPixelShadow) const
 
void RenderProjectionInternal (FRHICommandList &RHICmdList, int32 ViewIndex, const FViewInfo *View, const FLightSceneProxy *LightSceneProxy, const FSceneRenderer *SceneRender, bool bProjectingForForwardShading, bool bMobileModulatedProjections, const FInstanceCullingDrawParams &InstanceCullingDrawParams, FRHIUniformBuffer *HairStrandsUniformBuffer) const
 
void RenderMobileModulatedShadowProjection (FRHICommandList &RHICmdList, int32 ViewIndex, const FViewInfo *View, const FLightSceneProxy *LightSceneProxy, const FSceneRenderer *SceneRender) const
 
void RenderDepth (FRDGBuilder &GraphBuilder, const FSceneRenderer *SceneRenderer, FRDGTextureRef ShadowDepthTexture, bool bDoParallelDispatch, bool bDoCrossGPUCopy)
 
void ResetRayTracedDistanceFieldShadow (const FViewInfo *View)
 
FScreenPassTexture RenderRayTracedDistanceFieldProjection (FRDGBuilder &GraphBuilder, bool bAsyncCompute, const FMinimalSceneTextures &SceneTextures, const FViewInfo &View, const FIntRect &ScissorRect)
 
void RenderRayTracedDistanceFieldProjection (FRDGBuilder &GraphBuilder, const FMinimalSceneTextures &SceneTextures, FRDGTextureRef ScreenShadowMaskTexture, const FViewInfo &View, FIntRect ScissorRect, bool bProjectingForForwardShading, bool bForceRGBModulation=false, FTiledShadowRendering *TiledShadowRendering=nullptr)
 
void RenderOnePassPointLightProjection (FRDGBuilder &GraphBuilder, const FShadowProjectionPassParameters &CommonPassParameters, int32 ViewIndex, const FViewInfo &View, const FLightSceneProxy *LightSceneProxy, bool bProjectingForForwardShading, bool bSubPixelShadow) const
 
void RenderFrustumWireframe (FPrimitiveDrawInterface *PDI) const
 
bool AddSubjectPrimitive (FPrimitiveSceneInfo *PrimitiveSceneInfo, TArrayView< FViewInfo > ViewArray, bool bRecordShadowSubjectForMobileShading, bool bInvertViewShadowRelevance=false)
 
uint64 AddSubjectPrimitive_AnyThread (const FPrimitiveSceneInfoCompact &PrimitiveSceneInfoCompact, TArrayView< FViewInfo > ViewArray, ERHIFeatureLevel::Type FeatureLevel, struct FAddSubjectPrimitiveStats &OutStats, struct FAddSubjectPrimitiveOverflowedIndices &OverflowBuffer) const
 
void PresizeSubjectPrimitiveArrays (struct FAddSubjectPrimitiveStats const &Stats)
 
void FinalizeAddSubjectPrimitive (FDynamicShadowsTaskData &TaskData, struct FAddSubjectPrimitiveOp const &Op, TArrayView< FViewInfo > ViewArray, struct FFinalizeAddSubjectPrimitiveContext &Context)
 
bool HasSubjectPrims () const
 
void AddReceiverPrimitive (FPrimitiveSceneInfo *PrimitiveSceneInfo)
 
bool GatherDynamicMeshElements (FMeshElementCollector &MeshCollector, FSceneRenderer &Renderer, class FVisibleLightInfo &VisibleLightInfo, TArray< const FSceneView * > &ReusedViewsArray, EGatherDynamicMeshElementsPass Pass)
 
void SetupMeshDrawCommandsForShadowDepth (FSceneRenderer &Renderer, FInstanceCullingManager &InstanceCullingManager)
 
void SetupMeshDrawCommandsForProjectionStenciling (FSceneRenderer &Renderer, FInstanceCullingManager &InstanceCullingManager)
 
bool SubjectsVisible (const FViewInfo &View) const
 
void ClearTransientArrays ()
 
FMatrix GetScreenToShadowMatrix (const FSceneView &View) const
 
FVector4f GetClipToShadowBufferUvScaleBias () const
 
FMatrix GetScreenToShadowMatrix (const FSceneView &View, uint32 TileOffsetX, uint32 TileOffsetY, uint32 TileResolutionX, uint32 TileResolutionY) const
 
FMatrix GetWorldToShadowMatrix (FVector4f &ShadowmapMinMax, const FIntPoint *ShadowBufferResolutionOverride=nullptr) const
 
FIntPoint GetShadowBufferResolution () const
 
void UpdateShaderDepthBias ()
 
float ComputeTransitionSize () const
 
bool IsWholeSceneDirectionalShadow () const
 
bool IsWholeScenePointLightShadow () const
 
bool ShouldClampToNearPlane () const
 
FLightSceneInfoGetLightSceneInfo () const
 
const FLightSceneInfoCompactGetLightSceneInfoCompact () const
 
const FPrimitiveSceneInfoGetParentSceneInfo () const
 
void SetupShadowDepthView (FSceneRenderer *SceneRenderer)
 
EShadowDepthType GetShadowDepthType () const
 
EMeshPass::Type GetTargetMeshPassType () const
 
bool HasVirtualShadowMap () const
 
FParallelMeshDrawCommandPassGetShadowDepthPass ()
 
float GetMaxNonFarCascadeDistance () const
 
void BuildRenderingCommands (FRDGBuilder &GraphBuilder, FGPUScene &GPUScene, FInstanceCullingDrawParams &InstanceCullingDrawParams)
 
bool ShouldUseCSMScissorOptim () const
 
const TArray< FMeshBatchAndRelevance, SceneRenderingAllocator > & GetDynamicSubjectHeterogeneousVolumeMeshElements () const
 
- Public Member Functions inherited from FRefCountedObject
 FRefCountedObject ()
 
virtual ~FRefCountedObject ()
 
 FRefCountedObject (const FRefCountedObject &Rhs)=delete
 
FRefCountedObjectoperator= (const FRefCountedObject &Rhs)=delete
 
FReturnedRefCountValue AddRef () const
 
uint32 Release () const
 
uint32 GetRefCount () const
 

Static Public Member Functions

static bool SupportsShadowStencilCulling (FStaticShaderPlatform ShaderPlatform)
 
static FRHIBlendStateGetBlendStateForProjection (int32 ShadowMapChannel, bool bIsWholeSceneDirectionalShadow, bool bUseFadePlane, bool bProjectingForForwardShading, bool bMobileModulatedProjections)
 

Public Attributes

FViewInfoShadowDepthView
 
FShadowMapRenderTargets RenderTargets
 
EShadowDepthCacheMode CacheMode
 
FViewInfoDependentView
 
int32 ShadowId
 
FVector PreShadowTranslation
 
FMatrix TranslatedWorldToView
 
FMatrix ViewToClipInner
 
FMatrix ViewToClipOuter
 
FMatrix44f TranslatedWorldToClipInnerMatrix
 
FMatrix44f TranslatedWorldToClipOuterMatrix
 
FMatrix44f InvReceiverInnerMatrix
 
float InvMaxSubjectDepth
 
float MaxSubjectZ
 
float MinSubjectZ
 
FConvexVolume CasterOuterFrustum
 
FConvexVolume ReceiverInnerFrustum
 
float MinPreSubjectZ
 
FSphere ShadowBounds
 
FShadowCascadeSettings CascadeSettings
 
uint32 X
 
uint32 Y
 
uint32 ResolutionX
 
uint32 ResolutionY
 
uint32 BorderSize
 
FIntRect ScissorRectOptim
 
float MaxScreenPercent
 
TArray< float, TInlineAllocator< 2 > > FadeAlphas
 
uint32 bAllocated: 1
 
uint32 bRendered: 1
 
uint32 bAllocatedInPreshadowCache: 1
 
uint32 bDepthsCached: 1
 
uint32 bDirectionalLight: 1
 
uint32 bOnePassPointLightShadow: 1
 
uint32 bVSM: 1
 
uint32 bWholeSceneShadow: 1
 
uint32 bTranslucentShadow: 1
 
uint32 bRayTracedDistanceField: 1
 
uint32 bCapsuleShadow: 1
 
uint32 bPreShadow: 1
 
uint32 bSelfShadowOnly: 1
 
uint32 bPerObjectOpaqueShadow: 1
 
uint32 bTransmission: 1
 
uint32 bHairStrandsDeepShadow: 1
 
uint32 bNaniteGeometry: 1
 
uint32 bContainsNaniteSubjects: 1
 
uint32 bShouldRenderVSM: 1
 
uint32 bVolumetricShadow: 1
 
EShadowMeshSelection MeshSelectionMask = EShadowMeshSelection::All
 
TSharedPtr< FVirtualShadowMapPerLightCacheEntryVirtualShadowMapPerLightCacheEntry
 
TSharedPtr< FVirtualShadowMapClipmapVirtualShadowMapClipmap
 
TArray< FMatrixOnePassShadowViewProjectionMatrices
 
TArray< FMatrixOnePassShadowViewMatrices
 
FMatrix OnePassShadowFaceProjectionMatrix
 
float PerObjectShadowFadeStart
 
float InvPerObjectShadowFadeLength
 
float CSMScrollingZOffset
 
FVector4f OverlappedUVOnCachedShadowMap
 
FVector4f OverlappedUVOnCurrentShadowMap
 
TArray< FPlane, TInlineAllocator< 4 > > CSMScrollingExtraCullingPlanes
 
int32 ProjectionIndex = 0
 
int32 SubjectPrimitiveComponentIndex = -1
 
int32 ExplicitNaniteInstanceChunkStartOffset = INDEX_NONE
 
int32 ExplicitNaniteInstanceChunkEndOffset = INDEX_NONE
 
int32 ExplicitNaniteInstanceLastChunkSize = 0
 
TArray< int32, TInlineAllocator< 6 > > ViewIds
 

Friends

class FVirtualShadowMapArray
 
class FShadowDepthVS
 
class FShadowDepthBasePS
 
class FShadowVolumeBoundProjectionVS
 
class FShadowProjectionPS
 
uint32 GetTypeHash (const FProjectedShadowInfo *ProjectedShadowInfo)
 

Detailed Description

Information about a projected shadow.

Member Typedef Documentation

◆ PrimitiveArrayType

Member Enumeration Documentation

◆ EGatherDynamicMeshElementsPass

Enumerator
All 
Parallel 
Serial 

Constructor & Destructor Documentation

◆ FProjectedShadowInfo()

FProjectedShadowInfo::FProjectedShadowInfo ( )

◆ ~FProjectedShadowInfo()

FProjectedShadowInfo::~FProjectedShadowInfo ( )

Member Function Documentation

◆ AddReceiverPrimitive()

void FProjectedShadowInfo::AddReceiverPrimitive ( FPrimitiveSceneInfo PrimitiveSceneInfo)

Adds a primitive to the shadow's receiver list.

◆ AddSubjectPrimitive()

bool FProjectedShadowInfo::AddSubjectPrimitive ( FPrimitiveSceneInfo PrimitiveSceneInfo,
TArrayView< FViewInfo ViewArray,
bool  bRecordShadowSubjectForMobileShading,
bool  bInvertViewShadowRelevance = false 
)

Adds a primitive to the shadow's subject list.

◆ AddSubjectPrimitive_AnyThread()

uint64 FProjectedShadowInfo::AddSubjectPrimitive_AnyThread ( const FPrimitiveSceneInfoCompact PrimitiveSceneInfoCompact,
TArrayView< FViewInfo ViewArray,
ERHIFeatureLevel::Type  FeatureLevel,
struct FAddSubjectPrimitiveStats OutStats,
struct FAddSubjectPrimitiveOverflowedIndices OverflowBuffer 
) const

◆ BuildRenderingCommands()

void FProjectedShadowInfo::BuildRenderingCommands ( FRDGBuilder GraphBuilder,
FGPUScene GPUScene,
FInstanceCullingDrawParams InstanceCullingDrawParams 
)
inline

◆ ClearDepth()

void FProjectedShadowInfo::ClearDepth ( FRHICommandList RHICmdList) const

◆ ClearTransientArrays()

void FProjectedShadowInfo::ClearTransientArrays ( )

Clears arrays allocated with the scene rendering allocator.

Clears arrays allocated with the scene rendering allocator. Cached preshadows are reused across frames so scene rendering allocations will be invalid.

◆ ComputeScissorRectOptim()

void FProjectedShadowInfo::ComputeScissorRectOptim ( )

Compute the scissors coords to exclude portion of the CSM slices outside the view frustum

◆ ComputeTransitionSize()

float FProjectedShadowInfo::ComputeTransitionSize ( ) const

How large the soft PCF comparison should be, similar to DepthBias, before this was called TransitionScale and 1/Size

◆ FinalizeAddSubjectPrimitive()

void FProjectedShadowInfo::FinalizeAddSubjectPrimitive ( FDynamicShadowsTaskData TaskData,
struct FAddSubjectPrimitiveOp const &  Op,
TArrayView< FViewInfo ViewArray,
struct FFinalizeAddSubjectPrimitiveContext Context 
)

◆ GatherDynamicMeshElements()

bool FProjectedShadowInfo::GatherDynamicMeshElements ( FMeshElementCollector MeshCollector,
FSceneRenderer Renderer,
class FVisibleLightInfo VisibleLightInfo,
TArray< const FSceneView * > &  ReusedViewsArray,
EGatherDynamicMeshElementsPass  Pass 
)

Gathers dynamic mesh elements for all the shadow's primitives arrays.

◆ GetBlendStateForProjection() [1/2]

FRHIBlendState * FProjectedShadowInfo::GetBlendStateForProjection ( bool  bProjectingForForwardShading,
bool  bMobileModulatedProjections 
) const

◆ GetBlendStateForProjection() [2/2]

FRHIBlendState * FProjectedShadowInfo::GetBlendStateForProjection ( int32  ShadowMapChannel,
bool  bIsWholeSceneDirectionalShadow,
bool  bUseFadePlane,
bool  bProjectingForForwardShading,
bool  bMobileModulatedProjections 
)
static

◆ GetClipToShadowBufferUvScaleBias()

FVector4f FProjectedShadowInfo::GetClipToShadowBufferUvScaleBias ( ) const

◆ GetDynamicSubjectHeterogeneousVolumeMeshElements()

const TArray< FMeshBatchAndRelevance, SceneRenderingAllocator > & FProjectedShadowInfo::GetDynamicSubjectHeterogeneousVolumeMeshElements ( ) const
inline

◆ GetInnerViewRect()

FIntRect FProjectedShadowInfo::GetInnerViewRect ( ) const
inline

Get view rect excluding border area

◆ GetLightSceneInfo()

FLightSceneInfo & FProjectedShadowInfo::GetLightSceneInfo ( ) const
inline

◆ GetLightSceneInfoCompact()

const FLightSceneInfoCompact & FProjectedShadowInfo::GetLightSceneInfoCompact ( ) const
inline

◆ GetMaxNonFarCascadeDistance()

float FProjectedShadowInfo::GetMaxNonFarCascadeDistance ( ) const
inline

◆ GetOuterViewRect()

FIntRect FProjectedShadowInfo::GetOuterViewRect ( ) const
inline

Get view rect including border area

◆ GetParentSceneInfo()

const FPrimitiveSceneInfo * FProjectedShadowInfo::GetParentSceneInfo ( ) const
inline

Parent primitive of the shadow group that created this shadow, if not a bWholeSceneShadow. 0 if Setup...() wasn't called yet

◆ GetScreenToShadowMatrix() [1/2]

FMatrix FProjectedShadowInfo::GetScreenToShadowMatrix ( const FSceneView View) const
inline

Returns a matrix that transforms a screen space position into shadow space.

◆ GetScreenToShadowMatrix() [2/2]

FMatrix FProjectedShadowInfo::GetScreenToShadowMatrix ( const FSceneView View,
uint32  TileOffsetX,
uint32  TileOffsetY,
uint32  TileResolutionX,
uint32  TileResolutionY 
) const

Returns a matrix that transforms a screen space position into shadow space. Additional parameters allow overriding of shadow's tile location. Used with modulated shadows to reduce precision problems when calculating ScreenToShadow in pixel shader.

◆ GetShaderDepthBias()

float FProjectedShadowInfo::GetShaderDepthBias ( ) const
inline

◆ GetShaderMaxSlopeDepthBias()

float FProjectedShadowInfo::GetShaderMaxSlopeDepthBias ( ) const
inline

◆ GetShaderReceiverDepthBias()

float FProjectedShadowInfo::GetShaderReceiverDepthBias ( ) const

◆ GetShaderSlopeDepthBias()

float FProjectedShadowInfo::GetShaderSlopeDepthBias ( ) const
inline

◆ GetShadowBufferResolution()

FIntPoint FProjectedShadowInfo::GetShadowBufferResolution ( ) const
inline

Returns the resolution of the shadow buffer used for this shadow, based on the shadow's type.

◆ GetShadowDepthPass()

FParallelMeshDrawCommandPass & FProjectedShadowInfo::GetShadowDepthPass ( )
inline

◆ GetShadowDepthRenderingViewMatrices()

FViewMatrices FProjectedShadowInfo::GetShadowDepthRenderingViewMatrices ( int32  CubeFaceIndex = -1,
bool  bUseForVSMCubeFaceWorkaround = false 
) const

Get FViewMatrices instance set up for drawing geometry to the SM, using the outer projection, @parameter bUseForVSMCubeFaceWorkaround - If true, when get a cube face the OnePassShadowViewMatrices is flipped in Y to undo the flip used when creating OnePassShadowViewMatrices. This is also done when sampling the VSM.

◆ GetShadowDepthType()

EShadowDepthType FProjectedShadowInfo::GetShadowDepthType ( ) const
inline

◆ GetTargetMeshPassType()

EMeshPass::Type FProjectedShadowInfo::GetTargetMeshPassType ( ) const
inline

◆ GetWorldToShadowMatrix()

FMatrix FProjectedShadowInfo::GetWorldToShadowMatrix ( FVector4f ShadowmapMinMax,
const FIntPoint ShadowBufferResolutionOverride = nullptr 
) const

Returns a matrix that transforms a world space position into shadow space.

◆ HasSubjectPrims()

bool FProjectedShadowInfo::HasSubjectPrims ( ) const
Returns
TRUE if this shadow info has any casting subject prims to render

◆ HasVirtualShadowMap()

bool FProjectedShadowInfo::HasVirtualShadowMap ( ) const
inline

◆ IsWholeSceneDirectionalShadow()

bool FProjectedShadowInfo::IsWholeSceneDirectionalShadow ( ) const

◆ IsWholeScenePointLightShadow()

bool FProjectedShadowInfo::IsWholeScenePointLightShadow ( ) const

◆ PresizeSubjectPrimitiveArrays()

void FProjectedShadowInfo::PresizeSubjectPrimitiveArrays ( struct FAddSubjectPrimitiveStats const &  Stats)

◆ RenderDepth()

void FProjectedShadowInfo::RenderDepth ( FRDGBuilder GraphBuilder,
const FSceneRenderer SceneRenderer,
FRDGTextureRef  ShadowDepthTexture,
bool  bDoParallelDispatch,
bool  bDoCrossGPUCopy 
)

Renders the shadow subject depth, to a particular hacked view

◆ RenderFrustumWireframe()

void FProjectedShadowInfo::RenderFrustumWireframe ( FPrimitiveDrawInterface PDI) const

Renders the projected shadow's frustum wireframe with the given FPrimitiveDrawInterface.

◆ RenderMobileModulatedShadowProjection()

void FProjectedShadowInfo::RenderMobileModulatedShadowProjection ( FRHICommandList RHICmdList,
int32  ViewIndex,
const FViewInfo View,
const FLightSceneProxy LightSceneProxy,
const FSceneRenderer SceneRender 
) const

Projects the mobile modulated shadow onto the scene for a particular view.

◆ RenderOnePassPointLightProjection()

void FProjectedShadowInfo::RenderOnePassPointLightProjection ( FRDGBuilder GraphBuilder,
const FShadowProjectionPassParameters CommonPassParameters,
int32  ViewIndex,
const FViewInfo View,
const FLightSceneProxy LightSceneProxy,
bool  bProjectingForForwardShading,
bool  bSubPixelShadow 
) const

Render one pass point light shadow projections.

◆ RenderProjection()

void FProjectedShadowInfo::RenderProjection ( FRDGBuilder GraphBuilder,
const FShadowProjectionPassParameters CommonPassParameters,
int32  ViewIndex,
const FViewInfo View,
const FLightSceneProxy LightSceneProxy,
const FSceneRenderer SceneRender,
bool  bProjectingForForwardShading,
bool  bSubPixelShadow 
) const

Projects the shadow onto the scene for a particular view.

◆ RenderProjectionInternal()

void FProjectedShadowInfo::RenderProjectionInternal ( FRHICommandList RHICmdList,
int32  ViewIndex,
const FViewInfo View,
const FLightSceneProxy LightSceneProxy,
const FSceneRenderer SceneRender,
bool  bProjectingForForwardShading,
bool  bMobileModulatedProjections,
const FInstanceCullingDrawParams InstanceCullingDrawParams,
FRHIUniformBuffer HairStrandsUniformBuffer 
) const

◆ RenderRayTracedDistanceFieldProjection() [1/2]

FScreenPassTexture FProjectedShadowInfo::RenderRayTracedDistanceFieldProjection ( FRDGBuilder GraphBuilder,
bool  bAsyncCompute,
const FMinimalSceneTextures SceneTextures,
const FViewInfo View,
const FIntRect ScissorRect 
)

Render ray traced distance field shadows into a texture. Output texture is cached per view. This is useful to support async compute. (ie: kick off distance field shadows early in the frame using async compute, and then combine result into shadow mask texture when necessary)

◆ RenderRayTracedDistanceFieldProjection() [2/2]

void FProjectedShadowInfo::RenderRayTracedDistanceFieldProjection ( FRDGBuilder GraphBuilder,
const FMinimalSceneTextures SceneTextures,
FRDGTextureRef  ScreenShadowMaskTexture,
const FViewInfo View,
FIntRect  ScissorRect,
bool  bProjectingForForwardShading,
bool  bForceRGBModulation = false,
FTiledShadowRendering TiledShadowRendering = nullptr 
)

Renders ray traced distance field shadows into an existing texture. Will use cached results if already calculated earlier in the frame (ie: async compute)

◆ RenderTranslucencyDepths()

void FProjectedShadowInfo::RenderTranslucencyDepths ( FRDGBuilder GraphBuilder,
class FSceneRenderer SceneRenderer,
const FRenderTargetBindingSlots RenderTargets,
FInstanceCullingManager InstanceCullingManager 
)

Renders shadow maps for translucent primitives.

◆ ResetRayTracedDistanceFieldShadow()

void FProjectedShadowInfo::ResetRayTracedDistanceFieldShadow ( const FViewInfo View)
inline

Reset cached ray traced distance field shadows texture.

◆ SetStateForDepth()

void FProjectedShadowInfo::SetStateForDepth ( FMeshPassProcessorRenderState DrawRenderState) const

Set state for depth rendering

◆ SetStateForView()

void FProjectedShadowInfo::SetStateForView ( FRHICommandList RHICmdList,
bool  bRequiresBorderClamp = false 
) const

◆ SetupClipmapProjection()

void FProjectedShadowInfo::SetupClipmapProjection ( FLightSceneInfo InLightSceneInfo,
FViewInfo InDependentView,
const TSharedPtr< FVirtualShadowMapClipmap > &  VirtualShadowMapClipmap,
float  InMaxNonFarCascadeDistance 
)

for a clipmap shadow.

◆ SetupMeshDrawCommandsForProjectionStenciling()

void FProjectedShadowInfo::SetupMeshDrawCommandsForProjectionStenciling ( FSceneRenderer Renderer,
FInstanceCullingManager InstanceCullingManager 
)

◆ SetupMeshDrawCommandsForShadowDepth()

void FProjectedShadowInfo::SetupMeshDrawCommandsForShadowDepth ( FSceneRenderer Renderer,
FInstanceCullingManager InstanceCullingManager 
)

◆ SetupPerObjectProjection()

bool FProjectedShadowInfo::SetupPerObjectProjection ( FLightSceneInfo InLightSceneInfo,
const FPrimitiveSceneInfo InParentSceneInfo,
const FPerObjectProjectedShadowInitializer Initializer,
bool  bInPreShadow,
uint32  InResolutionX,
uint32  MaxShadowResolutionY,
uint32  InBorderSize,
float  InMaxScreenPercent,
bool  bInTranslucentShadow 
)

for a per-object shadow. e.g. translucent particle system or a dynamic object in a precomputed shadow situation

Parameters
InParentSceneInfomust not be 0
Returns
success, if false the shadow project is invalid and the projection should nto be created

◆ SetupShadowDepthView()

void FProjectedShadowInfo::SetupShadowDepthView ( FSceneRenderer SceneRenderer)

Creates a new view from the pool and caches it in ShadowDepthView for depth rendering.

◆ SetupWholeSceneProjection()

void FProjectedShadowInfo::SetupWholeSceneProjection ( FLightSceneInfo InLightSceneInfo,
FViewInfo InDependentView,
const FWholeSceneProjectedShadowInitializer Initializer,
uint32  InResolutionX,
uint32  InResolutionY,
uint32  InSnapResolutionX,
uint32  InSnapResolutionY,
uint32  InBorderSize 
)

for a whole-scene shadow.

◆ ShouldClampToNearPlane()

bool FProjectedShadowInfo::ShouldClampToNearPlane ( ) const
inline

◆ ShouldUseCSMScissorOptim()

bool FProjectedShadowInfo::ShouldUseCSMScissorOptim ( ) const

Check if we need to set the scissor rect to exclude portion of the CSM slices outside the view frustum

◆ SubjectsVisible()

bool FProjectedShadowInfo::SubjectsVisible ( const FViewInfo View) const
Parameters
Viewview to check visibility in
Returns
true if this shadow info has any subject prims visible in the view

◆ SupportsShadowStencilCulling()

bool FProjectedShadowInfo::SupportsShadowStencilCulling ( FStaticShaderPlatform  ShaderPlatform)
static

◆ UpdateShaderDepthBias()

void FProjectedShadowInfo::UpdateShaderDepthBias ( )

Computes and updates ShaderDepthBias and ShaderSlopeDepthBias

◆ UseShadowStencilCulling()

bool FProjectedShadowInfo::UseShadowStencilCulling ( const FViewInfo View) const

Friends And Related Symbol Documentation

◆ FShadowDepthBasePS

friend class FShadowDepthBasePS
friend

◆ FShadowDepthVS

friend class FShadowDepthVS
friend

◆ FShadowProjectionPS

friend class FShadowProjectionPS
friend

◆ FShadowVolumeBoundProjectionVS

◆ FVirtualShadowMapArray

◆ GetTypeHash

uint32 GetTypeHash ( const FProjectedShadowInfo ProjectedShadowInfo)
friend

Hash function.

Member Data Documentation

◆ bAllocated

uint32 FProjectedShadowInfo::bAllocated

Whether the shadow has been allocated in the shadow depth buffer, and its X and Y properties have been initialized.

◆ bAllocatedInPreshadowCache

uint32 FProjectedShadowInfo::bAllocatedInPreshadowCache

Whether the shadow has been allocated in the preshadow cache, so its X and Y properties offset into the preshadow cache depth buffer.

◆ bCapsuleShadow

uint32 FProjectedShadowInfo::bCapsuleShadow

Whether this is a per-object shadow that should use capsule shapes to shadow instead of the mesh's triangles.

◆ bContainsNaniteSubjects

uint32 FProjectedShadowInfo::bContainsNaniteSubjects

Whether the the shadow overlaps any nanite primitives

◆ bDepthsCached

uint32 FProjectedShadowInfo::bDepthsCached

Whether the shadow is in the preshadow cache and its depths are up to date.

◆ bDirectionalLight

uint32 FProjectedShadowInfo::bDirectionalLight

◆ bHairStrandsDeepShadow

uint32 FProjectedShadowInfo::bHairStrandsDeepShadow

Whether turn on hair strands deep shadow.

◆ bNaniteGeometry

uint32 FProjectedShadowInfo::bNaniteGeometry

Whether to render Nanite geometry into this shadow map.

◆ bOnePassPointLightShadow

uint32 FProjectedShadowInfo::bOnePassPointLightShadow

Whether the shadow is a point light shadow that renders all faces of a cubemap in one pass.

◆ BorderSize

uint32 FProjectedShadowInfo::BorderSize

Size of the border, if any, used to allow filtering without clamping for shadows stored in an atlas.

◆ bPerObjectOpaqueShadow

uint32 FProjectedShadowInfo::bPerObjectOpaqueShadow

Whether the shadow is a per object shadow or not.

◆ bPreShadow

uint32 FProjectedShadowInfo::bPreShadow

Whether the shadow is a preshadow or not. A preshadow is a per object shadow that handles the static environment casting on a dynamic receiver.

◆ bRayTracedDistanceField

uint32 FProjectedShadowInfo::bRayTracedDistanceField

Whether the shadow will be computed by ray tracing the distance field.

◆ bRendered

uint32 FProjectedShadowInfo::bRendered

Whether the shadow's projection has been rendered.

◆ bSelfShadowOnly

uint32 FProjectedShadowInfo::bSelfShadowOnly

To not cast a shadow on the ground outside the object and having higher quality (useful for first person weapon).

◆ bShouldRenderVSM

uint32 FProjectedShadowInfo::bShouldRenderVSM

◆ bTranslucentShadow

uint32 FProjectedShadowInfo::bTranslucentShadow

Whether this shadow should support casting shadows from translucent surfaces.

◆ bTransmission

uint32 FProjectedShadowInfo::bTransmission

Whether turn on back-lighting transmission.

◆ bVolumetricShadow

uint32 FProjectedShadowInfo::bVolumetricShadow

Whether this shadow should support casting shadows from volumetric surfaces.

◆ bVSM

uint32 FProjectedShadowInfo::bVSM

Whether the shadow is a virtual shadow map.

◆ bWholeSceneShadow

uint32 FProjectedShadowInfo::bWholeSceneShadow

Whether this shadow affects the whole scene or only a group of objects.

◆ CacheMode

EShadowDepthCacheMode FProjectedShadowInfo::CacheMode

◆ CascadeSettings

FShadowCascadeSettings FProjectedShadowInfo::CascadeSettings

◆ CasterOuterFrustum

FConvexVolume FProjectedShadowInfo::CasterOuterFrustum

Frustum containing all potential shadow casters. Including border area.

◆ CSMScrollingExtraCullingPlanes

TArray<FPlane, TInlineAllocator<4> > FProjectedShadowInfo::CSMScrollingExtraCullingPlanes

The extra culling planes to cull the static meshes which already in the overlapped area when scrolling the cached shadow map.

◆ CSMScrollingZOffset

float FProjectedShadowInfo::CSMScrollingZOffset

The Z offset in shadow light coordinate of the cached shadow bound center and current shadow bound center when scrolling the cached shadow map.

◆ DependentView

FViewInfo* FProjectedShadowInfo::DependentView

The main view this shadow must be rendered in, or NULL for a view independent shadow.

◆ ExplicitNaniteInstanceChunkEndOffset

int32 FProjectedShadowInfo::ExplicitNaniteInstanceChunkEndOffset = INDEX_NONE

◆ ExplicitNaniteInstanceChunkStartOffset

int32 FProjectedShadowInfo::ExplicitNaniteInstanceChunkStartOffset = INDEX_NONE

◆ ExplicitNaniteInstanceLastChunkSize

int32 FProjectedShadowInfo::ExplicitNaniteInstanceLastChunkSize = 0

◆ FadeAlphas

TArray<float, TInlineAllocator<2> > FProjectedShadowInfo::FadeAlphas

Fade Alpha per view.

◆ InvMaxSubjectDepth

float FProjectedShadowInfo::InvMaxSubjectDepth

◆ InvPerObjectShadowFadeLength

float FProjectedShadowInfo::InvPerObjectShadowFadeLength

◆ InvReceiverInnerMatrix

FMatrix44f FProjectedShadowInfo::InvReceiverInnerMatrix

◆ MaxScreenPercent

float FProjectedShadowInfo::MaxScreenPercent

The largest percent of either the width or height of any view.

◆ MaxSubjectZ

float FProjectedShadowInfo::MaxSubjectZ

Subject depth extents, in world space units. These can be used to convert shadow depth buffer values back into world space units.

◆ MeshSelectionMask

EShadowMeshSelection FProjectedShadowInfo::MeshSelectionMask = EShadowMeshSelection::All

◆ MinPreSubjectZ

float FProjectedShadowInfo::MinPreSubjectZ

◆ MinSubjectZ

float FProjectedShadowInfo::MinSubjectZ

◆ OnePassShadowFaceProjectionMatrix

FMatrix FProjectedShadowInfo::OnePassShadowFaceProjectionMatrix

Face projection matrix for cube map shadows.

◆ OnePassShadowViewMatrices

TArray<FMatrix> FProjectedShadowInfo::OnePassShadowViewMatrices

View matrices for each cubemap face, used by one pass point light shadows.

◆ OnePassShadowViewProjectionMatrices

TArray<FMatrix> FProjectedShadowInfo::OnePassShadowViewProjectionMatrices

View projection matrices for each cubemap face, used by one pass point light shadows.

◆ OverlappedUVOnCachedShadowMap

FVector4f FProjectedShadowInfo::OverlappedUVOnCachedShadowMap

◆ OverlappedUVOnCurrentShadowMap

FVector4f FProjectedShadowInfo::OverlappedUVOnCurrentShadowMap

◆ PerObjectShadowFadeStart

float FProjectedShadowInfo::PerObjectShadowFadeStart

Controls fading out of per-object shadows in the distance to avoid casting super-sharp shadows far away.

◆ PreShadowTranslation

FVector FProjectedShadowInfo::PreShadowTranslation

A translation that is applied to world-space before transforming by one of the shadow matrices.

◆ ProjectionIndex

int32 FProjectedShadowInfo::ProjectionIndex = 0

Projection index for light types that use multiple projections for shadows.

◆ ReceiverInnerFrustum

FConvexVolume FProjectedShadowInfo::ReceiverInnerFrustum

Frustum containing all shadow receivers. Excluding border area.

◆ RenderTargets

FShadowMapRenderTargets FProjectedShadowInfo::RenderTargets

The depth or color targets this shadow was rendered to.

◆ ResolutionX

uint32 FProjectedShadowInfo::ResolutionX

Resolution of the shadow, excluding the border. The full size of the region allocated to this shadow is therefore ResolutionX + 2 * BorderSize, ResolutionY + 2 * BorderSize.

◆ ResolutionY

uint32 FProjectedShadowInfo::ResolutionY

◆ ScissorRectOptim

FIntRect FProjectedShadowInfo::ScissorRectOptim

Scissor rect size to exclude portion of the CSM slices outside the view frustum

◆ ShadowBounds

FSphere FProjectedShadowInfo::ShadowBounds

◆ ShadowDepthView

FViewInfo* FProjectedShadowInfo::ShadowDepthView

The view to be used when rendering this shadow's depths. WARNING: This view is a bastardization of the 'main view' - i.e., the view used to render the visible geometry (or one of them in the case of multi-view, e.g., split screen) the only substantial differences are that the view matrix is overridden (using the 'HackOverrideViewMatrixForShadows') and the 'HackRemoveTemporalAAProjectionJitter' has been called, to presumably remove the AA Jitter. IT DOES NOT contain the correct shadow projection matrix, PreViewTranslation, or much else that you would expect. Instead use the GetShadowDepthRenderingViewMatrices() function to get these for rendering shadows. Main reason for this state of affairs is to facilitate code that depends on the 'main' view matrices for LOD calculations in various places.

◆ ShadowId

int32 FProjectedShadowInfo::ShadowId

Index of the shadow into FVisibleLightInfo::AllProjectedShadows.

◆ SubjectPrimitiveComponentIndex

int32 FProjectedShadowInfo::SubjectPrimitiveComponentIndex = -1

Index of the subject primitive for per object shadows.

◆ TranslatedWorldToClipInnerMatrix

FMatrix44f FProjectedShadowInfo::TranslatedWorldToClipInnerMatrix

Matrix used for rendering the shadow depth buffer.
Note that this does not necessarily contain all of the shadow casters with CSM, since the vertex shader flattens them onto the near plane of the projection.

◆ TranslatedWorldToClipOuterMatrix

FMatrix44f FProjectedShadowInfo::TranslatedWorldToClipOuterMatrix

◆ TranslatedWorldToView

FMatrix FProjectedShadowInfo::TranslatedWorldToView

The view matrix of the shadow, ALSO used as an override to the main view's view matrix when rendering the shadow depth pass.

◆ ViewIds

TArray<int32, TInlineAllocator<6> > FProjectedShadowInfo::ViewIds

◆ ViewToClipInner

FMatrix FProjectedShadowInfo::ViewToClipInner

View space to clip space. Excluding border area.

◆ ViewToClipOuter

FMatrix FProjectedShadowInfo::ViewToClipOuter

View space to clip space. Including border area.

◆ VirtualShadowMapClipmap

TSharedPtr<FVirtualShadowMapClipmap> FProjectedShadowInfo::VirtualShadowMapClipmap

◆ VirtualShadowMapPerLightCacheEntry

TSharedPtr<FVirtualShadowMapPerLightCacheEntry> FProjectedShadowInfo::VirtualShadowMapPerLightCacheEntry

◆ X

uint32 FProjectedShadowInfo::X

X and Y position of the shadow in the appropriate depth buffer. These are only initialized after the shadow has been allocated. The actual contents of the shadowmap are at X + BorderSize, Y + BorderSize.

◆ Y

uint32 FProjectedShadowInfo::Y

The documentation for this class was generated from the following files: