UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMeshRenderBufferSetConversionUtil Struct Reference

#include <MeshRenderBufferSet.h>

Public Member Functions

template<typename TriangleEnumerable >
void InitializeBuffersFromOverlays (FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh, int NumTriangles, const TriangleEnumerable &Enumerable, const FDynamicMeshUVOverlay *UVOverlay, const FDynamicMeshNormalOverlay *NormalOverlay, const FDynamicMeshColorOverlay *ColorOverlay, TFunctionRef< void(int, int, int, const FVector3f &, FVector3f &, FVector3f &)> TangentsFunc, bool bTrackTriangles=false, bool bParallel=false)
 
template<typename TriangleEnumerable , typename UVOverlayListAllocator >
void InitializeBuffersFromOverlays (FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh, int NumTriangles, const TriangleEnumerable &Enumerable, const TArray< const FDynamicMeshUVOverlay *, UVOverlayListAllocator > &UVOverlays, const FDynamicMeshNormalOverlay *NormalOverlay, const FDynamicMeshColorOverlay *ColorOverlay, TFunctionRef< void(int, int, int, const FVector3f &, FVector3f &, FVector3f &)> TangentsFunc, bool bTrackTriangles=false, bool bParallel=false)
 
void GEOMETRYFRAMEWORK_API UpdateSecondaryTriangleBuffer (FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh, bool bDuplicate)
 ------------— FMeshRenderBufferSetConversionUtil ---------------— ///
 
void GEOMETRYFRAMEWORK_API RecomputeRenderBufferTriangleIndexSets (FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh)
 
template<typename TriangleEnumerable >
void UpdateVertexBuffersFromOverlays (FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh, int NumTriangles, const TriangleEnumerable &Enumerable, const FDynamicMeshNormalOverlay *NormalOverlay, const FDynamicMeshColorOverlay *ColorOverlay, TFunctionRef< void(int, int, int, const FVector3f &, FVector3f &, FVector3f &)> TangentsFunc, bool bUpdatePositions=true, bool bUpdateNormals=false, bool bUpdateColors=false)
 
template<typename TriangleEnumerable , typename UVOverlayListAllocator >
void UpdateVertexUVBufferFromOverlays (FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh, int32 NumTriangles, const TriangleEnumerable &Enumerable, const TArray< const FDynamicMeshUVOverlay *, UVOverlayListAllocator > &UVOverlays)
 
FColor GetOverlayColorAsFColor (const FDynamicMeshColorOverlay *ColorOverlay, int32 ElementID)
 

Public Attributes

FColor ConstantVertexColor = FColor::White
 
bool bIgnoreVertexColors = false
 
bool bUsePerTriangleColor = false
 
TFunction< FColor(const FDynamicMesh3 *, int)> PerTriangleColorFunc = nullptr
 
bool bApplyVertexColorRemapping = false
 
TUniqueFunction< void(FVector4f &)> VertexColorRemappingFunc = nullptr
 
EDynamicMeshVertexColorTransformMode ColorSpaceTransformMode = EDynamicMeshVertexColorTransformMode::NoTransform
 
bool bUsePerTriangleNormals = false
 
bool bUseSecondaryTriBuffers = false
 
TUniqueFunction< bool(const FDynamicMesh3 *, int32)> SecondaryTriFilterFunc = nullptr
 

Detailed Description

Parameters and accompanying functions used to build and update FMeshRenderBuffers from a dynamic mesh. For usage, see FBaseDynamicMeshSceneProxy or the simple converter below FDynamicMeshComponentToMeshRenderBufferSet

Note: This is low-level and methods assume, but do not check, all input data is consistent (e.g. that all overlays, the triangle count and enumerator are all consistent with the provided mesh. )

Member Function Documentation

◆ GetOverlayColorAsFColor()

FColor FMeshRenderBufferSetConversionUtil::GetOverlayColorAsFColor ( const FDynamicMeshColorOverlay *  ColorOverlay,
int32  ElementID 
)
inline

Get the overlay color the FColor, respecting the ColorSpaceTransformMode utilizing the VertexColorRemappingFunc if requested.

◆ InitializeBuffersFromOverlays() [1/2]

void FMeshRenderBufferSetConversionUtil::InitializeBuffersFromOverlays ( FMeshRenderBufferSet RenderBuffers,
const FDynamicMesh3 Mesh,
int  NumTriangles,
const TriangleEnumerable Enumerable,
const FDynamicMeshUVOverlay *  UVOverlay,
const FDynamicMeshNormalOverlay *  NormalOverlay,
const FDynamicMeshColorOverlay *  ColorOverlay,
TFunctionRef< void(int, int, int, const FVector3f &, FVector3f &, FVector3f &)>  TangentsFunc,
bool  bTrackTriangles = false,
bool  bParallel = false 
)
inline

Initialize rendering buffers from given attribute overlays. Creates three vertices per triangle, IE no shared vertices in buffers.

◆ InitializeBuffersFromOverlays() [2/2]

void FMeshRenderBufferSetConversionUtil::InitializeBuffersFromOverlays ( FMeshRenderBufferSet RenderBuffers,
const FDynamicMesh3 Mesh,
int  NumTriangles,
const TriangleEnumerable Enumerable,
const TArray< const FDynamicMeshUVOverlay *, UVOverlayListAllocator > &  UVOverlays,
const FDynamicMeshNormalOverlay *  NormalOverlay,
const FDynamicMeshColorOverlay *  ColorOverlay,
TFunctionRef< void(int, int, int, const FVector3f &, FVector3f &, FVector3f &)>  TangentsFunc,
bool  bTrackTriangles = false,
bool  bParallel = false 
)

