UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MeshRenderBufferSet.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
7#include "Async/ParallelFor.h"
8
11#include "DynamicMeshBuilder.h"
14
15#include "LocalVertexFactory.h"
19#include "RHICommandList.h"
20#include "RayTracingGeometry.h"
21#include "VertexFactory.h"
22
23
24
25
32
34
39{
40public:
43
50
53
56
59
65
70
75
79 bool bEnableRaytracing = false;
80
81#if RHI_RAYTRACING
87 bool bIsRayTracingDataValid = false;
88#endif
89
95
96
108
110 {
111 if (TriangleCount > 0)
112 {
118 {
120 }
122 {
124 }
125
126#if RHI_RAYTRACING
128 {
129 PrimaryRayTracingGeometry.ReleaseResource();
130 SecondaryRayTracingGeometry.ReleaseResource();
131 }
132#endif
133 }
134 }
135
136
142
143
144
151 {
152 // todo: can this be done with RHI locking and memcpy, like in TransferVertexUpdateToGPU?
154
155 if (IndexBuffer.Indices.Num() > 0)
156 {
157 InitOrUpdateResource(RHICmdList, &IndexBuffer);
158 }
160 {
162 }
163
165 ValidateRayTracingData(); // currently we are immediately validating. This may be revisited in future.
166 }
167
168
175
176
177
184
185
187 {
188#if RHI_RAYTRACING
190#endif
191 }
192
193 // Verify that valid raytracing data is available. This will cause a rebuild of the
194 // raytracing data if any of our buffers have been modified. Currently this is called
195 // by GetDynamicRayTracingInstances to ensure the RT data is available when needed.
197 {
198#if RHI_RAYTRACING
200 {
202
204 }
205#endif
206 }
207
208
209protected:
210
211 // rebuild raytracing data for current buffers
213 {
214#if RHI_RAYTRACING
215 // do we always want to do this?
216 PrimaryRayTracingGeometry.ReleaseResource();
217 SecondaryRayTracingGeometry.ReleaseResource();
219
220 for (int32 k = 0; k < 2; ++k)
221 {
223 if (UseIndexBuffer.Indices.Num() == 0)
224 {
225 continue;
226 }
227
229
231 Initializer.IndexBuffer = UseIndexBuffer.IndexBufferRHI;
232 Initializer.TotalPrimitiveCount = UseIndexBuffer.Indices.Num() / 3;
233 Initializer.GeometryType = RTGT_Triangles;
234 Initializer.bFastBuild = true;
235 Initializer.bAllowUpdate = false;
236
239 Segment.NumPrimitives = Initializer.TotalPrimitiveCount;
241
242 Initializer.Segments.Add(Segment);
243
244 RayTracingGeometry.SetInitializer(MoveTemp(Initializer));
245 RayTracingGeometry.InitResource(RHICmdList);
246 }
247#endif
248 }
249
250
251
257 {
258 if (!Resource->IsInitialized())
259 {
260 Resource->InitResource(RHICmdList);
261 }
262 else
263 {
264 Resource->UpdateRHI(RHICmdList);
265 }
266 }
267
268
269public:
270
276 {
277 //@todo, remove this check? based on our usage it could produce a memory leak - see BaseDynamicMeshSceneProxy.cpp
278 if (BufferSet->TriangleCount == 0)
279 {
280 return;
281 }
282
283 delete BufferSet;
284 }
285
286
287};
288
289
298{
299
304
309
314
319
324
329
335
340
345
350
351
356 template<typename TriangleEnumerable>
359 const FDynamicMesh3* Mesh,
360 int NumTriangles, const TriangleEnumerable& Enumerable,
361 const FDynamicMeshUVOverlay* UVOverlay,
362 const FDynamicMeshNormalOverlay* NormalOverlay,
363 const FDynamicMeshColorOverlay* ColorOverlay,
364 TFunctionRef<void(int, int, int, const FVector3f&, FVector3f&, FVector3f&)> TangentsFunc,
365 bool bTrackTriangles = false,
366 bool bParallel = false)
367 {
369 UVOverlays.Add(UVOverlay);
371 UVOverlays, NormalOverlay, ColorOverlay, TangentsFunc, bTrackTriangles, bParallel);
372 }
373
374
379 template<typename TriangleEnumerable, typename UVOverlayListAllocator>
381 const FDynamicMesh3* Mesh,
382 int NumTriangles,
385 const FDynamicMeshNormalOverlay* NormalOverlay,
386 const FDynamicMeshColorOverlay* ColorOverlay,
387 TFunctionRef<void(int, int, int, const FVector3f&, FVector3f&, FVector3f&)> TangentsFunc,
388 bool bTrackTriangles = false,
389 bool bParallel = false);
390
391
392
399 const FDynamicMesh3* Mesh,
400 bool bDuplicate);
401
402
409 const FDynamicMesh3* Mesh);
410
411
416 template<typename TriangleEnumerable>
418 const FDynamicMesh3* Mesh,
419 int NumTriangles, const TriangleEnumerable& Enumerable,
420 const FDynamicMeshNormalOverlay* NormalOverlay,
421 const FDynamicMeshColorOverlay* ColorOverlay,
422 TFunctionRef<void(int, int, int, const FVector3f&, FVector3f&, FVector3f&)> TangentsFunc,
423 bool bUpdatePositions = true,
424 bool bUpdateNormals = false,
425 bool bUpdateColors = false);
426
427
432 template<typename TriangleEnumerable, typename UVOverlayListAllocator>
434 const FDynamicMesh3* Mesh,
435 int32 NumTriangles, const TriangleEnumerable& Enumerable,
437
438
442 FColor GetOverlayColorAsFColor( const FDynamicMeshColorOverlay* ColorOverlay,
443 int32 ElementID)
444 {
445 checkSlow(ColorOverlay);
446 FVector4f UseColor = ColorOverlay->GetElement(ElementID);
447
449 {
451 }
452
453 if (ColorSpaceTransformMode == EDynamicMeshVertexColorTransformMode::SRGBToLinear)
454 {
455 // is there a better way to do this?
456 FColor QuantizedSRGBColor = ((FLinearColor)UseColor).ToFColor(false);
458 }
459 else
460 {
462 return ((FLinearColor)UseColor).ToFColor(bConvertToSRGB);
463 }
464 }
465
466
467private:
468 using FIndex2i = UE::Geometry::FIndex2i;
469 using FIndex3i = UE::Geometry::FIndex3i;
470
471};
472
473
474// Simple tool to initialize a single set of mesh buffers for the entire mesh.
475// for examples of more complicated conversions, see DynamicMeshSceneProxy
477{
478
479public:
481
482 // note, this conversion may recompute the tangents on the DynamicMeshComponent
483 // since a dynamic mesh component with "autocalculated" tangents will compute them on first request
484 // @param DynamicMeshComponent - the mesh to be converted
485 // @param MeshRenderBufferSet - the buffer set to be initialized
486 // @param bUseComponentSettings - if true, the Component settings will override (and update) MeshRederBufferSetBuilder.{ColorspaceTransformMode, bUsePerTriangleNormals}.
488
489protected:
491};
492
493
494
495
496
497
498
499
500// -- template implementations -- //
501
502
503template<typename TriangleEnumerable, typename UVOverlayListAllocator>
505 const FDynamicMesh3* Mesh,
506 int NumTriangles,
509 const FDynamicMeshNormalOverlay* NormalOverlay,
510 const FDynamicMeshColorOverlay* ColorOverlay,
511 TFunctionRef<void(int, int, int, const FVector3f&, FVector3f&, FVector3f&)> TangentsFunc,
512 bool bTrackTriangles,
513 bool bParallel)
514
515{
516 RenderBuffers->TriangleCount = NumTriangles;
517 if (NumTriangles == 0)
518 {
519 return;
520 }
521
522 bool bHaveColors = (ColorOverlay != nullptr) && (bIgnoreVertexColors == false);
523
524 const int NumVertices = NumTriangles * 3;
525 const int NumUVOverlays = UVOverlays.Num();
526 const int NumTexCoords = FMath::Max(1, NumUVOverlays); // must have at least one tex coord
527
528 {
529 RenderBuffers->PositionVertexBuffer.Init(NumVertices);
530 RenderBuffers->StaticMeshVertexBuffer.Init(NumVertices, NumTexCoords);
531 RenderBuffers->ColorVertexBuffer.Init(NumVertices);
532 RenderBuffers->IndexBuffer.Indices.AddUninitialized(NumTriangles * 3);
533 }
534
535 // build triangle list if requested, or if we are using secondary buffers in which case we need it to filter later
537
538 // populate the triangle array. we use this for parallelism.
540 {
541 TriangleArray.Reserve(NumTriangles);
542 for (int TriangleID : Enumerable)
543 {
544 TriangleArray.Add(TriangleID);
545 }
546 }
547
548 TArray<uint32>& IndexBuffer = RenderBuffers->IndexBuffer.Indices;
549 {
550 // populate the index buffer.
551 for (int idx = 0, IdxMax = 3 * NumTriangles; idx < IdxMax; ++idx)
552 {
553 IndexBuffer[idx] = idx;
554 }
555 }
556
557
558 ParallelFor(TriangleArray.Num(), [&](int idx)
559 {
560 int32 TriangleID = TriangleArray[idx];
561 FIndex3i Tri = Mesh->GetTriangle(TriangleID);
562
563
564 FIndex3i TriNormal = (NormalOverlay != nullptr) ? NormalOverlay->GetTriangle(TriangleID) : FIndex3i::Zero();
565 FIndex3i TriColor = (ColorOverlay != nullptr) ? ColorOverlay->GetTriangle(TriangleID) : FIndex3i::Zero();
566
567 FColor UniformTriColor = ConstantVertexColor;
568 if (bUsePerTriangleColor && PerTriangleColorFunc != nullptr)
569 {
570 UniformTriColor = PerTriangleColorFunc(Mesh, TriangleID);
571 bHaveColors = false;
572 }
573
574 int32 VertIdx = idx * 3;
575 for (int j = 0; j < 3; ++j)
576 {
577 RenderBuffers->PositionVertexBuffer.VertexPosition(VertIdx) = (FVector3f)Mesh->GetVertex(Tri[j]);
578
581 {
582 Normal = (FVector3f)Mesh->GetTriNormal(TriangleID);
583 }
584 else
585 {
586 Normal = (NormalOverlay != nullptr && TriNormal[j] != FDynamicMesh3::InvalidID) ?
587 NormalOverlay->GetElement(TriNormal[j]) : Mesh->GetVertexNormal(Tri[j]);
588 }
589
590 // get tangents
591 FVector3f TangentX, TangentY;
592 TangentsFunc(Tri[j], TriangleID, j, Normal, TangentX, TangentY);
593
594 RenderBuffers->StaticMeshVertexBuffer.SetVertexTangents(VertIdx, TangentX, TangentY, Normal);
595
596 FColor VertexFColor = (bHaveColors && TriColor[j] != FDynamicMesh3::InvalidID) ?
598
599 RenderBuffers->ColorVertexBuffer.VertexColor(VertIdx) = VertexFColor;
600
601 VertIdx++;
602 }
603
604 for (int32 k = 0; k < NumTexCoords; ++k)
605 {
606 VertIdx = idx * 3;
607 FIndex3i UVTriangle = (k < NumUVOverlays && UVOverlays[k] != nullptr) ? UVOverlays[k]->GetTriangle(TriangleID) : FIndex3i::Invalid();
608 for (int j = 0; j < 3; ++j)
609 {
610 FVector2f UV = (UVTriangle[j] != FDynamicMesh3::InvalidID) ?
611 UVOverlays[k]->GetElement(UVTriangle[j]) : FVector2f::Zero();
612 RenderBuffers->StaticMeshVertexBuffer.SetVertexUV(VertIdx, k, UV);
613 VertIdx++;
614 }
615 }
616 }, !bParallel);
617
619 {
621 }
622
623 // split triangles into secondary buffer (at bit redundant since we just built IndexBuffer, but we may optionally duplicate triangles in the future)
624 if (bUseSecondaryTriBuffers)
625 {
626 RenderBuffers->bEnableSecondaryIndexBuffer = true;
627 UpdateSecondaryTriangleBuffer(RenderBuffers, Mesh, false);
628 }
629}
630
631
636template<typename TriangleEnumerable>
638 const FDynamicMesh3* Mesh,
639 int NumTriangles, const TriangleEnumerable& Enumerable,
640 const FDynamicMeshNormalOverlay* NormalOverlay,
641 const FDynamicMeshColorOverlay* ColorOverlay,
642 TFunctionRef<void(int, int, int, const FVector3f&, FVector3f&, FVector3f&)> TangentsFunc,
643 bool bUpdatePositions,
644 bool bUpdateNormals,
645 bool bUpdateColors)
646{
647 if (RenderBuffers->TriangleCount == 0)
648 {
649 return;
650 }
651
652 bool bHaveColors = (ColorOverlay != nullptr) && (bIgnoreVertexColors == false);
653
654 int NumVertices = NumTriangles * 3;
655 if ((bUpdatePositions && ensure(RenderBuffers->PositionVertexBuffer.GetNumVertices() == NumVertices) == false)
656 || (bUpdateNormals && ensure(RenderBuffers->StaticMeshVertexBuffer.GetNumVertices() == NumVertices) == false)
657 || (bUpdateColors && ensure(RenderBuffers->ColorVertexBuffer.GetNumVertices() == NumVertices) == false))
658 {
659 return;
660 }
661
662 int VertIdx = 0;
663 FVector3f TangentX, TangentY;
664 for (int TriangleID : Enumerable)
665 {
666 FIndex3i Tri = Mesh->GetTriangle(TriangleID);
667
668 FIndex3i TriNormal = (bUpdateNormals && NormalOverlay != nullptr) ? NormalOverlay->GetTriangle(TriangleID) : FIndex3i::Zero();
669 FIndex3i TriColor = (bUpdateColors && ColorOverlay != nullptr) ? ColorOverlay->GetTriangle(TriangleID) : FIndex3i::Zero();
670
673 {
675 bHaveColors = false;
676 }
677
678 for (int j = 0; j < 3; ++j)
679 {
680 if (bUpdatePositions)
681 {
682 RenderBuffers->PositionVertexBuffer.VertexPosition(VertIdx) = (FVector3f)Mesh->GetVertex(Tri[j]);
683 }
684
685 if (bUpdateNormals)
686 {
687 // get normal and tangent
690 {
691 Normal = (FVector3f)Mesh->GetTriNormal(TriangleID);
692 }
693 else
694 {
695 Normal = (NormalOverlay != nullptr && TriNormal[j] != FDynamicMesh3::InvalidID) ?
696 NormalOverlay->GetElement(TriNormal[j]) : Mesh->GetVertexNormal(Tri[j]);
697 }
698
699 TangentsFunc(Tri[j], TriangleID, j, Normal, TangentX, TangentY);
700
701 RenderBuffers->StaticMeshVertexBuffer.SetVertexTangents(VertIdx, (FVector3f)TangentX, (FVector3f)TangentY, (FVector3f)Normal);
702 }
703
704 if (bUpdateColors)
705 {
706 FColor VertexFColor = (bHaveColors && TriColor[j] != FDynamicMesh3::InvalidID) ?
708 RenderBuffers->ColorVertexBuffer.VertexColor(VertIdx) = VertexFColor;
709 }
710
711 VertIdx++;
712 }
713 }
714}
715
716template<typename TriangleEnumerable, typename UVOverlayListAllocator>
718 const FDynamicMesh3* Mesh,
719 int32 NumTriangles, const TriangleEnumerable& Enumerable,
721{
722 // We align the update to the way we set UV's in InitializeBuffersFromOverlays.
723
724 if (RenderBuffers->TriangleCount == 0)
725 {
726 return;
727 }
728 int NumVertices = NumTriangles * 3;
729 if (ensure(RenderBuffers->StaticMeshVertexBuffer.GetNumVertices() == NumVertices) == false)
730 {
731 return;
732 }
733
734 int NumUVOverlays = UVOverlays.Num();
735 int NumTexCoords = RenderBuffers->StaticMeshVertexBuffer.GetNumTexCoords();
736 if (!ensure(NumUVOverlays <= NumTexCoords))
737 {
738 return;
739 }
740
741 // Temporarily stores the UV element indices for all UV channels of a single triangle
743 UVTriangles.SetNum(NumTexCoords);
744
745 int VertIdx = 0;
746 for (int TriangleID : Enumerable)
747 {
748 for (int32 k = 0; k < NumTexCoords; ++k)
749 {
750 UVTriangles[k] = (k < NumUVOverlays && UVOverlays[k] != nullptr) ? UVOverlays[k]->GetTriangle(TriangleID) : FIndex3i::Invalid();
751 }
752
753 for (int j = 0; j < 3; ++j)
754 {
755 for (int32 k = 0; k < NumTexCoords; ++k)
756 {
757 FVector2f UV = (UVTriangles[k][j] != FDynamicMesh3::InvalidID) ?
758 UVOverlays[k]->GetElement(UVTriangles[k][j]) : FVector2f::Zero();
759 RenderBuffers->StaticMeshVertexBuffer.SetVertexUV(VertIdx, k, UV);
760 }
761
762 ++VertIdx;
763 }
764 }
765}
766
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
@ Normal
Definition AndroidInputInterface.h:116
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define ensure( InExpression)
Definition AssertionMacros.h:464
EDynamicMeshVertexColorTransformMode
Definition BaseDynamicMeshComponent.h:110
void ParallelFor(int32 Num, TFunctionRef< void(int32)> Body, bool bForceSingleThread, bool bPumpRenderingThread=false)
Definition ParallelFor.h:481
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
constexpr void EnumAddFlags(Enum &Flags, Enum FlagsToAdd)
Definition EnumClassFlags.h:91
UE::Math::TVector< float > FVector3f
Definition MathFwd.h:73
const bool
Definition NetworkReplayStreaming.h:178
@ RTGT_Triangles
Definition RHIResources.h:3439
bool IsRayTracingEnabled()
Definition RenderUtils.cpp:1775
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition ColorVertexBuffer.h:16
Definition MeshRenderBufferSet.h:477
GEOMETRYFRAMEWORK_API void Convert(class UDynamicMeshComponent &DynamicMeshComponent, FMeshRenderBufferSet &MeshRenderBufferSet, bool bUseComponentSettings=true)
------------— ToMeshRenderBufferSet ---------------— ///
Definition MeshRenderBufferSet.cpp:217
TUniqueFunction< void(int, int, int, const FVector3f &, FVector3f &, FVector3f &)> MakeTangentsFunc(class UDynamicMeshComponent &DynamicMeshCompnent, bool bSkipAutoCompute=false)
Definition MeshRenderBufferSet.cpp:257
FMeshRenderBufferSetConversionUtil MeshRenderBufferSetConverter
Definition MeshRenderBufferSet.h:480
Definition DynamicMeshBuilder.h:228
TArray< uint32 > Indices
Definition DynamicMeshBuilder.h:233
EBufferUsageFlags UsageFlags
Definition DynamicMeshBuilder.h:234
Definition LocalVertexFactory.h:51
Definition MeshRenderBufferSet.h:39
FDynamicMeshIndexBuffer32 IndexBuffer
Definition MeshRenderBufferSet.h:52
FStaticMeshVertexBuffer StaticMeshVertexBuffer
Definition MeshRenderBufferSet.h:45
void InvalidateRayTracingData()
Definition MeshRenderBufferSet.h:186
FMeshRenderBufferSet(ERHIFeatureLevel::Type FeatureLevelType)
Definition MeshRenderBufferSet.h:97
FDynamicMeshIndexBuffer32 SecondaryIndexBuffer
Definition MeshRenderBufferSet.h:74
bool bEnableSecondaryIndexBuffer
Definition MeshRenderBufferSet.h:69
FPositionVertexBuffer PositionVertexBuffer
Definition MeshRenderBufferSet.h:47
FCriticalSection BuffersLock
Definition MeshRenderBufferSet.h:94
UMaterialInterface * Material
Definition MeshRenderBufferSet.h:58
FColorVertexBuffer ColorVertexBuffer
Definition MeshRenderBufferSet.h:49
TOptional< TArray< int > > Triangles
Definition MeshRenderBufferSet.h:64
GEOMETRYFRAMEWORK_API void UploadVertexUpdate(bool bPositions, bool bMeshAttribs, bool bColors)
Definition MeshRenderBufferSet.cpp:50
virtual ~FMeshRenderBufferSet()
Definition MeshRenderBufferSet.h:109
FLocalVertexFactory VertexFactory
Definition MeshRenderBufferSet.h:55
void UploadIndexBufferUpdate()
Definition MeshRenderBufferSet.h:150
void UpdateRaytracingGeometryIfEnabled()
Definition MeshRenderBufferSet.h:212
int TriangleCount
Definition MeshRenderBufferSet.h:42
void InitOrUpdateResource(FRHICommandListBase &RHICmdList, FRenderResource *Resource)
Definition MeshRenderBufferSet.h:256
static void DestroyRenderBufferSet(FMeshRenderBufferSet *BufferSet)
Definition MeshRenderBufferSet.h:275
GEOMETRYFRAMEWORK_API void TransferVertexUpdateToGPU(FRHICommandListBase &RHICmdList, bool bPositions, bool bNormals, bool bTexCoords, bool bColors)
Definition MeshRenderBufferSet.cpp:91
GEOMETRYFRAMEWORK_API void Upload()
------------— FMeshRenderBuffferSet ---------------— ///
Definition MeshRenderBufferSet.cpp:8
bool bEnableRaytracing
Definition MeshRenderBufferSet.h:79
void ValidateRayTracingData()
Definition MeshRenderBufferSet.h:196
Definition PositionVertexBuffer.h:27
uint32 GetNumVertices() const
Definition PositionVertexBuffer.h:100
Definition RHICommandList.h:455
static FRHICommandListImmediate & Get()
Definition RHICommandList.h:5522
Definition RayTracingGeometry.h:31
Definition RenderResource.h:37
virtual RENDERCORE_API void ReleaseResource()
Definition RenderResource.cpp:206
bool IsInitialized() const
Definition RenderResource.h:114
RENDERCORE_API void UpdateRHI(FRHICommandListBase &RHICmdList)
Definition RenderResource.cpp:225
virtual RENDERCORE_API void InitResource(FRHICommandListBase &RHICmdList)
Definition RenderResource.cpp:178
Definition StaticMeshVertexBuffer.h:150
void SetUseHighPrecisionTangentBasis(bool bUseHighPrecision)
Definition StaticMeshVertexBuffer.h:431
virtual ENGINE_API void ReleaseResource() override
Definition StaticMeshVertexBuffer.cpp:356
void SetUseFullPrecisionUVs(bool UseFull)
Definition StaticMeshVertexBuffer.h:421
FBufferRHIRef VertexBufferRHI
Definition RenderResource.h:489
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2308
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition FunctionFwd.h:19
Definition DynamicMesh3.h:108
Definition DynamicMeshAttributeSet.h:84
Definition DynamicMeshTriangleAttribute.h:604
Definition DynamicMeshOverlay.h:714
Definition MaterialInterface.h:296
Type
Definition RHIFeatureLevel.h:20
Definition Color.h:486
static CORE_API const FColor White
Definition Color.h:749
Definition Color.h:48
FColor ToFColor(const bool bSRGB) const
Definition Color.h:810
Definition MeshRenderBufferSet.h:298
bool bIgnoreVertexColors
Definition MeshRenderBufferSet.h:308
bool bUseSecondaryTriBuffers
Definition MeshRenderBufferSet.h:344
bool bUsePerTriangleNormals
Definition MeshRenderBufferSet.h:339
FColor ConstantVertexColor
Definition MeshRenderBufferSet.h:303
TFunction< FColor(const FDynamicMesh3 *, int)> PerTriangleColorFunc
Definition MeshRenderBufferSet.h:318
TUniqueFunction< void(FVector4f &)> VertexColorRemappingFunc
Definition MeshRenderBufferSet.h:328
bool bApplyVertexColorRemapping
Definition MeshRenderBufferSet.h:323
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)
Definition MeshRenderBufferSet.h:637
FColor GetOverlayColorAsFColor(const FDynamicMeshColorOverlay *ColorOverlay, int32 ElementID)
Definition MeshRenderBufferSet.h:442
void GEOMETRYFRAMEWORK_API UpdateSecondaryTriangleBuffer(FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh, bool bDuplicate)
------------— FMeshRenderBufferSetConversionUtil ---------------— ///
Definition MeshRenderBufferSet.cpp:136
void UpdateVertexUVBufferFromOverlays(FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh, int32 NumTriangles, const TriangleEnumerable &Enumerable, const TArray< const FDynamicMeshUVOverlay *, UVOverlayListAllocator > &UVOverlays)
Definition MeshRenderBufferSet.h:717
EDynamicMeshVertexColorTransformMode ColorSpaceTransformMode
Definition MeshRenderBufferSet.h:334
void GEOMETRYFRAMEWORK_API RecomputeRenderBufferTriangleIndexSets(FMeshRenderBufferSet *RenderBuffers, const FDynamicMesh3 *Mesh)
Definition MeshRenderBufferSet.cpp:174
TUniqueFunction< bool(const FDynamicMesh3 *, int32)> SecondaryTriFilterFunc
Definition MeshRenderBufferSet.h:349
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)
Definition MeshRenderBufferSet.h:357
bool bUsePerTriangleColor
Definition MeshRenderBufferSet.h:313
Definition RHIResources.h:3496
FBufferRHIRef IndexBuffer
Definition RHIResources.h:3498
Definition RHIResources.h:3463
FBufferRHIRef VertexBuffer
Definition RHIResources.h:3465
Definition Optional.h:131
Definition IndexTypes.h:27
Definition IndexTypes.h:158
static constexpr FIndex3i Zero()
Definition IndexTypes.h:177
static constexpr FIndex3i Invalid()
Definition IndexTypes.h:185
static TVector2< float > Zero()
Definition Vector2D.h:79