Plugin Documentation

MeshFlux
Runtime meshes for Blueprints and C++

Create, update and render geometry generated while the game runs: LODs, sections, material slots, collision, in-place GPU updates and asynchronous building, with a Procedural mesh type that mirrors the familiar procedural-mesh API.

v1.0
UE 5.8
Win64 (verified)
Category Rendering
Alpha XP

Overview

MeshFlux adds UMeshFluxComponent, a primitive component that renders a mesh object you build at runtime. You describe geometry as streams (positions, tangents, colors, UVs, triangles, poly groups), hand a stream set to the mesh, and MeshFlux uploads it to the GPU, splits it into sections and material slots, and builds collision. It is aimed at procedural terrain and buildings, runtime level editors, deforming meshes, chunk and voxel systems, data visualisation and runtime import.

  • Two mesh types: UMeshFluxSimple (stream sets, mesh builder, full control) and UMeshFluxProcedural (parallel arrays, Create Mesh Section style).
  • Flexible data: up to 8 UV channels, 16- or 32-bit indices, normal or high-precision tangents and UVs, vertex colors, poly groups, depth-only triangles.
  • Structure: multiple LODs with screen sizes, buffer sets with several sections each, material slots, automatic sections per poly group.
  • Updates: full rebuilds when topology changes, in-place GPU updates of only the changed streams on Dynamic buffer sets, and helpers to build geometry on worker threads.
  • Collision: boxes, spheres, capsules, tapered capsules and convex hulls, plus per-triangle complex collision with async cooking and complex-as-simple.
  • Static meshes: copy a Static Mesh into MeshFlux at runtime, or bake a MeshFlux mesh into a new Static Mesh asset from the details panel.
  • Rendering: ray tracing support, motion vectors for deforming geometry, distance-field and Lumen card data inputs, debug views for normals, tangents and vertex colors.
  • Examples: 16 C++ example actors and 10 example Blueprints.

Requirements

RequirementDetails
Unreal Engine5.8 (verified clean)
ModulesMeshFlux (Runtime, loads at PostConfigInit), MeshFluxEditor (Editor), MeshFluxExamples (Runtime)
DependenciesNone (engine modules only, no other plugins)
LanguageBlueprints and C++
PlatformsNo platform restriction in the plugin descriptor. Win64 is the platform built and verified by Alpha XP; other platforms are supported by the code, not verified by Alpha XP.

Installation

  1. Install MeshFlux from Fab into your engine, or copy the MeshFlux folder into your project's Plugins/ folder (for a project copy, regenerate project files and build the project).
  2. Open the editor, go to Edit > Plugins, enable MeshFlux and restart.
  3. For C++ use, add the runtime module to your module's Build.cs: PublicDependencyModuleNames.Add("MeshFlux");
  4. To browse the example Blueprints, enable Show Plugin Content in the Content Browser settings and open MeshFlux Content/Examples.
Verifying the installDrag BP_MeshFlux_HelloTriangle from MeshFlux Content/Examples into a level: a two-sided colored triangle appears. A MeshFlux entry is also added to the editor main menu and to the play toolbar.

Quick start

Blueprint

  1. Create a Blueprint class with MeshFluxActor as parent. It already has a MeshFlux component as root.
  2. In the Construction Script (or override On Generate Mesh and tick bDeferGeneration), call Get Mesh Flux Component and pass it to Initialize Mesh Flux Simple.
  3. Call Make Mesh Builder (choose tangents, UVs, poly groups and colors), then Add Vertex three times with a MeshFluxBasicVertex (position, normal, tangent, color, UVs) and Add Triangle with the three indices.
  4. On the mesh, call Setup Material Slot (slot 0, a name, a material).
  5. Build a key with Make LOD Key (0) and Make Buffer Set Key Named, then call CreateBufferSet with the builder as Mesh Data.

BP_MeshFlux_HelloTriangle contains exactly this graph.

C++

// MyMeshActor.h
#pragma once

#include "CoreMinimal.h"
#include "MeshFluxActor.h"
#include "MyMeshActor.generated.h"

UCLASS()
class MYGAME_API AMyMeshActor : public AMeshFluxActor
{
	GENERATED_BODY()
public:
	virtual void OnConstruction(const FTransform& Transform) override;
};

// MyMeshActor.cpp
#include "MyMeshActor.h"
#include "MeshFluxSimple.h"

using namespace MeshFlux;

