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

#include <ShadowMap.h>

+ Inheritance diagram for FShadowMap2D:

Public Member Functions

ENGINE_API FShadowMap2D ()
 
ENGINE_API FShadowMap2D (const TMap< ULightComponent *, FShadowMapData2D * > &ShadowMapData)
 
ENGINE_API FShadowMap2D (TArray< FGuid > LightGuids)
 
ENGINE_API UTexture2DGetTexture ()
 
ENGINE_API const UTexture2DGetTexture () const
 
const FVector2DGetCoordinateScale () const
 
const FVector2DGetCoordinateBias () const
 
bool IsValid () const
 
bool IsShadowFactorTexture () const
 
virtual ENGINE_API void AddReferencedObjects (FReferenceCollector &Collector)
 
virtual ENGINE_API void Serialize (FArchive &Ar)
 
virtual ENGINE_API FShadowMapInteraction GetInteraction () const
 
virtual FShadowMap2DGetShadowMap2D ()
 
virtual const FShadowMap2DGetShadowMap2D () const
 
- Public Member Functions inherited from FShadowMap
 FShadowMap ()
 
 FShadowMap (TArray< FGuid > InLightGuids)
 
virtual ~FShadowMap ()
 
bool ContainsLight (const FGuid &LightGuid) const
 
void AddRef ()
 
void Release ()
 

Static Public Member Functions

static ENGINE_API void EncodeTextures (const FStaticLightingBuildContext *LightingContext, bool bLightingSuccessful, bool bMultithreadedEncode=false)
 
static ENGINE_API int32 EncodeSingleTexture (const FStaticLightingBuildContext *LightingContext, struct FShadowMapPendingTexture &PendingTexture, UShadowMapTexture2D *Texture, TArray< TArray< FFourDistanceFieldSamples > > &MipData)
 
static ENGINE_API TRefCountPtr< FShadowMap2DAllocateShadowMap (UObject *LightMapOuter, const TMap< ULightComponent *, FShadowMapData2D * > &ShadowMapData, const FBoxSphereBounds &Bounds, ELightMapPaddingType InPaddingType, EShadowMapFlags InShadowmapFlags)
 
static ENGINE_API TRefCountPtr< FShadowMap2DAllocateInstancedShadowMap (UObject *LightMapOuter, UInstancedStaticMeshComponent *Component, TArray< TMap< ULightComponent *, TUniquePtr< FShadowMapData2D > > > &&InstancedShadowMapData, UMapBuildDataRegistry *Registry, FGuid MapBuildDataId, const FBoxSphereBounds &Bounds, ELightMapPaddingType PaddingType, EShadowMapFlags ShadowmapFlags)
 

Protected Attributes

TObjectPtr< UShadowMapTexture2DTexture
 
FVector2D CoordinateScale
 
FVector2D CoordinateBias
 
bool bChannelValid [4]
 
FVector4f InvUniformPenumbraSize
 

Additional Inherited Members

- Public Types inherited from FShadowMap
enum  { SMT_None = 0 , SMT_2D = 2 }
 
- Public Attributes inherited from FShadowMap
TArray< FGuidLightGuids
 
- Protected Member Functions inherited from FShadowMap
virtual ENGINE_API void Cleanup ()
 

Constructor & Destructor Documentation

◆ FShadowMap2D() [1/3]

FShadowMap2D::FShadowMap2D ( )

◆ FShadowMap2D() [2/3]

FShadowMap2D::FShadowMap2D ( const TMap< ULightComponent *, FShadowMapData2D * > &  ShadowMapData)

◆ FShadowMap2D() [3/3]

FShadowMap2D::FShadowMap2D ( TArray< FGuid LightGuids)

Member Function Documentation

◆ AddReferencedObjects()

void FShadowMap2D::AddReferencedObjects ( FReferenceCollector Collector)
virtual

Reimplemented from FShadowMap.

◆ AllocateInstancedShadowMap()

TRefCountPtr< FShadowMap2D > FShadowMap2D::AllocateInstancedShadowMap ( UObject LightMapOuter,
UInstancedStaticMeshComponent Component,
TArray< TMap< ULightComponent *, TUniquePtr< FShadowMapData2D > > > &&  InstancedShadowMapData,
UMapBuildDataRegistry Registry,
FGuid  MapBuildDataId,
const FBoxSphereBounds Bounds,
ELightMapPaddingType  PaddingType,
EShadowMapFlags  ShadowmapFlags 
)
static

