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

#include <BatchedElements.h>

Classes

class  FAllocationInfo
 

Public Member Functions

ENGINE_API FBatchedElements ()
 
ENGINE_API void AddLine (const FVector &Start, const FVector &End, const FLinearColor &Color, FHitProxyId HitProxyId, float Thickness=0.0f, float DepthBias=0.0f, bool bScreenSpace=false)
 
ENGINE_API void AddTranslucentLine (const FVector &Start, const FVector &End, const FLinearColor &Color, FHitProxyId HitProxyId, float Thickness=0.0f, float DepthBias=0.0f, bool bScreenSpace=false)
 
ENGINE_API void AddPoint (const FVector &Position, float Size, const FLinearColor &Color, FHitProxyId HitProxyId)
 
ENGINE_API int32 AddVertex (const FVector4 &InPosition, const FVector2D &InTextureCoordinate, const FLinearColor &InColor, FHitProxyId HitProxyId)
 
ENGINE_API int32 AddVertexf (const FVector4f &InPosition, const FVector2f &InTextureCoordinate, const FLinearColor &InColor, FHitProxyId HitProxyId)
 
ENGINE_API void AddTriangle (int32 V0, int32 V1, int32 V2, const FTexture *Texture, EBlendMode BlendMode)
 
ENGINE_API void AddTriangle (int32 V0, int32 V1, int32 V2, const FTexture *Texture, ESimpleElementBlendMode BlendMode, const FDepthFieldGlowInfo &GlowInfo=FDepthFieldGlowInfo())
 
ENGINE_API void AddTriangle (int32 V0, int32 V1, int32 V2, FBatchedElementParameters *BatchedElementParameters, ESimpleElementBlendMode BlendMode)
 
ENGINE_API void AddReserveTriangles (int32 NumMeshTriangles, const FTexture *Texture, ESimpleElementBlendMode BlendMode)
 
ENGINE_API void ReserveTriangles (int32 NumMeshTriangles, const FTexture *Texture, ESimpleElementBlendMode BlendMode)
 
ENGINE_API void AddReserveVertices (int32 NumMeshVerts)
 
ENGINE_API void ReserveVertices (int32 NumMeshVerts)
 
ENGINE_API void AddReserveLines (int32 NumLines, bool bDepthBiased=false, bool bThickLines=false)
 
ENGINE_API void AddSprite (const FVector &Position, float SizeX, float SizeY, const FTexture *Texture, const FLinearColor &Color, FHitProxyId HitProxyId, float U, float UL, float V, float VL, uint8 BlendMode, float OpacityMaskRefVal)
 
ENGINE_API bool Draw (FRHICommandList &RHICmdList, const FMeshPassProcessorRenderState &DrawRenderState, ERHIFeatureLevel::Type FeatureLevel, const FSceneView &View, bool bHitTesting, float Gamma=1.0f, EBlendModeFilter::Type Filter=EBlendModeFilter::All, uint32 NumInstances=1) const
 
bool HasPrimsToDraw () const
 
ENGINE_API void AddTriangleExtensive (int32 V0, int32 V1, int32 V2, FBatchedElementParameters *BatchedElementParameters, const FTexture *Texture, ESimpleElementBlendMode BlendMode, const FDepthFieldGlowInfo &GlowInfo=FDepthFieldGlowInfo())
 
ENGINE_API void Clear ()
 
uint32 GetAllocatedSize (void) const
 
void EnableMobileHDREncoding (bool bInEnableHDREncoding)
 
ENGINE_API void AddAllocationInfo (FAllocationInfo &AllocationInfo) const
 
ENGINE_API void Reserve (const FAllocationInfo &AllocationInfo)
 
ENGINE_API void Append (FBatchedElements &Other)
 

Static Public Member Functions

static ENGINE_API FSceneView CreateProxySceneView (const FMatrix &ProjectionMatrix, const FIntRect &ViewRect)
 

Detailed Description

Batched elements for later rendering.

Constructor & Destructor Documentation

◆ FBatchedElements()

FBatchedElements::FBatchedElements ( )

Constructor

Member Function Documentation

◆ AddAllocationInfo()

void FBatchedElements::AddAllocationInfo ( FAllocationInfo AllocationInfo) const

Accumulates allocation info for use calling Reserve.

◆ AddLine()

void FBatchedElements::AddLine ( const FVector Start,
const FVector End,
const FLinearColor Color,
FHitProxyId  HitProxyId,
float  Thickness = 0.0f,
float  DepthBias = 0.0f,
bool  bScreenSpace = false 
)

Adds a line to the batch. Note only SE_BLEND_Opaque will be used for batched line rendering.

◆ AddPoint()

void FBatchedElements::AddPoint ( const FVector Position,
float  Size,
const FLinearColor Color,
FHitProxyId  HitProxyId 
)

Adds a point to the batch. Note only SE_BLEND_Opaque will be used for batched point rendering.

◆ AddReserveLines()

void FBatchedElements::AddReserveLines ( int32  NumLines,
bool  bDepthBiased = false,
bool  bThickLines = false 
)

Reserves space in line vertex array

Parameters
NumLines- number of lines to reserve space for
bDepthBiased- whether reserving depth-biased lines or non-biased lines
bThickLines- whether reserving regular lines or thick lines

◆ AddReserveTriangles()

void FBatchedElements::AddReserveTriangles ( int32  NumMeshTriangles,
const FTexture Texture,
ESimpleElementBlendMode  BlendMode 
)

Reserves space in index array for a mesh element for current number plus expected number.

Parameters
NumMeshTriangles- number of triangles to reserve space for
Texture- used to find the mesh element entry
BlendMode- used to find the mesh element entry

Reserves space in triangle arrays

