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

#include <LightMap.h>

+ Inheritance diagram for FLightMap2D:

Public Member Functions

ENGINE_API FLightMap2D ()
 
ENGINE_API FLightMap2D (bool InAllowHighQualityLightMaps)
 
ENGINE_API const UTexture2DGetTexture (uint32 BasisIndex) const
 
ENGINE_API UTexture2DGetTexture (uint32 BasisIndex)
 
void GetReferencedTextures (TArray< UTexture2D * > &OutTextures) const
 
ENGINE_API UTexture2DGetSkyOcclusionTexture () const
 
ENGINE_API UTexture2DGetAOMaterialMaskTexture () const
 
ULightMapVirtualTexture2DGetVirtualTexture (uint32 BasisIndex) const
 
ENGINE_API bool IsVirtualTextureValid () const
 
ENGINE_API bool IsValid (uint32 BasisIndex) const
 
const FVector2DGetCoordinateScale () const
 
const FVector2DGetCoordinateBias () const
 
virtual ENGINE_API void AddReferencedObjects (FReferenceCollector &Collector)
 
virtual ENGINE_API void Serialize (FArchive &Ar)
 
virtual ENGINE_API FLightMapInteraction GetInteraction (ERHIFeatureLevel::Type InFeatureLevel) const
 
virtual ENGINE_API FShadowMapInteraction GetShadowInteraction (ERHIFeatureLevel::Type InFeatureLevel) const
 
virtual const FLightMap2DGetLightMap2D () const
 
virtual FLightMap2DGetLightMap2D ()
 
- Public Member Functions inherited from FLightMap
ENGINE_API FLightMap ()
 
virtual ~FLightMap ()
 
bool ContainsLight (const FGuid &LightGuid) const
 
void AddRef ()
 
void Release ()
 
bool AllowsHighQualityLightmaps () const
 

Static Public Member Functions

static ENGINE_API TRefCountPtr< FLightMap2DAllocateLightMap (UObject *LightMapOuter, FQuantizedLightmapData *&SourceQuantizedData, const TMap< ULightComponent *, FShadowMapData2D * > &SourceShadowMapData, const FBoxSphereBounds &Bounds, ELightMapPaddingType InPaddingType, ELightMapFlags InLightmapFlags)
 
static ENGINE_API TRefCountPtr< FLightMap2DAllocateInstancedLightMap (UObject *LightMapOuter, UInstancedStaticMeshComponent *Component, TArray< TUniquePtr< FQuantizedLightmapData > > SourceQuantizedData, TArray< TMap< ULightComponent *, TUniquePtr< FShadowMapData2D > > > &&InstancedShadowMapData, UMapBuildDataRegistry *Registry, FGuid MapBuildDataId, const FBoxSphereBounds &Bounds, ELightMapPaddingType InPaddingType, ELightMapFlags LightmapFlags)
 
static ENGINE_API void EncodeTextures (const FStaticLightingBuildContext *LightingContext, bool bLightingSuccessful, bool bMultithreadedEncode=false)
 
static void SetStatusUpdate (bool bInEnable)
 
static bool GetStatusUpdate ()
 

Public Attributes

TObjectPtr< ULightMapTexture2DTextures [2]
 
TObjectPtr< ULightMapTexture2DSkyOcclusionTexture
 
TObjectPtr< ULightMapTexture2DAOMaterialMaskTexture
 
TObjectPtr< UShadowMapTexture2DShadowMapTexture
 
TObjectPtr< ULightMapVirtualTexture2DVirtualTextures [2]
 
FVector4f ScaleVectors [NUM_STORED_LIGHTMAP_COEF]
 
FVector4f AddVectors [NUM_STORED_LIGHTMAP_COEF]
 
FVector2D CoordinateScale
 
FVector2D CoordinateBias
 
FVector4f InvUniformPenumbraSize
 
bool bShadowChannelValid [4]
 
- Public Attributes inherited from FLightMap
TArray< FGuidLightGuids
 

Protected Member Functions

ENGINE_API FLightMap2D (const TArray< FGuid > &InLightGuids)
 
- Protected Member Functions inherited from FLightMap
virtual ENGINE_API void Cleanup ()
 