void AMyMeshActor::OnConstruction(const FTransform& Transform)
{
	Super::OnConstruction(Transform);

	UMeshFluxSimple* Mesh = GetMeshFluxComponent()->InitializeMeshFlux<UMeshFluxSimple>();

	FMeshFluxStreamSet StreamSet;
	TMeshFluxBuilderLocal<uint16, FPackedNormal, FVector2DHalf, 1> Builder(StreamSet);
	Builder.EnableTangents();
	Builder.EnableTexCoords();
	Builder.EnableColors();
	Builder.EnablePolyGroups();

	const int32 V0 = Builder.AddVertex(FVector3f(-50.f, 0.f, 0.f))
		.SetNormalAndTangent(FVector3f(0.f, -1.f, 0.f), FVector3f(1.f, 0.f, 0.f))
		.SetColor(FColor::Red).SetTexCoord(FVector2f(0.f, 0.f));
	const int32 V1 = Builder.AddVertex(FVector3f(0.f, 0.f, 100.f))
		.SetNormalAndTangent(FVector3f(0.f, -1.f, 0.f), FVector3f(1.f, 0.f, 0.f))
		.SetColor(FColor::Green).SetTexCoord(FVector2f(0.5f, 1.f));
	const int32 V2 = Builder.AddVertex(FVector3f(50.f, 0.f, 0.f))
		.SetNormalAndTangent(FVector3f(0.f, -1.f, 0.f), FVector3f(1.f, 0.f, 0.f))
		.SetColor(FColor::Blue).SetTexCoord(FVector2f(1.f, 0.f));

	Builder.AddTriangle(V0, V1, V2, /*PolyGroup*/ 0);

	Mesh->SetupMaterialSlot(0, "PrimaryMaterial");

	// The buffer set owns the GPU buffers; each poly group becomes a section automatically.
	const FMeshFluxBufferSetKey GroupKey = FMeshFluxBufferSetKey::Create(0, FName("Triangle"));
	Mesh->CreateBufferSet(GroupKey, MoveTemp(StreamSet));
}

Concepts

A mesh is organised as LODs > buffer sets > sections:

  • LOD (FMeshFluxLODKey): a level of detail with its own screen size. LOD 0 always exists; add more with Add LOD.
  • Buffer set (FMeshFluxBufferSetKey, also called a section group): one set of GPU vertex and index buffers built from a stream set. Its FMeshFluxBufferSetConfig selects the draw type: Static (default) or Dynamic (allocated for in-place updates).
  • Section (FMeshFluxSectionKey): a range of triangles inside a buffer set drawn with one material slot. When the stream set has poly groups, one section per poly group is created automatically; Make Section Key For Polygon Group returns its key. FMeshFluxSectionConfig holds the material slot, visibility, shadow casting and main-pass flags.
  • Material slots belong to the mesh object: Setup Material Slot.
  • Streams: one column of data each; standard keys come from Get Common Stream Key (C++: FMeshFluxStreams::Position, Tangents, TexCoords, Color, Triangles, PolyGroups, PositionPrev, ...).
Which update path?Topology changes (vertex or triangle count) need UpdateBufferSet. When only values change on a Dynamic buffer set, use EditMeshInPlace / EditMeshInPlaceRanged in C++; only the streams you report as changed are uploaded.

Component and actor

AMeshFluxActor owns a UMeshFluxComponent as its root and is the easiest starting point. Actor properties: bDeferGeneration (build in On Generate Mesh instead of the construction script), bFrozen (stop automatic rebuilds), bResetOnRebuild (clear the mesh before rebuilding). Component properties: KeepMomentumOnCollisionUpdate, bUpdateNavigationOnCollisionUpdate.

AMeshFluxActor

NodeTypeDescription
Make StreamCallableCreates a new, empty stream object with the given key, element type and element count.
Make Stream SetCallableCreates a new, empty stream set object.
Make Mesh BuilderCallableCreates a mesh builder (a stream set with vertex/triangle helpers) with the requested tangent, UV, index, poly-group and color layout.
Get Mesh Flux ComponentPureReturns the actor's MeshFlux component.
On Generate MeshEventOverride to build geometry when bDeferGeneration is enabled; runs when a rebuild is requested instead of in the construction script.

UMeshFluxComponent

NodeTypeDescription
Should Replicate Mesh DataPureReturns the value set by Set Replicate Mesh Data.
Set Replicate Mesh DataCallableMarks the component as a candidate for an external mesh-data sync layer (no such layer is included; see Networking).
Set Mesh FluxCallableAssigns an existing mesh object to the component.
Initialize Mesh FluxCallableCreates a mesh object of the given class (Simple or Procedural), assigns it to the component and returns it.
Get Mesh FluxPureReturns the mesh object currently rendered by the component.

Mesh object: LODs and materials

Functions on every mesh object (UMeshFlux, the base of Simple and Procedural).

UMeshFlux