Parameters
NumMeshTriangles- number of triangles to reserve space for
Texture- used to find the mesh element entry
BlendMode- used to find the mesh element entry

◆ AddReserveVertices()

void FBatchedElements::AddReserveVertices ( int32  NumMeshVerts)

Reserves space in mesh vertex array for current number plus expected number.

Parameters
NumMeshVerts- number of verts to reserve space for
Texture- used to find the mesh element entry
BlendMode- used to find the mesh element entry

Reserves space in mesh vertex array

Parameters
NumMeshVerts- number of verts to reserve space for
Texture- used to find the mesh element entry
BlendMode- used to find the mesh element entry

◆ AddSprite()

void FBatchedElements::AddSprite ( const FVector Position,
float  SizeX,
float  SizeY,
const FTexture Texture,
const FLinearColor Color,
FHitProxyId  HitProxyId,
float  U,
float  UL,
float  V,
float  VL,
uint8  BlendMode,
float  OpacityMaskRefVal 
)

Adds a sprite to the batch.

◆ AddTranslucentLine()

void FBatchedElements::AddTranslucentLine ( const FVector Start,
const FVector End,
const FLinearColor Color,
FHitProxyId  HitProxyId,
float  Thickness = 0.0f,
float  DepthBias = 0.0f,
bool  bScreenSpace = false 
)

Adds a translucent line to the batch.

◆ AddTriangle() [1/3]

void FBatchedElements::AddTriangle ( int32  V0,
int32  V1,
int32  V2,
const FTexture Texture,
EBlendMode  BlendMode 
)

Adds a triangle to the batch.

◆ AddTriangle() [2/3]

void FBatchedElements::AddTriangle ( int32  V0,
int32  V1,
int32  V2,
const FTexture Texture,
ESimpleElementBlendMode  BlendMode,
const FDepthFieldGlowInfo GlowInfo = FDepthFieldGlowInfo() 
)

Adds a triangle to the batch.

◆ AddTriangle() [3/3]

void FBatchedElements::AddTriangle ( int32  V0,
int32  V1,
int32  V2,
FBatchedElementParameters BatchedElementParameters,
ESimpleElementBlendMode  BlendMode 
)

Adds a triangle to the batch.

◆ AddTriangleExtensive()

void FBatchedElements::AddTriangleExtensive ( int32  V0,
int32  V1,
int32  V2,
FBatchedElementParameters BatchedElementParameters,
const FTexture Texture,
ESimpleElementBlendMode  BlendMode,
const FDepthFieldGlowInfo GlowInfo = FDepthFieldGlowInfo() 
)

Adds a triangle to the batch. Extensive version where all parameters can be passed in.

◆ AddVertex()

int32 FBatchedElements::AddVertex ( const FVector4 InPosition,
const FVector2D InTextureCoordinate,
const FLinearColor InColor,
FHitProxyId  HitProxyId 
)

This is for compatibility but should be avoided since it's slower due to conversions.

◆ AddVertexf()

int32 FBatchedElements::AddVertexf ( const FVector4f InPosition,
const FVector2f InTextureCoordinate,
const FLinearColor InColor,
FHitProxyId  HitProxyId 
)

Adds a mesh vertex to the batch.

◆ Append()

void FBatchedElements::Append ( FBatchedElements Other)

Appends contents of another batched elements into this one and clears the other one.

◆ Clear()

void FBatchedElements::Clear ( )

Clears any batched elements

◆ CreateProxySceneView()

FSceneView FBatchedElements::CreateProxySceneView ( const FMatrix ProjectionMatrix,
const FIntRect ViewRect 
)
static

Creates a proxy FSceneView for operations that are not tied directly to a scene but still require batched elements to be drawn.

◆ Draw()

bool FBatchedElements::Draw ( FRHICommandList RHICmdList,
const FMeshPassProcessorRenderState DrawRenderState,
ERHIFeatureLevel::Type  FeatureLevel,
const FSceneView View,
bool  bHitTesting,
float  Gamma = 1.0f,
EBlendModeFilter::Type  Filter = EBlendModeFilter::All,
uint32  NumInstances = 1 
) const

Draws the batch

Parameters
ViewFSceneView for shaders that need access to view constants. Non-optional to also reference its ViewProjectionMatrix and size of the ViewRect
bHitTestingWhether or not we are hit testing
GammaOptional gamma override
DepthTextureDepthTexture for manual depth testing with editor compositing in the pixel shader

◆ EnableMobileHDREncoding()

void FBatchedElements::EnableMobileHDREncoding ( bool  bInEnableHDREncoding)
inline

◆ GetAllocatedSize()

uint32 FBatchedElements::GetAllocatedSize ( void  ) const
inline

Helper function to return the amount of memory allocated by this class

Returns
number of bytes allocated by this container

◆ HasPrimsToDraw()

bool FBatchedElements::HasPrimsToDraw ( ) const
inline

◆ Reserve()

void FBatchedElements::Reserve ( const FAllocationInfo AllocationInfo)

Reserves memory for all containers.

◆ ReserveTriangles()

void FBatchedElements::ReserveTriangles ( int32  NumMeshTriangles,
const FTexture Texture,
ESimpleElementBlendMode  BlendMode 
)

Reserves space in index array for a mesh element

Parameters
NumMeshTriangles- number of triangles to reserve space for
Texture- used to find the mesh element entry
BlendMode- used to find the mesh element entry

◆ ReserveVertices()

void FBatchedElements::ReserveVertices ( int32  NumMeshVerts)

Reserves space in mesh vertex array for at least this many total verts.

Parameters
NumMeshVerts- number of verts to reserve space for
Texture- used to find the mesh element entry
BlendMode- used to find the mesh element entry

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