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

#include <ISMInstanceDataSceneProxy.h>

+ Inheritance diagram for FISMCInstanceDataSceneProxy:

Public Types

using FISMPrecomputedSpatialHashDataPtr = TSharedPtr< const FISMPrecomputedSpatialHashData, ESPMode::ThreadSafe >
 

Public Member Functions

 FISMCInstanceDataSceneProxy (FStaticShaderPlatform InShaderPlatform, ERHIFeatureLevel::Type InFeatureLevel)
 
const FInstanceSceneDataBuffersGetData () const
 
virtual void Update (FISMInstanceUpdateChangeSet &&ChangeSet)
 
virtual void Build (FISMInstanceUpdateChangeSet &&ChangeSet)
 
virtual void BuildFromLegacyData (TUniquePtr< FStaticMeshInstanceData > &&ExternalLegacyData, const FRenderBounds &InstanceLocalBounds, TArray< int32 > &&InLegacyInstanceReorderTable)
 
virtual void UpdatePrimitiveTransform (FISMInstanceUpdateChangeSet &&ChangeSet)
 
bool CheckPlatformFeatureLevel (FStaticShaderPlatform InShaderPlatform, ERHIFeatureLevel::Type InFeatureLevel)
 
virtual FInstanceDataUpdateTaskInfoGetUpdateTaskInfo ()
 
ENGINE_API void DebugDrawInstanceChanges (FPrimitiveDrawInterface *DebugPDI, ESceneDepthPriorityGroup SceneDepthPriorityGroup)
 
- Public Member Functions inherited from FInstanceDataSceneProxy
ENGINE_API FInstanceDataSceneProxy ()
 
ENGINE_API FInstanceDataSceneProxy (FInstanceSceneDataBuffers &&InInstanceSceneDataBuffers)
 
virtual ENGINE_API ~FInstanceDataSceneProxy ()
 
virtual const FInstanceSceneDataBuffersGeInstanceSceneDataBuffers () const
 
virtual FStaticMeshInstanceBufferGetLegacyInstanceBuffer ()
 

Static Public Member Functions

static ENGINE_API FVector3f GetLocalBoundsPadExtent (const FRenderTransform &LocalToWorld, float PadAmount)
 

Protected Member Functions

void BuildFromOptimizedDataBuffers (FISMInstanceUpdateChangeSet &ChangeSet, FInstanceIdIndexMap &OutInstanceIdIndexMap, FInstanceSceneDataBuffers::FWriteView &OutData)
 
template<typename IndexRemapType >
void UpdateIdMapping (FISMInstanceUpdateChangeSet &ChangeSet, const IndexRemapType &IndexRemap)
 
template<typename IndexRemapType >
void ApplyDataChanges (FISMInstanceUpdateChangeSet &ChangeSet, const IndexRemapType &IndexRemap, int32 PostUpdateNumInstances, FInstanceSceneDataBuffers::FWriteView &ProxyData)
 
template<typename IndexRemapType >
void ApplyAttributeChanges (FISMInstanceUpdateChangeSet &ChangeSet, const IndexRemapType &IndexRemap, FInstanceSceneDataBuffers::FWriteView &ProxyData)
 
void TestAndApplyInstanceBufferSizeFixup (int32 PostUpdateNumInstances)
 
- Protected Member Functions inherited from FInstanceDataSceneProxy
ENGINE_API void IncStatCounters ()
 
ENGINE_API void DecStatCounters ()
 

Protected Attributes

FStaticShaderPlatform ShaderPlatform
 
ERHIFeatureLevel::Type FeatureLevel
 
bool bUseLegacyRenderingPath = false
 
TBitArray ValidInstanceIdMask
 
FInstanceIdIndexMap InstanceIdIndexMap
 
FInstanceDataUpdateTaskInfo InstanceDataUpdateTaskInfo
 
bool bIsNew = true
 
bool bBuildOptimized = false
 
FISMPrecomputedSpatialHashDataPtr PrecomputedOptimizationData
 
- Protected Attributes inherited from FInstanceDataSceneProxy
FInstanceSceneDataBuffers InstanceSceneDataBuffers
 

Friends

class FPrimitiveInstanceDataManager
 

Detailed Description

Proxy class that represents scene instance data to the renderer. Responsible for preparing data for render use per-platform & serializing such data for cooked builds. Supplies a persistent ID mapping for use in FScene. The ID mapping is reset when the proxy is recreated. Thus the FScene will generate full remove/add handling for proxy recreate events. Not responsible for storing the component representation of the instance data.