NodeTypeDescription
Calc Tex Coord At LocationPureComputes the UV at a body-space location on a given face (used for UV lookups from hits).
ResetCallableClears all geometry and material slots of the mesh.
Get Local BoundsPureReturns the mesh bounds in local space.
On Generate MeshEventImplementable event on the mesh object, called when the mesh is (re)generated; implement it in a Blueprint subclass of the mesh class.
Add LODCallableAdds a new LOD with the given config and returns its key.
Update LOD ConfigCallableChanges visibility or screen size of an existing LOD.
Remove Trailing LODCallableRemoves the last LOD.
Setup Material SlotCallableCreates or updates a material slot (index, name, optional material).
Set Num Material SlotsCallableGrows or shrinks the material slot list.
Get Material IndexPureReturns the slot index for a slot name, or -1.
Get Material Slot NamePureReturns the name of a slot index.
Is Material Slot Name ValidPureTrue if a slot with that name exists.
Get Material SlotPureReturns the slot struct (name and material) at an index.
Get Num MaterialsPureNumber of material slots.
Get Material Slot NamesPureAll slot names.
Get Material SlotsPureAll slot structs.
Get MaterialPureMaterial assigned to a slot index.

Sections, buffer sets and collision setup

Functions shared by the Simple and Procedural mesh types (UMeshFluxManaged). Nodes with a completion pin run asynchronously and fire the delegate when the render and collision update has finished. Rows marked as hidden compatibility aliases do not appear in the action menu.

UMeshFluxManaged

NodeTypeDescription
Should Serialize Mesh DataPureTrue if the mesh data is saved with the owning asset or level.
Set Should Serialize Mesh DataCallableEnables or disables saving the mesh data with the owning asset or level.
Get Buffer SetsPureKeys of all buffer sets in a LOD.
Get Section GroupsPureHidden compatibility alias of Get Buffer Sets.
CreateSectionCallableCreates a section over a stream range of a buffer set, with a section config and optional collision.
UpdateSectionConfigCallableChanges material slot, visibility, shadow or main-pass flags of a section.
Get Sections In Buffer SetCallableKeys of all sections in a buffer set.
Get Sections In GroupCallableHidden compatibility alias of Get Sections In Buffer Set.
RemoveSectionCallableRemoves a section.
RemoveBufferSetCallableRemoves a buffer set and all of its sections.
RemoveSectionGroupCallableHidden compatibility alias of RemoveBufferSet.
Get Section ConfigPureReturns the config of a section.
Is Section VisiblePureTrue if the section is visible.
SetSectionVisibilityCallableShows or hides a section.
Is Section Casting ShadowPureTrue if the section casts shadows.
SetSectionCastShadowCallableEnables or disables shadow casting for a section.
Set Distance FieldCallableAssigns distance-field data you supply for the mesh.
Set Card RepresentationCallableAssigns Lumen card representation data you supply for the mesh.
Has Custom Complex Mesh GeometryPureTrue if custom complex collision geometry has been set.
Get Collision ConfigPureReturns the collision configuration.
SetCollisionConfigCallableSets complex-as-simple, async cook, fast cook, flip normals, deformable and merge options; rebuilds collision.
Get Simple GeometryPureReturns the simple collision shapes.
SetSimpleGeometryCallableReplaces the simple collision shapes and rebuilds collision.

Simple mesh

UMeshFluxSimple is the general-purpose mesh type: fill a stream set or mesh builder and hand it to a buffer set.

UMeshFluxSimple

NodeTypeDescription
Initialize Mesh Flux SimpleCallableCreates a Simple mesh on the given component and returns it.
CreateBufferSetCallableCreates a buffer set from a stream set (or mesh builder). With poly groups, one section per group is created automatically.
CreateBufferSetUniqueCallableSame as CreateBufferSet with an automatically generated key; returns the key.
UpdateBufferSetCallableReplaces the data of an existing buffer set (topology may change).
CreateSectionGroupCallableHidden compatibility alias of CreateBufferSet.
CreateSectionGroupUniqueCallableHidden compatibility alias of CreateBufferSetUnique.
UpdateSectionGroupCallableHidden compatibility alias of UpdateBufferSet.
Set Should Auto Create Sections For Poly GroupsCallableEnables or disables automatic section creation from poly groups for a buffer set.
Should Auto Create Sections For Polygon GroupsPureReturns the automatic poly-group section setting for a buffer set.

Procedural mesh (ProceduralMeshComponent-style)

UMeshFluxProcedural mirrors the UProceduralMeshComponent API with parallel arrays, so existing procedural-mesh graphs move over with a find-and-replace. UMeshFluxProceduralMeshLibrary provides the matching helper nodes.

UMeshFluxProcedural