Initialize rendering buffers from given attribute overlays. Creates three vertices per triangle, IE no shared vertices in buffers.

◆ RecomputeRenderBufferTriangleIndexSets()

void FMeshRenderBufferSetConversionUtil::RecomputeRenderBufferTriangleIndexSets ( FMeshRenderBufferSet RenderBuffers,
const FDynamicMesh3 Mesh 
)

RecomputeRenderBufferTriangleIndexSets re-sorts the existing set of triangles in a FMeshRenderBufferSet into primary and secondary index buffers. Note that UploadIndexBufferUpdate() must be called after this function!

◆ UpdateSecondaryTriangleBuffer()

void FMeshRenderBufferSetConversionUtil::UpdateSecondaryTriangleBuffer ( FMeshRenderBufferSet RenderBuffers,
const FDynamicMesh3 Mesh,
bool  bDuplicate 
)

------------— FMeshRenderBufferSetConversionUtil ---------------— ///

Filter the triangles in a FMeshRenderBufferSet into the SecondaryIndexBuffer. Requires that RenderBuffers->Triangles has been initialized.

Parameters
bDuplicateif set, then primary IndexBuffer is unmodified and SecondaryIndexBuffer contains duplicates. Otherwise triangles are sorted via predicate into either primary or secondary.

◆ UpdateVertexBuffersFromOverlays()

void FMeshRenderBufferSetConversionUtil::UpdateVertexBuffersFromOverlays ( FMeshRenderBufferSet RenderBuffers,
const FDynamicMesh3 Mesh,
int  NumTriangles,
const TriangleEnumerable Enumerable,
const FDynamicMeshNormalOverlay *  NormalOverlay,
const FDynamicMeshColorOverlay *  ColorOverlay,
TFunctionRef< void(int, int, int, const FVector3f &, FVector3f &, FVector3f &)>  TangentsFunc,
bool  bUpdatePositions = true,
bool  bUpdateNormals = false,
bool  bUpdateColors = false 
)

Update vertex positions/normals/colors of an existing set of render buffers. Assumes that buffers were created with unshared vertices, ie three vertices per triangle, eg by InitializeBuffersFromOverlays()

◆ UpdateVertexUVBufferFromOverlays()

void FMeshRenderBufferSetConversionUtil::UpdateVertexUVBufferFromOverlays ( FMeshRenderBufferSet RenderBuffers,
const FDynamicMesh3 Mesh,
int32  NumTriangles,
const TriangleEnumerable Enumerable,
const TArray< const FDynamicMeshUVOverlay *, UVOverlayListAllocator > &  UVOverlays 
)

Update vertex uvs of an existing set of render buffers. Assumes that buffers were created with unshared vertices, ie three vertices per triangle, eg by InitializeBuffersFromOverlays()

Member Data Documentation

◆ bApplyVertexColorRemapping

bool FMeshRenderBufferSetConversionUtil::bApplyVertexColorRemapping = false

If true, VertexColorRemappingFunc is called on Vertex Colors provided from Mesh to remap them to a different color

◆ bIgnoreVertexColors

bool FMeshRenderBufferSetConversionUtil::bIgnoreVertexColors = false

If true, vertex colors on the FDynamicMesh will be ignored

◆ bUsePerTriangleColor

bool FMeshRenderBufferSetConversionUtil::bUsePerTriangleColor = false

If true, a per-triangle color is used to set vertex colors

◆ bUsePerTriangleNormals

bool FMeshRenderBufferSetConversionUtil::bUsePerTriangleNormals = false

If true, a facet normals are used instead of mesh normals

◆ bUseSecondaryTriBuffers

bool FMeshRenderBufferSetConversionUtil::bUseSecondaryTriBuffers = false

If true, populate secondary buffers using SecondaryTriFilterFunc

◆ ColorSpaceTransformMode

EDynamicMeshVertexColorTransformMode FMeshRenderBufferSetConversionUtil::ColorSpaceTransformMode = EDynamicMeshVertexColorTransformMode::NoTransform

Color Space Transform/Conversion applied to Vertex Colors provided from Mesh Color Overlay Attribute Color Space Conversion is applied after any Vertex Color Remapping.

◆ ConstantVertexColor

FColor FMeshRenderBufferSetConversionUtil::ConstantVertexColor = FColor::White

Constant color assigned to vertices if no other vertex color is specified

◆ PerTriangleColorFunc

TFunction<FColor(const FDynamicMesh3*, int)> FMeshRenderBufferSetConversionUtil::PerTriangleColorFunc = nullptr

Per-triangle color function. Only called if bUsePerTriangleColor=true

◆ SecondaryTriFilterFunc

TUniqueFunction<bool(const FDynamicMesh3*, int32)> FMeshRenderBufferSetConversionUtil::SecondaryTriFilterFunc = nullptr

Filter predicate for secondary triangle index buffer. Only called if bUseSecondaryTriBuffers=true

◆ VertexColorRemappingFunc

TUniqueFunction<void(FVector4f&)> FMeshRenderBufferSetConversionUtil::VertexColorRemappingFunc = nullptr

Vertex color remapping function. Only called if bApplyVertexColorRemapping == true, for mesh vertex colors


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