Static Protected Attributes

static ENGINE_API bool bUpdateStatus = true
 

Additional Inherited Members

- Public Types inherited from FLightMap
enum  { LMT_None = 0 , LMT_1D = 1 , LMT_2D = 2 }
 
- Protected Attributes inherited from FLightMap
bool bAllowHighQualityLightMaps
 

Detailed Description

A 2D array of incident lighting data.

Constructor & Destructor Documentation

◆ FLightMap2D() [1/3]

FLightMap2D::FLightMap2D ( )

◆ FLightMap2D() [2/3]

ENGINE_API FLightMap2D::FLightMap2D ( bool  InAllowHighQualityLightMaps)

◆ FLightMap2D() [3/3]

FLightMap2D::FLightMap2D ( const TArray< FGuid > &  InLightGuids)
protected

Member Function Documentation

◆ AddReferencedObjects()

void FLightMap2D::AddReferencedObjects ( FReferenceCollector Collector)
virtual

Reimplemented from FLightMap.

◆ AllocateInstancedLightMap()

TRefCountPtr< FLightMap2D > FLightMap2D::AllocateInstancedLightMap ( UObject LightMapOuter,
UInstancedStaticMeshComponent Component,
TArray< TUniquePtr< FQuantizedLightmapData > >  SourceQuantizedData,
TArray< TMap< ULightComponent *, TUniquePtr< FShadowMapData2D > > > &&  InstancedShadowMapData,
UMapBuildDataRegistry Registry,
FGuid  MapBuildDataId,
const FBoxSphereBounds Bounds,
ELightMapPaddingType  InPaddingType,
ELightMapFlags  LightmapFlags 
)
static

Allocates texture space for the light-map and stores the light-map's raw data for deferred encoding. If the light-map has no lights in it, it will return NULL. SourceQuantizedData will be deleted by this function.

Parameters
Component- The component that owns this lightmap
SourceQuantizedData- If the data is already quantized, the values will be in here, and not in RawData.
Bounds- The bounds of the primitive the light-map will be rendered on. Used as a hint to pack light-maps on nearby primitives in the same texture.
InPaddingType- the method for padding the lightmap.
LightmapFlags- flags that determine how the lightmap is stored (e.g. streamed or not)

◆ AllocateLightMap()

TRefCountPtr< FLightMap2D > FLightMap2D::AllocateLightMap ( UObject LightMapOuter,
FQuantizedLightmapData *&  SourceQuantizedData,
const TMap< ULightComponent *, FShadowMapData2D * > &  SourceShadowMapData,
const FBoxSphereBounds Bounds,
ELightMapPaddingType  InPaddingType,
ELightMapFlags  InLightmapFlags 
)
static

Allocates texture space for the light-map and stores the light-map's raw data for deferred encoding. If the light-map has no lights in it, it will return NULL. SourceQuantizedData will be deleted by this function.

Parameters
LightMapOuter- The package to create the light-map and textures in.
SourceQuantizedData- If the data is already quantized, the values will be in here, and not in RawData.
SourceShadowMapData- Shadow map data to be combined into the lightmap atlas, used when creating VT lightmaps
Bounds- The bounds of the primitive the light-map will be rendered on. Used as a hint to pack light-maps on nearby primitives in the same texture.
InPaddingType- the method for padding the lightmap.
LightmapFlags- flags that determine how the lightmap is stored (e.g. streamed or not)

◆ EncodeTextures()

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

Executes all pending light-map encoding requests.

Parameters
bLightingSuccessfulWhether the lighting build was successful or not.
bForceCompletionForce all encoding to be fully completed (they may be asynchronous).

Executes all pending light-map encoding requests.

Parameters
bLightingSuccessfulWhether the lighting build was successful or not.
bMultithreadedEncodeencode textures on different threads ;)

◆ GetAOMaterialMaskTexture()

UTexture2D * FLightMap2D::GetAOMaterialMaskTexture ( ) const

◆ GetCoordinateBias()

const FVector2D & FLightMap2D::GetCoordinateBias ( ) const
inline

◆ GetCoordinateScale()

const FVector2D & FLightMap2D::GetCoordinateScale ( ) const
inline