NodeTypeDescription
Initialize Mesh Flux ProceduralCallableCreates a Procedural mesh on the given component and returns it.
Create Mesh SectionCallableCreates (or replaces) a section from parallel arrays: vertices, triangles, normals, UV0, colors, tangents; optional collision.
Create Mesh Section (LinearColor)CallableAs Create Mesh Section with linear colors, four UV channels and optional sRGB conversion.
Update Mesh SectionCallableUpdates vertex attributes of an existing section (triangles unchanged).
Update Mesh Section (LinearColor)CallableAs Update Mesh Section with linear colors and four UV channels.
Get Mesh SectionPureReads a section back into arrays; false if the section does not exist.
Clear Mesh SectionCallableRemoves one section.
Clear All Mesh SectionsCallableRemoves every section.
Set Mesh Section VisibleCallableShows or hides a section.
Is Mesh Section VisiblePureTrue if the section is visible.
Get Num SectionsPureHighest allocated section index plus one.
Add Collision Convex MeshCallableAdds a convex hull to the simple collision.
Clear Collision Convex MeshesCallableRemoves all convex hulls.
Get Use Complex As Simple CollisionPureTrue if triangle collision is also used as simple collision.
Set Use Complex As Simple CollisionCallableUses triangle collision as simple collision (disable for simulated meshes with convex hulls).

UMeshFluxProceduralMeshLibrary

NodeTypeDescription
Generate Box MeshCallableGenerates box arrays (vertices, triangles, normals, UVs, tangents).
Calculate Tangents For MeshCallableComputes normals and tangents for array-based geometry.
Convert Quad To TrianglesCallableAppends two triangles for a quad.
Create Grid Mesh TrianglesCallableTriangle indices for a vertex grid.
Create Grid Mesh WeldedCallableWelded grid: vertices, triangles and UVs.
Create Grid Mesh SplitCallableGrid with split vertices per quad.
Get Section From Procedural MeshCallableReads a section of a Procedural mesh into arrays.

Stream sets, builders and streams

A stream is one column of mesh data, a stream set is the collection handed to a buffer set, and the mesh builder (UMeshFluxLocalBuilder, a stream set) adds vertex and triangle helpers. UMeshFluxStreamPool is an optional object pool (create it with Construct Object) for reusing these objects; pool limits are set by the MeshFlux.*.MaxPoolSize console variables.

UMeshFluxStreamSet

NodeTypeDescription
Add StreamCallableAdds a stream object to the set.
Remove StreamCallableRemoves the stream with the given key.
ResetCallableRemoves all streams.
Make Local Mesh BuilderCallableCreates a mesh builder that writes into this stream set.

UMeshFluxLocalBuilder

NodeTypeDescription
InitializeCallableConfigures the builder layout (tangents, UVs, 32-bit indices, poly groups, colors, UV channel count).
Enable TangentsCallableAdds a tangent stream (optionally high precision).
Disable TangentsCallableRemoves the tangent stream.
Enable ColorsCallableAdds a vertex color stream.
Disable ColorsCallableRemoves the vertex color stream.
Enable Tex CoordsCallableAdds UV channels (count, optional high precision).
Disable Tex CoordsCallableRemoves the UV streams.
Enable Depth Only TrianglesCallableAdds a depth-only index stream.
Disable Depth Only TrianglesCallableRemoves the depth-only index stream.
Enable Poly GroupsCallableAdds a per-triangle poly-group stream (used to split sections and materials).
Disable Poly GroupsCallableRemoves the poly-group stream.
Add TriangleCallableAdds a triangle from three vertex indices with a poly group; returns its index.
Set TriangleCallableOverwrites a triangle.
Get TriangleCallableReads a triangle and its poly group.
Add VertexCallableAdds a vertex from a MeshFluxBasicVertex struct; returns its index.
Edit VertexCallableOverwrites selected attributes of a vertex (position, normal, tangent, color, UVs).
Get VertexCallableReads all attributes of a vertex.

UMeshFluxStream

NodeTypeDescription
Get NumCallableNumber of rows in the stream.
Is Index ValidCallableTrue if the row index exists.
Is EmptyCallableTrue if the stream has no rows.
ReserveCallableReserves capacity.
ShrinkCallableReleases unused capacity.
EmptyCallableRemoves all rows (optionally keeping capacity).
Set Num UninitializedCallableResizes without initialising new rows.
Set Num ZeroedCallableResizes, zeroing new rows.
Add UninitializedCallableAppends rows without initialising them; returns the first index and a row handle.
Add ZeroedCallableAppends zeroed rows; returns the first index and a row handle.
Edit RowCallableReturns a row handle for element-wise access.
Add IntCallableAppends an integer row.
Add FloatCallableAppends a float row.
Add Vector 2CallableAppends a 2D vector row.
Add Vector 3CallableAppends a 3D vector row.
Add Vector 4CallableAppends a 4D vector row.
Set IntCallableWrites an integer row.
Set FloatCallableWrites a float row.
Set Vector 2CallableWrites a 2D vector row.
Set Vector 3CallableWrites a 3D vector row.
Set Vector 4CallableWrites a 4D vector row.
Get IntCallableReads an integer row.
Get FloatCallableReads a float row.
Get Vector 2CallableReads a 2D vector row.
Get Vector 3CallableReads a 3D vector row.
Get Vector 4CallableReads a 4D vector row.

UMeshFluxStreamUtils

NodeTypeDescription
Copy Stream Set From ComponentsCallableFills a stream set from plain arrays (triangles, poly groups, positions, normals, tangents, binormals, colors, UV0-UV3).
Set Int ElementCallableWrites one integer element of a row.
Set Float ElementCallableWrites one float element of a row.
Set Vector 2 ElementCallableWrites one 2D vector element of a row.
Set Vector 3 ElementCallableWrites one 3D vector element of a row.
Set Vector 4 ElementCallableWrites one 4D vector element of a row.
Get Int ElementCallableReads one integer element of a row.
Get Float ElementCallableReads one float element of a row.
Get Vector 2 ElementCallableReads one 2D vector element of a row.
Get Vector 3 ElementCallableReads one 3D vector element of a row.
Get Vector 4 ElementCallableReads one 4D vector element of a row.

UMeshFluxStreamPool

NodeTypeDescription
Request StreamCallableTakes a stream from the pool (allocating if empty).
Return StreamCallableReturns a stream to the pool.
Request Stream SetCallableTakes a stream set from the pool.
Return Stream SetCallableReturns a stream set to the pool.
Request Mesh BuilderCallableTakes a mesh builder from the pool.
Return Mesh BuilderCallableReturns a mesh builder to the pool.
Return All StreamsCallableReturns every object handed out back to the pool.
Free All StreamsCallableReleases every pooled object.

Keys

LOD, buffer set, section and stream keys identify parts of a mesh.

UMeshFluxBlueprintFunctionLibrary

NodeTypeDescription
LODIndex to LODKeyPureAutocast from an integer LOD index to a LOD key.
Make LOD KeyPureLOD key for a LOD index.
Make Buffer Set Key UniquePureBuffer set key with a generated unique name.
Make Buffer Set Key IndexedPureBuffer set key from an index.
Make Buffer Set Key NamedPureBuffer set key from a name.
Make Section Group Key UniquePureHidden compatibility alias of Make Buffer Set Key Unique.
Make Section Group Key IndexedPureHidden compatibility alias of Make Buffer Set Key Indexed.
Make Section Group Key NamedPureHidden compatibility alias of Make Buffer Set Key Named.
Make Section Key UniquePureSection key with a generated unique name.
Make Section Key IndexedPureSection key from an index.
Make Section Key NamedPureSection key from a name.
Make Section Key For Polygon GroupPureKey of the section created automatically for a poly group.
Break LOD KeyPureLOD index of a LOD key.
Make Stream RangePureVertex and index range used when creating sections.
Make Stream KeyPureStream key from a stream type and name.
Get Common Stream KeyPureKey of a standard stream (position, tangents, UVs, color, triangles, poly groups, ...).

Collision shapes

Build an FMeshFluxSimpleGeometry with these nodes and pass it to SetSimpleGeometry. Each shape has an optional name for lookup.

UMeshFluxSimpleGeometryFunctionLibrary

NodeTypeDescription
Add SphereCallableAppends a sphere to a Simple Geometry struct; outputs its index.
Insert SphereCallableInserts a sphere at an index.
Get Sphere By NameCallableFinds a sphere by name.
Update SphereCallableReplaces the sphere at an index.
Remove SphereCallableRemoves the sphere at an index.
Remove Sphere By NameCallableRemoves a sphere by name.
Add BoxCallableAppends a box to a Simple Geometry struct; outputs its index.
Insert BoxCallableInserts a box at an index.
Get Box By NameCallableFinds a box by name.
Update BoxCallableReplaces the box at an index.
Remove BoxCallableRemoves the box at an index.
Remove Box By NameCallableRemoves a box by name.
Add CapsuleCallableAppends a capsule to a Simple Geometry struct; outputs its index.
Insert CapsuleCallableInserts a capsule at an index.
Get Capsule By NameCallableFinds a capsule by name.
Update CapsuleCallableReplaces the capsule at an index.
Remove CapsuleCallableRemoves the capsule at an index.
Remove Capsule By NameCallableRemoves a capsule by name.
Add Tapered CapsuleCallableAppends a tapered capsule to a Simple Geometry struct; outputs its index.
Insert Tapered CapsuleCallableInserts a tapered capsule at an index.
Get Tapered Capsule By NameCallableFinds a tapered capsule by name.
Update Tapered CapsuleCallableReplaces the tapered capsule at an index.
Remove Tapered CapsuleCallableRemoves the tapered capsule at an index.
Remove Tapered Capsule By NameCallableRemoves a tapered capsule by name.
Add ConvexCallableAppends a convex hull to a Simple Geometry struct; outputs its index.
Insert ConvexCallableInserts a convex hull at an index.
Get Convex By NameCallableFinds a convex hull by name.
Update ConvexCallableReplaces the convex hull at an index.
Remove ConvexCallableRemoves the convex hull at an index.
Remove Convex By NameCallableRemoves a convex hull by name.

UMeshFluxCollisionTools

NodeTypeDescription
Find Collision UV Mesh FluxCallableReturns the UV at a hit on a MeshFlux component. Requires Project Settings > Physics > Support UV From Hit Results.
Cook Convex HullCallableCooks a convex hull shape ahead of use.
Cook Complex MeshCallableCooks a complex collision mesh ahead of use.

Static mesh conversion and shapes

Copy between Static Mesh assets and MeshFlux data, and generate primitive shapes.

UMeshFluxStaticMeshConverter

NodeTypeDescription
Copy Stream Set From Static MeshCallableCopies a Static Mesh LOD into a stream set (render data needs Allow CPU Access).
Copy Stream Set To Static MeshCallableWrites a stream set into a Static Mesh (editor only).
Copy Mesh Flux From Static MeshCallableBuilds a Simple mesh from a Static Mesh, including material slots and collision options.
Copy Mesh Flux To Static MeshCallableWrites a Simple mesh into a Static Mesh (editor only).

UMeshFluxBasicShapeTools

NodeTypeDescription
Append Box MeshCallableAppends a box (half extents, transform, poly group, color) to a stream set.

Structs and enums

TypeKindDescription
FMeshFluxLODKeyStructIdentifies a LOD.
FMeshFluxBufferSetKeyStructIdentifies a buffer set (LOD plus name or index).
FMeshFluxSectionKeyStructIdentifies a section inside a buffer set.
FMeshFluxStreamKeyStructIdentifies a stream (vertex or index type plus name).
FMeshFluxStreamRangeStructVertex and index range of a section.
FMeshFluxLODConfigStructbIsVisible, ScreenSize.
FMeshFluxBufferSetConfigStructDrawType (Static or Dynamic), bComputeWritable.
FMeshFluxSectionConfigStructMaterialSlot, bIsVisible, bCastsShadow, bIsMainPassRenderable, bForceOpaque.
FMeshFluxCollisionConfigurationStructbUseComplexAsSimpleCollision, bUseAsyncCook, bShouldFastCookMeshes, bFlipNormals, bDeformableMesh, bMergeAllMeshes.
FMeshFluxSimpleGeometryStructSimple collision shapes of a mesh.
FMeshFluxCollisionBox / FMeshFluxCollisionSphere / FMeshFluxCollisionCapsule / FMeshFluxCollisionTaperedCapsule / FMeshFluxCollisionConvexStructIndividual collision shapes (name, center, rotation and size).
FMeshFluxCollisionMeshStructTriangle mesh used for complex collision.
FMeshFluxMaterialSlotStructSlot name and material.
FMeshFluxBasicVertexStructVertex input for Add Vertex: position, normal, tangent, color, UVs.
FMeshFluxStreamRowPtrStructHandle to a stream row used by the stream element nodes.
FMeshFluxStreamSetFromComponentsStructPlain arrays (triangles, poly groups, positions, normals, tangents, binormals, colors, UV0-UV3) for Copy Stream Set From Components.
FMeshFluxProceduralTangentStructTangent input of the Procedural mesh type.
FMeshFluxDistanceField / FMeshFluxCardRepresentationStructDistance-field and Lumen card data you supply.
FMeshFluxStaticMeshConversionOptions / FStreamSetStaticMeshConversionOptionsStructOptions for the Static Mesh converter (LOD or LOD range, tangents, UVs, colors, poly groups, materials).
EMeshFluxSectionDrawTypeEnumStatic or Dynamic buffer allocation.
EMeshFluxSimpleStreamConfig / EMeshFluxSimpleStreamTypeEnumBuilder layout options and Blueprint stream element types.
EMeshFluxStreamTypeEnumVertex or index stream.
EMeshFluxProxyUpdateStatusEnumResult of an asynchronous update.

C++ API

Include MeshFluxSimple.h (and Core/MeshFluxFuture.h for the async helpers) and add using namespace MeshFlux;. All C++ update functions return a TFuture<EMeshFluxProxyUpdateStatus>.

Rebuild or update a buffer set

FMeshFluxStreamSet StreamSet;
// ... fill with TMeshFluxBuilderLocal ...
if (Mesh->GetBufferSets(FMeshFluxLODKey(0)).Contains(GroupKey))
{
	Mesh->UpdateBufferSet(GroupKey, MoveTemp(StreamSet));
}
else
{
	Mesh->CreateBufferSet(GroupKey, MoveTemp(StreamSet));
}

In-place update on a Dynamic buffer set

Mesh->CreateBufferSet(GroupKey, StreamSet, FMeshFluxBufferSetConfig(EMeshFluxSectionDrawType::Dynamic));

Mesh->EditMeshInPlace(GroupKey, [Time](FMeshFluxStreamSet& Streams) -> TSet<FMeshFluxStreamKey>
{
	FMeshFluxStream* Positions = Streams.Find(FMeshFluxStreams::Position);
	if (!Positions) { return {}; }

	TMeshFluxStreamBuilder<FVector3f, void> Position(*Positions);
	for (int32 Index = 0; Index < Position.Num(); ++Index)
	{
		FVector3f V = Position.GetValue(Index);
		V.Z = FMath::Sin(Time + Index * 0.1f) * 10.f;
		Position.Set(Index, V);
	}
	return { FMeshFluxStreams::Position }; // only this stream is uploaded
});

EditMeshInPlaceRanged works the same way but returns the changed element range per stream, so only that part of the GPU buffer is written. Streams that cannot use the in-place path fall back to a full update automatically.

Build on a worker thread

TWeakObjectPtr<UMeshFluxSimple> WeakMesh(Mesh);
TFuture<FMeshFluxStreamSet> BuildFuture = DoOnAsyncThread([]()
{
	FMeshFluxStreamSet StreamSet;
	// ... expensive generation ...
	return StreamSet;
});

ContinueOnGameThread(MoveTemp(BuildFuture), [WeakMesh](TFuture<FMeshFluxStreamSet>&& Result)
{
	if (UMeshFluxSimple* Target = WeakMesh.Get())
	{
		Target->CreateBufferSet(FMeshFluxBufferSetKey::Create(0, FName("AsyncMesh")), Result.Get());
	}
});

Other C++ entry points

SymbolTypeDescription
TMeshFluxBuilderLocalClassTemplated mesh builder: AddVertex(...).SetNormalAndTangent(...).SetColor(...).SetTexCoord(...), AddTriangle(A, B, C, PolyGroup).
TMeshFluxStreamBuilderClassTyped array view over one stream.
FMeshFluxDynamicBuilderClassNon-templated builder whose layout is chosen at runtime.
ProcessMesh / ProcessBufferSetCallableRead a buffer set's data under the mesh lock without copying.
IMeshFluxSimple_V1ClassSelf-contained contract header (Public/Contracts/MeshFluxSimpleContract_v1.h) that other plugins can copy to create simple meshes through the AlphaXP.MeshFlux.Simple.1 modular feature without a hard dependency on MeshFlux.

Console variables

VariableDefaultDescription
r.RayTracing.Geometry.MeshFlux1Include MeshFlux meshes in ray tracing.
r.MeshFlux.ShowNormals0Draw vertex normals.
r.MeshFlux.ShowTangents0Draw vertex tangents.
r.MeshFlux.ShowBinormals0Draw vertex binormals.
r.MeshFlux.ShowVertexColors0Show vertex colors.
r.MeshFlux.DebugLineLength5.0Length of the debug lines.
MeshFlux.InPlaceUpdate.Enabled1Use the in-place GPU update path for Dynamic buffer sets (0 forces full updates).
MeshFlux.StreamPool.MaxPoolSize256Maximum pooled streams.
MeshFlux.StreamSetPool.MaxPoolSize64Maximum pooled stream sets.
MeshFlux.Builder.MaxPoolSize16Maximum pooled mesh builders.

Editor tools

  • Details panel: selecting a MeshFlux component shows a Mesh Stats category (mesh type, bounds, visibility, shadows, materials, LOD count, LOD 0 vertex and triangle counts) and a Create Static Mesh button that bakes the current mesh into a new Static Mesh asset.
  • MeshFlux menu: in the main menu and the play toolbar, with Open Documentation and Get Support.

The plugin registers no Project Settings.

Example actors

The MeshFluxExamples module contains these C++ actors (search for MeshFlux in the Place Actors panel). Source is in Source/MeshFluxExamples.

ActorTypeShows
AMeshFluxExample_Simple_HelloTriangleClassOne two-sided triangle with the mesh builder; the minimal path.
AMeshFluxExample_Simple_ComponentSetupClassAdding a MeshFlux component to a plain actor.
AMeshFluxExample_Simple_StreamBuildersClassBuilding with per-stream builders.
AMeshFluxExample_Simple_MultipleUVsClassTwo UV channels.
AMeshFluxExample_Simple_VertexColorsClassFour ways to author vertex colors.
AMeshFluxExample_Simple_BasicShapesClassBoxes from the basic shape tools.
AMeshFluxExample_Simple_MultipleSectionsClassSeveral sections and materials in one buffer set via poly groups.
AMeshFluxExample_Simple_LODsClassFour LODs with screen sizes.
AMeshFluxExample_Simple_CollisionClassSimple box collision and complex-as-simple collision.
AMeshFluxExample_Simple_HighPolyClassSubdivided sphere with 32-bit indices.
AMeshFluxExample_Simple_DynamicUpdateClassGrid rebuilt every frame with UpdateBufferSet.
AMeshFluxExample_Simple_FastUpdateClassSame animation with in-place updates (full grid or a ranged middle band).
AMeshFluxExample_Simple_AsyncBuildClassGeneration on a worker thread, commit on the game thread.
AMeshFluxExample_Simple_ComputeIndirectClassGPU-driven indirect draw arguments (needs a real GPU).
AMeshFluxExample_Procedural_BasicClassA box through Create Mesh Section.
AMeshFluxExample_Procedural_UpdateClassA grid animated with Update Mesh Section.

Content

Example Blueprints in MeshFlux Content/Examples (all derive from MeshFluxActor and build their mesh in Blueprint).

AssetTypeShows
BP_MeshFlux_HelloTriangleBlueprintThe minimal mesh-builder graph (see Quick start).
BP_MeshFlux_ComponentSetupBlueprintUsing the MeshFlux component variable directly with the mesh builder.
BP_MeshFlux_StreamBuildersBlueprintBuilding with Make Stream and Add Stream instead of the mesh builder.
BP_MeshFlux_MultipleUVsBlueprintA mesh builder with more than one UV channel.
BP_MeshFlux_VertexColorsBlueprintPer-vertex colors with the mesh builder.
BP_MeshFlux_BasicShapesBlueprintAppend Box Mesh into a stream set.
BP_MeshFlux_MultipleSectionsBlueprintPoly groups, sections and material slots.
BP_MeshFlux_LODsBlueprintAdd LOD and Update LOD Config with one box per LOD.
BP_MeshFlux_CollisionBlueprintSetCollisionConfig and SetSimpleGeometry with a box shape.
BP_MeshFlux_DynamicUpdateBlueprintEdit Vertex and UpdateBufferSet to change a mesh after it is built.

Networking

UMeshFluxComponent is replicated by default and replicates its MeshFlux property (the mesh object reference, with a RepNotify). AMeshFluxActor only replicates when you enable Replicates on it. Mesh geometry itself is not sent over the network: generate the mesh on every machine, as the examples do in the construction script. Set Replicate Mesh Data only flags the component for an external mesh-data sync layer, which MeshFlux does not include.

Troubleshooting

SymptomCause and fix
Nothing renders after CreateBufferSetCheck that the component was initialised with Initialize Mesh Flux Simple (or Initialize Mesh Flux), that triangles were added, and that each poly group has a material slot from Setup Material Slot. A section with no valid material renders with the default material.
The example Blueprints are not visibleEnable Show Plugin Content in the Content Browser settings and look in MeshFlux Content/Examples.
Simulated physics does not work on the meshComplex (triangle) collision cannot simulate. Disable bUseComplexAsSimpleCollision with SetCollisionConfig (Procedural: Set Use Complex As Simple Collision) and add simple shapes or convex hulls.
Find Collision UV Mesh Flux always returns falseEnable Project Settings > Physics > Support UV From Hit Results.
Copying from a Static Mesh fails in a packaged gameReading render data at runtime requires Allow CPU Access on the Static Mesh asset; the log names the problem. Writing into a Static Mesh (Copy ... To Static Mesh, Create Static Mesh) is editor only.
In-place edits seem to rebuild the whole meshThe buffer set must be created with the Dynamic draw type, and MeshFlux.InPlaceUpdate.Enabled must be 1. Streams that are not eligible fall back to a full update.
Clients do not see the mesh in multiplayerGeometry is not replicated. Build the mesh on every machine (construction script or BeginPlay); see Networking.
The ComputeIndirect example shows nothingIt needs a real GPU and does not work with -NullRHI.

Credits

© 2026 Alpha XP — alphaxp.net · Support: support@alphaxp.net. Built and verified for Unreal Engine 5.8.