TODO: Add concept of async update and needing to sync the proxy before use. Probably split between immutable data (e.g, flags and stuff that don't depend on a data conversion process) and the bulk of the data. The immutable part is always valid & up to date on the RT (set in command, or before it is added).

Member Typedef Documentation

◆ FISMPrecomputedSpatialHashDataPtr

Constructor & Destructor Documentation

◆ FISMCInstanceDataSceneProxy()

FISMCInstanceDataSceneProxy::FISMCInstanceDataSceneProxy ( FStaticShaderPlatform  InShaderPlatform,
ERHIFeatureLevel::Type  InFeatureLevel 
)

Member Function Documentation

◆ ApplyAttributeChanges()

void FISMCInstanceDataSceneProxy::ApplyAttributeChanges ( FISMInstanceUpdateChangeSet ChangeSet,
const IndexRemapType IndexRemap,
FInstanceSceneDataBuffers::FWriteView ProxyData 
)
protected

◆ ApplyDataChanges()

void FISMCInstanceDataSceneProxy::ApplyDataChanges ( FISMInstanceUpdateChangeSet ChangeSet,
const IndexRemapType IndexRemap,
int32  PostUpdateNumInstances,
FInstanceSceneDataBuffers::FWriteView ProxyData 
)
protected

◆ Build()

void FISMCInstanceDataSceneProxy::Build ( FISMInstanceUpdateChangeSet &&  ChangeSet)
virtual

◆ BuildFromLegacyData()

virtual void FISMCInstanceDataSceneProxy::BuildFromLegacyData ( TUniquePtr< FStaticMeshInstanceData > &&  ExternalLegacyData,
const FRenderBounds InstanceLocalBounds,
TArray< int32 > &&  InLegacyInstanceReorderTable 
)
inlinevirtual

◆ BuildFromOptimizedDataBuffers()

void FISMCInstanceDataSceneProxy::BuildFromOptimizedDataBuffers ( FISMInstanceUpdateChangeSet ChangeSet,
FInstanceIdIndexMap OutInstanceIdIndexMap,
FInstanceSceneDataBuffers::FWriteView OutData 
)
protected

Build an optimized instance buffer, where the order is sorted such that instances with the same spatial hash are consecutive.

◆ CheckPlatformFeatureLevel()

bool FISMCInstanceDataSceneProxy::CheckPlatformFeatureLevel ( FStaticShaderPlatform  InShaderPlatform,
ERHIFeatureLevel::Type  InFeatureLevel 
)
inline

Make sure the shader platform & feature levels match.

◆ DebugDrawInstanceChanges()

void FISMCInstanceDataSceneProxy::DebugDrawInstanceChanges ( FPrimitiveDrawInterface DebugPDI,
ESceneDepthPriorityGroup  SceneDepthPriorityGroup 
)
virtual

Reimplemented from FInstanceDataSceneProxy.

◆ GetData()

const FInstanceSceneDataBuffers & FISMCInstanceDataSceneProxy::GetData ( ) const
inline

◆ GetLocalBoundsPadExtent()

FVector3f FISMCInstanceDataSceneProxy::GetLocalBoundsPadExtent ( const FRenderTransform LocalToWorld,
float  PadAmount 
)
static

◆ GetUpdateTaskInfo()

virtual FInstanceDataUpdateTaskInfo * FISMCInstanceDataSceneProxy::GetUpdateTaskInfo ( )
inlinevirtual

Implement to provide syncable task info, if this returns a nullptr it is required that GeInstanceSceneDataBuffers() performs any needed synchronization.

Reimplemented from FInstanceDataSceneProxy.

◆ TestAndApplyInstanceBufferSizeFixup()

void FISMCInstanceDataSceneProxy::TestAndApplyInstanceBufferSizeFixup ( int32  PostUpdateNumInstances)
protected

◆ Update()

void FISMCInstanceDataSceneProxy::Update ( FISMInstanceUpdateChangeSet &&  ChangeSet)
virtual

Overridable functions to update / build proxy data from a change set.

Reimplemented in FISMCInstanceDataSceneProxyLegacyReordered, and FISMCInstanceDataSceneProxyNoGPUScene.

◆ UpdateIdMapping()

void FISMCInstanceDataSceneProxy::UpdateIdMapping ( FISMInstanceUpdateChangeSet ChangeSet,
const IndexRemapType IndexRemap 
)
protected

◆ UpdatePrimitiveTransform()

virtual void FISMCInstanceDataSceneProxy::UpdatePrimitiveTransform ( FISMInstanceUpdateChangeSet &&  ChangeSet)
inlinevirtual

Handle only updating the primitive transform, could make use of special cases such as translation only if implemented properly.

Reimplemented in FISMCInstanceDataSceneProxyLegacyReordered, and FISMCInstanceDataSceneProxyNoGPUScene.

Friends And Related Symbol Documentation

◆ FPrimitiveInstanceDataManager

Member Data Documentation

◆ bBuildOptimized

bool FISMCInstanceDataSceneProxy::bBuildOptimized = false
protected

◆ bIsNew

bool FISMCInstanceDataSceneProxy::bIsNew = true
protected

◆ bUseLegacyRenderingPath

bool FISMCInstanceDataSceneProxy::bUseLegacyRenderingPath = false
protected

◆ FeatureLevel

ERHIFeatureLevel::Type FISMCInstanceDataSceneProxy::FeatureLevel
protected

◆ InstanceDataUpdateTaskInfo

FInstanceDataUpdateTaskInfo FISMCInstanceDataSceneProxy::InstanceDataUpdateTaskInfo
protected

◆ InstanceIdIndexMap

FInstanceIdIndexMap FISMCInstanceDataSceneProxy::InstanceIdIndexMap
protected

◆ PrecomputedOptimizationData

FISMPrecomputedSpatialHashDataPtr FISMCInstanceDataSceneProxy::PrecomputedOptimizationData
protected

◆ ShaderPlatform

FStaticShaderPlatform FISMCInstanceDataSceneProxy::ShaderPlatform
protected

◆ ValidInstanceIdMask

TBitArray FISMCInstanceDataSceneProxy::ValidInstanceIdMask
protected

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