Allocates texture space for the shadow-map and stores the shadow-map's raw data for deferred encoding. If the shadow-map has no shadows in it, it will return NULL.

Parameters
Component- The component that owns this shadowmap
InstancedShadowMapData- The raw shadow-map data to fill the texture with.
Bounds- The bounds of the primitive the shadow-map will be rendered on. Used as a hint to pack shadow-maps on nearby primitives in the same texture.
InPaddingType- the method for padding the shadowmap.
ShadowmapFlags- flags that determine how the shadowmap is stored (e.g. streamed or not)

◆ AllocateShadowMap()

TRefCountPtr< FShadowMap2D > FShadowMap2D::AllocateShadowMap ( UObject LightMapOuter,
const TMap< ULightComponent *, FShadowMapData2D * > &  ShadowMapData,
const FBoxSphereBounds Bounds,
ELightMapPaddingType  InPaddingType,
EShadowMapFlags  InShadowmapFlags 
)
static

◆ EncodeSingleTexture()

static ENGINE_API int32 FShadowMap2D::EncodeSingleTexture ( const FStaticLightingBuildContext LightingContext,
struct FShadowMapPendingTexture PendingTexture,
UShadowMapTexture2D Texture,
TArray< TArray< FFourDistanceFieldSamples > > &  MipData 
)
static

Constructs mip maps for a single shadowmap texture.

◆ EncodeTextures()

static ENGINE_API void FShadowMap2D::EncodeTextures ( const FStaticLightingBuildContext LightingContext,
bool  bLightingSuccessful,
bool  bMultithreadedEncode = false 
)
static

Executes all pending shadow-map encoding requests.

Parameters
LightingContextContext in which the textures exist
bLightingSuccessfulWhether the lighting build was successful or not.

◆ GetCoordinateBias()

const FVector2D & FShadowMap2D::GetCoordinateBias ( ) const
inline

◆ GetCoordinateScale()

const FVector2D & FShadowMap2D::GetCoordinateScale ( ) const
inline

◆ GetInteraction()

FShadowMapInteraction FShadowMap2D::GetInteraction ( ) const
virtual

Implements FShadowMap.

◆ GetShadowMap2D() [1/2]

virtual FShadowMap2D * FShadowMap2D::GetShadowMap2D ( )
inlinevirtual

Reimplemented from FShadowMap.

◆ GetShadowMap2D() [2/2]

virtual const FShadowMap2D * FShadowMap2D::GetShadowMap2D ( ) const
inlinevirtual

Reimplemented from FShadowMap.

◆ GetTexture() [1/2]

UTexture2D * FShadowMap2D::GetTexture ( )

◆ GetTexture() [2/2]

const UTexture2D * FShadowMap2D::GetTexture ( ) const

◆ IsShadowFactorTexture()

bool FShadowMap2D::IsShadowFactorTexture ( ) const
inline

◆ IsValid()

bool FShadowMap2D::IsValid ( ) const
inline

◆ Serialize()

void FShadowMap2D::Serialize ( FArchive Ar)
virtual

Reimplemented from FShadowMap.

Member Data Documentation

◆ bChannelValid

bool FShadowMap2D::bChannelValid[4]
protected

Tracks which of the 4 channels has valid texture data.

◆ CoordinateBias

FVector2D FShadowMap2D::CoordinateBias
protected

The bias which is applied to the shadow-map coordinates before sampling the shadow-map textures.

◆ CoordinateScale

FVector2D FShadowMap2D::CoordinateScale
protected

The scale which is applied to the shadow-map coordinates before sampling the shadow-map textures.

◆ InvUniformPenumbraSize

FVector4f FShadowMap2D::InvUniformPenumbraSize
protected

Stores the inverse of the penumbra size, normalized. Stores 1 to interpret the shadowmap as a shadow factor directly, instead of as a distance field.

◆ Texture

TObjectPtr<UShadowMapTexture2D> FShadowMap2D::Texture
protected

The texture which contains the shadow-map data.


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