FMeshElementCollector

Encapsulates the gathering of meshes from the various [FPrimitiveSceneProxy](API\Runtime\Engine\FPrimitiveSceneProxy) classes.

Windows
MacOS
Linux

Inheritance Hierarchy

FMeshElementCollector

FRayTracingMeshResourceCollector

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/SceneManagement.h

Include

#include "SceneManagement.h"

Syntax

class FMeshElementCollector

Remarks

Encapsulates the gathering of meshes from the various FPrimitiveSceneProxy classes.

Variables

Name Description

Protected variable

const bool

 

bUseAsyncTasks

This is related to some cvars and FApp stuff and if true means calling code should use async tasks.

Protected variable

FGlobalDynamicI...

 

DynamicIndexBuffer

Dynamic buffer pools.

Protected variable

TArray< TArray<...

 

DynamicPrimitiveShaderDataPerView

Tracks dynamic primitive data for upload to GPU Scene for every view, when enabled.

Protected variable

FGlobalDynamicR...

 

DynamicReadBuffer

Protected variable

FGlobalDynamicV...

 

DynamicVertexBuffer

Protected variable

ERHIFeatureLeve...

 

FeatureLevel

Protected variable

TArray< TArray<...

 

MeshBatches

Meshes to render

Protected variable

TChunkedArray< ...

 

MeshBatchStorage

Using TChunkedArray which will never realloc as new elements are added

Protected variable

TArray< uint16,...

 

MeshIdInPrimitivePerView

Current Mesh Id In Primitive per view

Protected variable

TArray< int32, ...

 

NumMeshBatchElementsPerView

Number of elements in gathered meshes per view.

Protected variable

TArray< FOneFra...

 

OneFrameResources

Resources that will be deleted at the end of the frame.

Protected variable

TArray< TFuncti...

 

ParallelTasks

Tasks to wait for at the end of gathering dynamic mesh elements.

Protected variable

const FPrimitiv...

 

PrimitiveSceneProxy

Current primitive being gathered.

Protected variable

TArray< FSimple...

 

SimpleElementCollectors

PDIs

Protected variable

TArray< FMateri...

 

TemporaryProxies

Material proxies that will be deleted at the end of the frame.

Protected variable

TArray< FSceneV...

 

Views

Views being collected for

Constructors

Name Description

Protected function

FMeshElementCollector

(
    ERHIFeatureLevel::Type InFeatureLev...
)

Destructors

Name Description

Protected function

~FMeshElementCollector()

Functions

Name Description

Public function

void

 

AddMesh

(
    int32 ViewIndex,
    FMeshBatch& MeshBatch
)

Adds a mesh batch to the collector for the specified view so that it can be rendered.

Public function

FORCEINLINEv...

 

AddTask

(
    TFunction< void()>&& Task
)

Public function

FORCEINLINEv...

 

AddTask

(
    const TFunction< void()>& Task
)

Protected function

void

 

AddViewMeshArrays

(
    FSceneView* InView,
    TArray< FMeshBatchAndRelevance, Sce...,
    FSimpleElementCollector* ViewS...,
    TArray< FPrimitiveUniformShaderPara...,
    ERHIFeatureLevel::Type InFeatureLev...,
    FGlobalDynamicIndexBuffer* InD...,
    FGlobalDynamicVertexBuffer* In...,
    FGlobalDynamicReadBuffer* InDy...
)

Public function

FMeshBatch &

 

AllocateMesh()

Allocates an FMeshBatch that can be safely referenced by the collector (lifetime will be long enough).

Public function

T &

 

AllocateOneFrameResource

(
    ARGS&&... Args
)

Allocates a temporary resource that is safe to be referenced by an FMeshBatch added to the collector.

Protected function

void

 

ClearViewMeshArrays()

Public function

FGlobalDynam...

 

GetDynamicIndexBuffer()

Return dynamic index buffer for this collector.

Public function

FGlobalDynam...

 

GetDynamicReadBuffer()

Return dynamic read buffer for this collector.

Public function

FGlobalDynam...

 

GetDynamicVertexBuffer()

Return dynamic vertex buffer for this collector.

Public function Const

ERHIFeatureL...

 

GetFeatureLevel()

Public function Const

uint32

 

GetMeshBatchCount

(
    uint32 ViewIndex
)

Public function Const

uint32

 

GetMeshElementCount

(
    uint32 ViewIndex
)

Public function

FPrimitiveDr...

 

GetPDI

(
    int32 ViewIndex
)

Accesses the PDI for drawing lines, sprites, etc.

Public function

void

 

ProcessTasks()

Public function

void

 

RegisterOneFrameMaterialProxy

(
    FMaterialRenderProxy* Proxy
)

Add a material render proxy that will be cleaned up automatically

Protected function

void

 

SetPrimitive

(
    const FPrimitiveSceneProxy* In...,
    FHitProxyId DefaultHitProxyId
)

Public function Const

FORCEINLINE ...

 

ShouldUseTasks()

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback