UDynamicMeshComponent::SetTriangleColorFunction

Support for specifying per-triangle colors as vertex colors.

Choose your operating system:

Windows

macOS

Linux

References

Module

GeometryFramework

Header

/Engine/Source/Runtime/GeometryFramework/Public/Components/DynamicMeshComponent.h

Include

#include "Components/DynamicMeshComponent.h"

Source

/Engine/Source/Runtime/GeometryFramework/Private/Components/DynamicMeshComponent.cpp

Syntax

virtual void SetTriangleColorFunction
(
    TUniqueFunction< FColor *, int)> TriangleColorFuncIn,
    EDynamicMeshComponentRenderUpdateMode UpdateMode
)

Remarks

Support for specifying per-triangle colors as vertex colors. This allows external code to dynamically override the vertex colors on the rendered mesh. The lambda that is passed is held for the lifetime of the Component and must remain valid. A Material that uses the vertex colors must be applied, otherwise setting this override will have no visible effect. If the colors change externally, FastNotifyColorsUpdated() can be used to do the minimal vertex buffer updates necessary in the RenderProxyClear an active triangle color function if one exists, and update the mesh