![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <PrimitiveSceneInfo.h>
Inheritance diagram for FPrimitiveSceneInfo:Public Types | |
| using | FPersistentId = FPersistentPrimitiveIndex |
Static Public Member Functions | |
| static void | AddToScene (FScene *Scene, TArrayView< FPrimitiveSceneInfo * > SceneInfos) |
| static void | AllocateGPUSceneInstances (FScene *Scene, const TArrayView< FPrimitiveSceneInfo * > &SceneInfos) |
| static void | UpdateStaticMeshes (FScene *Scene, TArrayView< FPrimitiveSceneInfo * > SceneInfos, EUpdateStaticMeshFlags UpdateFlags, bool bReAddToDrawLists=true) |
| static void | AddStaticMeshes (FRHICommandListBase &RHICmdList, FScene *Scene, TArrayView< FPrimitiveSceneInfo * > SceneInfos, bool bCacheMeshDrawCommands=true) |
Friends | |
| class | FSceneRenderer |
| struct | FViewDebugInfo |
| class | FScene |
The renderer's internal state for a single UPrimitiveComponent. This has a one to one mapping with FPrimitiveSceneProxy, which is in the engine module.
| FPrimitiveSceneInfo::FPrimitiveSceneInfo | ( | UPrimitiveComponent * | InPrimitive, |
| FScene * | InScene | ||
| ) |
Initialization constructor.
| FPrimitiveSceneInfo::FPrimitiveSceneInfo | ( | FPrimitiveSceneDesc * | InPrimitiveSceneDesc, |
| FScene * | InScene | ||
| ) |
| FPrimitiveSceneInfo::~FPrimitiveSceneInfo | ( | ) |
Destructor.
|
static |
Adds the primitive's static meshes to the scene.
|
static |
Adds the primitive to the scene.
|
static |
Allocate/Free slots for instance data in GPU-Scene
| void FPrimitiveSceneInfo::ApplyWorldOffset | ( | FRHICommandListBase & | RHICmdList, |
| FVector | InOffset | ||
| ) |
Shifts primitive position and all relevant data by an arbitrary delta. Called on world origin changes
| InOffset | - The delta to shift by |
| void FPrimitiveSceneInfo::CacheReflectionCaptures | ( | ) |
Cache per-primitive reflection captures used for mobile/forward rendering.
| FPrimitiveSceneInfo::DECLARE_MULTICAST_DELEGATE | ( | FPrimitiveSceneInfoEvent | ) |
| void FPrimitiveSceneInfo::FlushRuntimeVirtualTexture | ( | ) |
Mark the runtime virtual textures covered by this primitive as dirty.
| void FPrimitiveSceneInfo::FreeGPUSceneInstances | ( | ) |
| void FPrimitiveSceneInfo::GatherLightingAttachmentGroupPrimitives | ( | TArray< const FPrimitiveSceneInfo *, SceneRenderingAllocator > & | OutChildSceneInfos | ) | const |
| void FPrimitiveSceneInfo::GatherLightingAttachmentGroupPrimitives | ( | TArray< FPrimitiveSceneInfo *, SceneRenderingAllocator > & | OutChildSceneInfos | ) |
Builds an array of all primitive scene info's in this primitive's attachment group. This only works on potential parents (!LightingAttachmentRoot.IsValid()) and will include the current primitive in the output array.
| FBoxSphereBounds FPrimitiveSceneInfo::GetAttachmentGroupBounds | ( | ) | const |
Builds a cumulative bounding box of this primitive and all the primitives in the same attachment group. This only works on potential parents (!LightingAttachmentRoot.IsValid()).
| UPrimitiveComponent * FPrimitiveSceneInfo::GetComponentForDebugOnly | ( | ) | const |
| IPrimitiveComponent * FPrimitiveSceneInfo::GetComponentInterfaceForDebugOnly | ( | ) | const |
| FString FPrimitiveSceneInfo::GetFullnameForDebuggingOnly | ( | ) | const |
Return primitive fullname (for debugging only).
|
inline |
Retrieves the index of the primitive in the scene's primitives array. This index is only valid until a primitive is added to or removed from the scene!
|
inline |
Retrieves the address of the primitives index into in the scene's primitives array. This address is only for reference purposes
| FInstanceDataBufferHeader FPrimitiveSceneInfo::GetInstanceDataHeader | ( | ) | const |
Returns the updated header data in the InstanceDataUpdateTaskInfo without blocking. For a primitive without instances, it returns a header with an instance count of one.
|
inline |
|
inline |
| const FInstanceSceneDataBuffers * FPrimitiveSceneInfo::GetInstanceSceneDataBuffers | ( | ) | const |
Waits for (potential) instance update to produce the data, to avoid a sync, use GetInstanceDataHeader().
|
inline |
|
inline |
|
inline |
| uint32 FPrimitiveSceneInfo::GetMemoryFootprint | ( | ) |
Size this class uses in bytes
| const FMeshBatch * FPrimitiveSceneInfo::GetMeshBatch | ( | int8 | InLODIndex | ) | const |
Will output the FMeshBatch associated with the specified LODIndex.
|
inline |
|
inline |
| FString FPrimitiveSceneInfo::GetOwnerActorNameOrLabelForDebuggingOnly | ( | ) | const |
Return primitive Owner actor name (for debugging only).
|
inline |
Persistent index of the primitive in the range [0, FScene::GetMaxPersistentPrimitiveIndex() ). Where the max is never higher than the high watermark of the primitives in the scene. This index remains stable for the life-time of the primitive in the scene (i.e., same as PrimitiveSceneInfo and Proxy - between FScene::AddPrimitive / FScene::RemovePrimitive). The intended use is to enable tracking primitive data over time in renderer systems using direct indexing, e.g., for efficiently storing a bit per primitive. Direct indexing also facilitates easy GPU-reflection and access of the persistent data, where it can be accessed as e.g., GetPrimitiveData(...).PersistentPrimitiveIndex. It is allocated using FScene::PersistentPrimitiveIdAllocator from a range with holes that is kept as compact as possible up to the high-water mark of the scene primitives. Due to persistence this maximum can be substantially larger than the current number of Primitives at times, but never worse than the high-watermark. In the future, the index will likely be refactored to persist for the lifetime of the component (to facilitate tracking data past proxy re-creates). Note: It is not currently used to index any of the current FScene primitive arrays (use PackedIndex), though this is intended to change.
|
inline |
Get the packed LodInfo.
|
inline |
Returns the primitive scene data for this proxy.
Will output the LOD ranges of the static meshes used with this primitive.
|
inline |
|
inline |
Simple comparison against the invalid values used before/after scene add/remove.
| void FPrimitiveSceneInfo::LinkAttachmentGroup | ( | ) |
Adds the primitive to the scene's attachment groups.
| void FPrimitiveSceneInfo::LinkLODParentComponent | ( | ) |
Set LOD Parent primitive information to the scene.
|
inline |
Marks the primitive UB as needing updated and requests a GPU scene update
|
inline |
|
inline |
return true if we need to call LazyUpdateForRendering
| bool FPrimitiveSceneInfo::NeedsReflectionCaptureUpdate | ( | ) | const |
Returns whether the primitive needs to call CacheReflectionCaptures.
| void FPrimitiveSceneInfo::RefreshNaniteRasterBins | ( | ) |
Refreshes a primitive's references to raster bins. To be called after changes that might have invalidated them.
| void FPrimitiveSceneInfo::RemoveCachedReflectionCaptures | ( | ) |
Nulls out the cached per-primitive reflection captures.
Removes the primitive from the scene.
| void FPrimitiveSceneInfo::RemoveStaticMeshes | ( | ) |
Removes the primitive's static meshes from the scene.
| bool FPrimitiveSceneInfo::RequestGPUSceneUpdate | ( | EPrimitiveDirtyState | PrimitiveDirtyState = EPrimitiveDirtyState::ChangedAll | ) |
Adds a request to update GPU scene representation.
| void FPrimitiveSceneInfo::RequestStaticMeshUpdate | ( | ) |
Sets a flag to update the primitive's static meshes before it is next rendered.
| bool FPrimitiveSceneInfo::RequestUniformBufferUpdate | ( | ) |
Sets a flag to update the primitive's uniform buffer before it is next rendered.
|
inline |
| void FPrimitiveSceneInfo::UnlinkAttachmentGroup | ( | ) |
Removes the primitive from the scene's attachment groups.
| void FPrimitiveSceneInfo::UnlinkLODParentComponent | ( | ) |
clear LOD parent primitive information from the scene.
| void FPrimitiveSceneInfo::UpdateComponentLastRenderTime | ( | float | CurrentWorldTime, |
| bool | bUpdateLastRenderTimeOnScreen | ||
| ) |
Helper function for writing out to the last render times to the game thread
| void FPrimitiveSceneInfo::UpdateIndirectLightingCacheBuffer | ( | FRHICommandListBase & | RHICmdList | ) |
| void FPrimitiveSceneInfo::UpdateOcclusionFlags | ( | ) |
Update the occlusion flags for this primitive.
| int32 FPrimitiveSceneInfo::UpdateStaticLightingBuffer | ( | ) |
Updates static lighting uniform buffer, returns the number of entries needed for GPUScene
|
static |
Updates the primitive's static meshes in the scene.
|
friend |
|
friend |
| bool FPrimitiveSceneInfo::bNeedsCachedReflectionCaptureUpdate |
Whether the primitive is newly registered or moved and CachedReflectionCaptureProxy needs to be updated on the next render.
| bool FPrimitiveSceneInfo::bShouldRenderInMainPass |
Set to true for the primitive to be rendered in the main pass to be visible in a view.
| bool FPrimitiveSceneInfo::bVisibleInRealTimeSkyCapture |
Set to true for the primitive to be rendered into the real-time sky light reflection capture.
| bool FPrimitiveSceneInfo::bWritesRuntimeVirtualTexture |
True if the primitive can write to runtime virtual texture.
| const FPlanarReflectionSceneProxy* FPrimitiveSceneInfo::CachedPlanarReflectionProxy |
Planar reflection that was closest to this primitive, used for forward reflections.
| const FReflectionCaptureProxy* FPrimitiveSceneInfo::CachedReflectionCaptureProxies[MaxCachedReflectionCaptureProxies] |
| const FReflectionCaptureProxy* FPrimitiveSceneInfo::CachedReflectionCaptureProxy |
Reflection capture proxy that was closest to this primitive, used for the forward shading rendering path.
| HHitProxy* FPrimitiveSceneInfo::DefaultDynamicHitProxy |
The hit proxy which is used to represent the primitive's dynamic elements.
| FHitProxyId FPrimitiveSceneInfo::DefaultDynamicHitProxyId |
The ID of the hit proxy which is used to represent the primitive's dynamic elements.
| TArray<int32, TInlineAllocator<1> > FPrimitiveSceneInfo::DistanceFieldInstanceIndices |
Mapping from instance index in this primitive to index in the global distance field object buffers.
| float FPrimitiveSceneInfo::GpuLodInstanceRadius |
The sphere radius to use for per instance GPU Lodding. Will be 0.f if GPU LOD isn't enabled on this primitive.
| TArray<TRefCountPtr<HHitProxy> > FPrimitiveSceneInfo::HitProxies |
The hit proxies used by the primitive.
| const FIndirectLightingCacheAllocation* FPrimitiveSceneInfo::IndirectLightingCacheAllocation |
Caches the primitive's indirect lighting cache allocation. Note: This is only valid during the rendering of a frame, not just once the primitive is attached.
| TUniformBufferRef<FIndirectLightingCacheUniformParameters> FPrimitiveSceneInfo::IndirectLightingCacheUniformBuffer |
The uniform buffer holding precomputed lighting parameters for the indirect lighting cache allocation. WARNING : This can hold buffer valid for a single frame only, don't cache anywhere. See FPrimitiveSceneInfo::UpdateIndirectLightingCacheBuffer()
| float FPrimitiveSceneInfo::LastRenderTime |
Last render time in seconds since level started play.
| FPrimitiveComponentId FPrimitiveSceneInfo::LightingAttachmentRoot |
The root attachment component id for use with lighting, if valid. If the root id is not valid, this is a parent primitive.
| class FLightPrimitiveInteraction* FPrimitiveSceneInfo::LightList |
The list of lights affecting this primitive.
| FPrimitiveComponentId FPrimitiveSceneInfo::LODParentComponentId |
The component id of the LOD parent if valid.
| TArray<int32, TInlineAllocator<1> > FPrimitiveSceneInfo::LumenPrimitiveGroupIndices |
Mapping from instance index in this primitive to index in the LumenPrimitiveGroup array.
|
static |
| TArray<FNaniteMaterialSlot> FPrimitiveSceneInfo::NaniteMaterialSlots[ENaniteMeshPass::Num] |
| TArray<FNaniteRasterBin> FPrimitiveSceneInfo::NaniteRasterBins[ENaniteMeshPass::Num] |
| TArray<FNaniteShadingBin> FPrimitiveSceneInfo::NaniteShadingBins[ENaniteMeshPass::Num] |
| int32 FPrimitiveSceneInfo::NumMobileDynamicLocalLights |
The number of local lights with dynamic lighting for mobile
| FOctreeElementId2 FPrimitiveSceneInfo::OctreeId |
The identifier for the primitive in Scene->PrimitiveOctree.
|
static |
|
static |
| FPrimitiveComponentId FPrimitiveSceneInfo::PrimitiveComponentId |
Id for the component this primitive belongs to. This will stay the same for the lifetime of the component, so it can be used to identify the component across re-registers.
| FPrimitiveSceneProxy* FPrimitiveSceneInfo::Proxy |
The render proxy for the primitive.
| FScene* FPrimitiveSceneInfo::Scene |
The scene the primitive is in.
| TArray<class FCachedMeshDrawCommandInfo> FPrimitiveSceneInfo::StaticMeshCommandInfos |
The primitive's cached mesh draw commands infos for all static meshes. Kept separately from StaticMeshes for cache efficiency inside InitViews.
| TArray<class FStaticMeshBatch> FPrimitiveSceneInfo::StaticMeshes |
The primitive's static meshes.
| TArray<class FStaticMeshBatchRelevance> FPrimitiveSceneInfo::StaticMeshRelevances |
The primitive's static mesh relevances. Must be in sync with StaticMeshes. Kept separately from StaticMeshes for cache efficiency inside InitViews.