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

#include <ScenePrivate.h>

+ Inheritance diagram for FIndirectLightingCache:

Public Member Functions

 FIndirectLightingCache (ERHIFeatureLevel::Type InFeatureLevel)
 
virtual void InitRHI (FRHICommandListBase &RHICmdList)
 
virtual void ReleaseRHI ()
 
FIndirectLightingCacheAllocationAllocatePrimitive (const FPrimitiveSceneInfo *PrimitiveSceneInfo, bool bUnbuiltPreview)
 
void ReleasePrimitive (FPrimitiveComponentId PrimitiveId)
 
FIndirectLightingCacheAllocationFindPrimitiveAllocation (FPrimitiveComponentId PrimitiveId) const
 
void UpdateCache (FScene *Scene, FSceneRenderer &Renderer, bool bAllowUnbuiltPreview)
 
void StartUpdateCachePrimitivesTask (FScene *Scene, FSceneRenderer &Renderer, bool bAllowUnbuiltPreview, FILCUpdatePrimTaskData &OutTaskData)
 
void FinalizeCacheUpdates (FScene *Scene, FSceneRenderer &Renderer, FILCUpdatePrimTaskData &TaskData)
 
void SetLightingCacheDirty (FScene *Scene, const FPrecomputedLightVolume *Volume)
 
FRHITextureGetTexture0 ()
 
FRHITextureGetTexture1 ()
 
FRHITextureGetTexture2 ()
 
- Public Member Functions inherited from FRenderResource
RENDERCORE_API FRenderResource ()
 
RENDERCORE_API FRenderResource (ERHIFeatureLevel::Type InFeatureLevel)
 
RENDERCORE_API FRenderResource (const FRenderResource &)
 
RENDERCORE_API FRenderResource (FRenderResource &&)
 
RENDERCORE_API FRenderResourceoperator= (const FRenderResource &Other)
 
RENDERCORE_API FRenderResourceoperator= (FRenderResource &&Other)
 
virtual RENDERCORE_API ~FRenderResource ()
 
virtual RENDERCORE_API void InitResource (FRHICommandListBase &RHICmdList)
 
virtual RENDERCORE_API void ReleaseResource ()
 
RENDERCORE_API void UpdateRHI (FRHICommandListBase &RHICmdList)
 
virtual FString GetFriendlyName () const
 
bool IsInitialized () const
 
int32 GetListIndex () const
 
EInitPhase GetInitPhase () const
 
void SetOwnerName (FName InOwnerName)
 
FName GetOwnerName () const
 
void SetResourceName (FName InResourceName)
 
FName GetResourceName () const
 

Friends

class FUpdateCachePrimitivesTask
 

Additional Inherited Members

- Public Types inherited from FRenderResource
enum class  EInitPhase : uint8 { Pre , Default , MAX }
 
- Static Public Member Functions inherited from FRenderResource
static RENDERCORE_API void ReleaseRHIForAllResources ()
 
static RENDERCORE_API void InitPreRHIResources ()
 
static RENDERCORE_API void ChangeFeatureLevel (ERHIFeatureLevel::Type NewFeatureLevel)
 
static RENDERCORE_API FName SetScopeName (FName Name)
 
- Public Attributes inherited from FRenderResource
ERenderResourceState ResourceState = ERenderResourceState::Default
 
- Protected Member Functions inherited from FRenderResource
void SetFeatureLevel (const FStaticFeatureLevel InFeatureLevel)
 
const FStaticFeatureLevel GetFeatureLevel () const
 
bool HasValidFeatureLevel () const
 
template<typename T >
FBufferRHIRef CreateRHIBuffer (FRHICommandListBase &RHICmdList, T &InOutResourceObject, uint32 ResourceCount, EBufferUsageFlags InBufferUsageFlags, const TCHAR *InDebugName)
 
void SetInitPhase (EInitPhase InInitPhase)
 
- Static Protected Member Functions inherited from FRenderResource
static RENDERCORE_API FRHICommandListBaseGetImmediateCommandList ()
 

Detailed Description

Implements a volume texture atlas for caching indirect lighting on a per-object basis. The indirect lighting is interpolated from Lightmass SH volume lighting samples.

Constructor & Destructor Documentation

◆ FIndirectLightingCache()

FIndirectLightingCache::FIndirectLightingCache ( ERHIFeatureLevel::Type  InFeatureLevel)

true for the editor case where we want a better preview for object that have no valid lightmaps

Member Function Documentation

◆ AllocatePrimitive()

FIndirectLightingCacheAllocation * FIndirectLightingCache::AllocatePrimitive ( const FPrimitiveSceneInfo PrimitiveSceneInfo,
bool  bUnbuiltPreview 
)

Allocates a block in the volume texture atlas for a primitive.

◆ FinalizeCacheUpdates()

void FIndirectLightingCache::FinalizeCacheUpdates ( FScene Scene,
FSceneRenderer Renderer,
FILCUpdatePrimTaskData TaskData 
)

Wait on a previously started task and complete any block updates and debug draw

◆ FindPrimitiveAllocation()

FIndirectLightingCacheAllocation * FIndirectLightingCache::FindPrimitiveAllocation ( FPrimitiveComponentId  PrimitiveId) const

◆ GetTexture0()

FRHITexture * FIndirectLightingCache::GetTexture0 ( )
inline

◆ GetTexture1()

FRHITexture * FIndirectLightingCache::GetTexture1 ( )
inline

◆ GetTexture2()

FRHITexture * FIndirectLightingCache::GetTexture2 ( )
inline

◆ InitRHI()

void FIndirectLightingCache::InitRHI ( FRHICommandListBase RHICmdList)
virtual

Initializes the RHI resources used by this resource. Called when entering the state where both the resource and the RHI have been initialized. This is only called by the rendering thread.

Reimplemented from FRenderResource.

◆ ReleasePrimitive()

void FIndirectLightingCache::ReleasePrimitive ( FPrimitiveComponentId  PrimitiveId)

Releases the indirect lighting allocation for the given primitive.

◆ ReleaseRHI()

void FIndirectLightingCache::ReleaseRHI ( )
virtual

Releases the RHI resources used by this resource. Called when leaving the state where both the resource and the RHI have been initialized. This is only called by the rendering thread.

Reimplemented from FRenderResource.

◆ SetLightingCacheDirty()

void FIndirectLightingCache::SetLightingCacheDirty ( FScene Scene,
const FPrecomputedLightVolume Volume 
)

Force all primitive allocations to be re-interpolated.

◆ StartUpdateCachePrimitivesTask()

void FIndirectLightingCache::StartUpdateCachePrimitivesTask ( FScene Scene,
FSceneRenderer Renderer,
bool  bAllowUnbuiltPreview,
FILCUpdatePrimTaskData OutTaskData 
)

Starts a task to update the cache primitives. Results and task ref returned in the FILCUpdatePrimTaskData structure

◆ UpdateCache()

void FIndirectLightingCache::UpdateCache ( FScene Scene,
FSceneRenderer Renderer,
bool  bAllowUnbuiltPreview 
)

Updates indirect lighting in the cache based on visibility synchronously.

Friends And Related Symbol Documentation

◆ FUpdateCachePrimitivesTask


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