◆ GetInteraction()

FLightMapInteraction FLightMap2D::GetInteraction ( ERHIFeatureLevel::Type  InFeatureLevel) const
virtual

Implements FLightMap.

◆ GetLightMap2D() [1/2]

virtual FLightMap2D * FLightMap2D::GetLightMap2D ( )
inlinevirtual

Reimplemented from FLightMap.

◆ GetLightMap2D() [2/2]

virtual const FLightMap2D * FLightMap2D::GetLightMap2D ( ) const
inlinevirtual

Reimplemented from FLightMap.

◆ GetReferencedTextures()

void FLightMap2D::GetReferencedTextures ( TArray< UTexture2D * > &  OutTextures) const
inline

◆ GetShadowInteraction()

FShadowMapInteraction FLightMap2D::GetShadowInteraction ( ERHIFeatureLevel::Type  InFeatureLevel) const
virtual

Reimplemented from FLightMap.

◆ GetSkyOcclusionTexture()

UTexture2D * FLightMap2D::GetSkyOcclusionTexture ( ) const

Returns SkyOcclusionTexture.

Returns
The SkyOcclusionTexture.

◆ GetStatusUpdate()

static bool FLightMap2D::GetStatusUpdate ( )
inlinestatic

◆ GetTexture() [1/2]

UTexture2D * FLightMap2D::GetTexture ( uint32  BasisIndex)

◆ GetTexture() [2/2]

const UTexture2D * FLightMap2D::GetTexture ( uint32  BasisIndex) const

Returns the texture containing the RGB coefficients for a specific basis.

Parameters
BasisIndex- The basis index.
Returns
The RGB coefficient texture.

◆ GetVirtualTexture()

ULightMapVirtualTexture2D * FLightMap2D::GetVirtualTexture ( uint32  BasisIndex) const
inline

◆ IsValid()

bool FLightMap2D::IsValid ( uint32  BasisIndex) const

Returns whether the specified basis has a valid lightmap texture or not.

Parameters
BasisIndex- The basis index.
Returns
true if the specified basis has a valid lightmap texture, otherwise false

◆ IsVirtualTextureValid()

bool FLightMap2D::IsVirtualTextureValid ( ) const

◆ Serialize()

void FLightMap2D::Serialize ( FArchive Ar)
virtual

Reimplemented from FLightMap.

◆ SetStatusUpdate()

static void FLightMap2D::SetStatusUpdate ( bool  bInEnable)
inlinestatic

Call to enable/disable status update of LightMap encoding

Member Data Documentation

◆ AddVectors

FVector4f FLightMap2D::AddVectors[NUM_STORED_LIGHTMAP_COEF]

Bias value to apply to the coefficients.

◆ AOMaterialMaskTexture

TObjectPtr<ULightMapTexture2D> FLightMap2D::AOMaterialMaskTexture

◆ bShadowChannelValid

bool FLightMap2D::bShadowChannelValid[4]

Tracks which of the 4 channels has valid texture data.

◆ bUpdateStatus

bool FLightMap2D::bUpdateStatus = true
staticprotected

If true, update the status when encoding light maps

◆ CoordinateBias

FVector2D FLightMap2D::CoordinateBias

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

◆ CoordinateScale

FVector2D FLightMap2D::CoordinateScale

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

◆ InvUniformPenumbraSize

FVector4f FLightMap2D::InvUniformPenumbraSize

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.

◆ ScaleVectors

FVector4f FLightMap2D::ScaleVectors[NUM_STORED_LIGHTMAP_COEF]

A scale to apply to the coefficients.

◆ ShadowMapTexture

TObjectPtr<UShadowMapTexture2D> FLightMap2D::ShadowMapTexture

◆ SkyOcclusionTexture

TObjectPtr<ULightMapTexture2D> FLightMap2D::SkyOcclusionTexture

◆ Textures

TObjectPtr<ULightMapTexture2D> FLightMap2D::Textures[2]

The textures containing the light-map data.

◆ VirtualTextures

TObjectPtr<ULightMapVirtualTexture2D > FLightMap2D::VirtualTextures[2]

The virtual textures containing the light-map data.


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