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
| Requirement | Details |
| Unreal Engine | 5.8 (verified clean) |
| Modules | MeshFlux (Runtime, loads at PostConfigInit), MeshFluxEditor (Editor), MeshFluxExamples (Runtime) |
| Dependencies | None (engine modules only, no other plugins) |
| Language | Blueprints and C++ |
| Platforms | No 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
- 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).
- Open the editor, go to Edit > Plugins, enable MeshFlux and restart.
- For C++ use, add the runtime module to your module's
Build.cs: PublicDependencyModuleNames.Add("MeshFlux");
- 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
- Create a Blueprint class with
MeshFluxActor as parent. It already has a MeshFlux component as root.
- 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.
- 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.
- On the mesh, call Setup Material Slot (slot 0, a name, a material).
- 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
| Node | Type | Description |
| Make Stream | Callable | Creates a new, empty stream object with the given key, element type and element count. |
| Make Stream Set | Callable | Creates a new, empty stream set object. |
| Make Mesh Builder | Callable | Creates a mesh builder (a stream set with vertex/triangle helpers) with the requested tangent, UV, index, poly-group and color layout. |
| Get Mesh Flux Component | Pure | Returns the actor's MeshFlux component. |
| On Generate Mesh | Event | Override to build geometry when bDeferGeneration is enabled; runs when a rebuild is requested instead of in the construction script. |
UMeshFluxComponent
| Node | Type | Description |
| Should Replicate Mesh Data | Pure | Returns the value set by Set Replicate Mesh Data. |
| Set Replicate Mesh Data | Callable | Marks the component as a candidate for an external mesh-data sync layer (no such layer is included; see Networking). |
| Set Mesh Flux | Callable | Assigns an existing mesh object to the component. |
| Initialize Mesh Flux | Callable | Creates a mesh object of the given class (Simple or Procedural), assigns it to the component and returns it. |
| Get Mesh Flux | Pure | Returns 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
| Node | Type | Description |
| Calc Tex Coord At Location | Pure | Computes the UV at a body-space location on a given face (used for UV lookups from hits). |
| Reset | Callable | Clears all geometry and material slots of the mesh. |
| Get Local Bounds | Pure | Returns the mesh bounds in local space. |
| On Generate Mesh | Event | Implementable event on the mesh object, called when the mesh is (re)generated; implement it in a Blueprint subclass of the mesh class. |
| Add LOD | Callable | Adds a new LOD with the given config and returns its key. |
| Update LOD Config | Callable | Changes visibility or screen size of an existing LOD. |
| Remove Trailing LOD | Callable | Removes the last LOD. |
| Setup Material Slot | Callable | Creates or updates a material slot (index, name, optional material). |
| Set Num Material Slots | Callable | Grows or shrinks the material slot list. |
| Get Material Index | Pure | Returns the slot index for a slot name, or -1. |
| Get Material Slot Name | Pure | Returns the name of a slot index. |
| Is Material Slot Name Valid | Pure | True if a slot with that name exists. |
| Get Material Slot | Pure | Returns the slot struct (name and material) at an index. |
| Get Num Materials | Pure | Number of material slots. |
| Get Material Slot Names | Pure | All slot names. |
| Get Material Slots | Pure | All slot structs. |
| Get Material | Pure | Material 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
| Node | Type | Description |
| Should Serialize Mesh Data | Pure | True if the mesh data is saved with the owning asset or level. |
| Set Should Serialize Mesh Data | Callable | Enables or disables saving the mesh data with the owning asset or level. |
| Get Buffer Sets | Pure | Keys of all buffer sets in a LOD. |
| Get Section Groups | Pure | Hidden compatibility alias of Get Buffer Sets. |
| CreateSection | Callable | Creates a section over a stream range of a buffer set, with a section config and optional collision. |
| UpdateSectionConfig | Callable | Changes material slot, visibility, shadow or main-pass flags of a section. |
| Get Sections In Buffer Set | Callable | Keys of all sections in a buffer set. |
| Get Sections In Group | Callable | Hidden compatibility alias of Get Sections In Buffer Set. |
| RemoveSection | Callable | Removes a section. |
| RemoveBufferSet | Callable | Removes a buffer set and all of its sections. |
| RemoveSectionGroup | Callable | Hidden compatibility alias of RemoveBufferSet. |
| Get Section Config | Pure | Returns the config of a section. |
| Is Section Visible | Pure | True if the section is visible. |
| SetSectionVisibility | Callable | Shows or hides a section. |
| Is Section Casting Shadow | Pure | True if the section casts shadows. |
| SetSectionCastShadow | Callable | Enables or disables shadow casting for a section. |
| Set Distance Field | Callable | Assigns distance-field data you supply for the mesh. |
| Set Card Representation | Callable | Assigns Lumen card representation data you supply for the mesh. |
| Has Custom Complex Mesh Geometry | Pure | True if custom complex collision geometry has been set. |
| Get Collision Config | Pure | Returns the collision configuration. |
| SetCollisionConfig | Callable | Sets complex-as-simple, async cook, fast cook, flip normals, deformable and merge options; rebuilds collision. |
| Get Simple Geometry | Pure | Returns the simple collision shapes. |
| SetSimpleGeometry | Callable | Replaces 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
| Node | Type | Description |
| Initialize Mesh Flux Simple | Callable | Creates a Simple mesh on the given component and returns it. |
| CreateBufferSet | Callable | Creates a buffer set from a stream set (or mesh builder). With poly groups, one section per group is created automatically. |
| CreateBufferSetUnique | Callable | Same as CreateBufferSet with an automatically generated key; returns the key. |
| UpdateBufferSet | Callable | Replaces the data of an existing buffer set (topology may change). |
| CreateSectionGroup | Callable | Hidden compatibility alias of CreateBufferSet. |
| CreateSectionGroupUnique | Callable | Hidden compatibility alias of CreateBufferSetUnique. |
| UpdateSectionGroup | Callable | Hidden compatibility alias of UpdateBufferSet. |
| Set Should Auto Create Sections For Poly Groups | Callable | Enables or disables automatic section creation from poly groups for a buffer set. |
| Should Auto Create Sections For Polygon Groups | Pure | Returns 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
| Node | Type | Description |
| Initialize Mesh Flux Procedural | Callable | Creates a Procedural mesh on the given component and returns it. |
| Create Mesh Section | Callable | Creates (or replaces) a section from parallel arrays: vertices, triangles, normals, UV0, colors, tangents; optional collision. |
| Create Mesh Section (LinearColor) | Callable | As Create Mesh Section with linear colors, four UV channels and optional sRGB conversion. |
| Update Mesh Section | Callable | Updates vertex attributes of an existing section (triangles unchanged). |
| Update Mesh Section (LinearColor) | Callable | As Update Mesh Section with linear colors and four UV channels. |
| Get Mesh Section | Pure | Reads a section back into arrays; false if the section does not exist. |
| Clear Mesh Section | Callable | Removes one section. |
| Clear All Mesh Sections | Callable | Removes every section. |
| Set Mesh Section Visible | Callable | Shows or hides a section. |
| Is Mesh Section Visible | Pure | True if the section is visible. |
| Get Num Sections | Pure | Highest allocated section index plus one. |
| Add Collision Convex Mesh | Callable | Adds a convex hull to the simple collision. |
| Clear Collision Convex Meshes | Callable | Removes all convex hulls. |
| Get Use Complex As Simple Collision | Pure | True if triangle collision is also used as simple collision. |
| Set Use Complex As Simple Collision | Callable | Uses triangle collision as simple collision (disable for simulated meshes with convex hulls). |
UMeshFluxProceduralMeshLibrary
| Node | Type | Description |
| Generate Box Mesh | Callable | Generates box arrays (vertices, triangles, normals, UVs, tangents). |
| Calculate Tangents For Mesh | Callable | Computes normals and tangents for array-based geometry. |
| Convert Quad To Triangles | Callable | Appends two triangles for a quad. |
| Create Grid Mesh Triangles | Callable | Triangle indices for a vertex grid. |
| Create Grid Mesh Welded | Callable | Welded grid: vertices, triangles and UVs. |
| Create Grid Mesh Split | Callable | Grid with split vertices per quad. |
| Get Section From Procedural Mesh | Callable | Reads 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
| Node | Type | Description |
| Add Stream | Callable | Adds a stream object to the set. |
| Remove Stream | Callable | Removes the stream with the given key. |
| Reset | Callable | Removes all streams. |
| Make Local Mesh Builder | Callable | Creates a mesh builder that writes into this stream set. |
UMeshFluxLocalBuilder
| Node | Type | Description |
| Initialize | Callable | Configures the builder layout (tangents, UVs, 32-bit indices, poly groups, colors, UV channel count). |
| Enable Tangents | Callable | Adds a tangent stream (optionally high precision). |
| Disable Tangents | Callable | Removes the tangent stream. |
| Enable Colors | Callable | Adds a vertex color stream. |
| Disable Colors | Callable | Removes the vertex color stream. |
| Enable Tex Coords | Callable | Adds UV channels (count, optional high precision). |
| Disable Tex Coords | Callable | Removes the UV streams. |
| Enable Depth Only Triangles | Callable | Adds a depth-only index stream. |
| Disable Depth Only Triangles | Callable | Removes the depth-only index stream. |
| Enable Poly Groups | Callable | Adds a per-triangle poly-group stream (used to split sections and materials). |
| Disable Poly Groups | Callable | Removes the poly-group stream. |
| Add Triangle | Callable | Adds a triangle from three vertex indices with a poly group; returns its index. |
| Set Triangle | Callable | Overwrites a triangle. |
| Get Triangle | Callable | Reads a triangle and its poly group. |
| Add Vertex | Callable | Adds a vertex from a MeshFluxBasicVertex struct; returns its index. |
| Edit Vertex | Callable | Overwrites selected attributes of a vertex (position, normal, tangent, color, UVs). |
| Get Vertex | Callable | Reads all attributes of a vertex. |
UMeshFluxStream
| Node | Type | Description |
| Get Num | Callable | Number of rows in the stream. |
| Is Index Valid | Callable | True if the row index exists. |
| Is Empty | Callable | True if the stream has no rows. |
| Reserve | Callable | Reserves capacity. |
| Shrink | Callable | Releases unused capacity. |
| Empty | Callable | Removes all rows (optionally keeping capacity). |
| Set Num Uninitialized | Callable | Resizes without initialising new rows. |
| Set Num Zeroed | Callable | Resizes, zeroing new rows. |
| Add Uninitialized | Callable | Appends rows without initialising them; returns the first index and a row handle. |
| Add Zeroed | Callable | Appends zeroed rows; returns the first index and a row handle. |
| Edit Row | Callable | Returns a row handle for element-wise access. |
| Add Int | Callable | Appends an integer row. |
| Add Float | Callable | Appends a float row. |
| Add Vector 2 | Callable | Appends a 2D vector row. |
| Add Vector 3 | Callable | Appends a 3D vector row. |
| Add Vector 4 | Callable | Appends a 4D vector row. |
| Set Int | Callable | Writes an integer row. |
| Set Float | Callable | Writes a float row. |
| Set Vector 2 | Callable | Writes a 2D vector row. |
| Set Vector 3 | Callable | Writes a 3D vector row. |
| Set Vector 4 | Callable | Writes a 4D vector row. |
| Get Int | Callable | Reads an integer row. |
| Get Float | Callable | Reads a float row. |
| Get Vector 2 | Callable | Reads a 2D vector row. |
| Get Vector 3 | Callable | Reads a 3D vector row. |
| Get Vector 4 | Callable | Reads a 4D vector row. |
UMeshFluxStreamUtils
| Node | Type | Description |
| Copy Stream Set From Components | Callable | Fills a stream set from plain arrays (triangles, poly groups, positions, normals, tangents, binormals, colors, UV0-UV3). |
| Set Int Element | Callable | Writes one integer element of a row. |
| Set Float Element | Callable | Writes one float element of a row. |
| Set Vector 2 Element | Callable | Writes one 2D vector element of a row. |
| Set Vector 3 Element | Callable | Writes one 3D vector element of a row. |
| Set Vector 4 Element | Callable | Writes one 4D vector element of a row. |
| Get Int Element | Callable | Reads one integer element of a row. |
| Get Float Element | Callable | Reads one float element of a row. |
| Get Vector 2 Element | Callable | Reads one 2D vector element of a row. |
| Get Vector 3 Element | Callable | Reads one 3D vector element of a row. |
| Get Vector 4 Element | Callable | Reads one 4D vector element of a row. |
UMeshFluxStreamPool
| Node | Type | Description |
| Request Stream | Callable | Takes a stream from the pool (allocating if empty). |
| Return Stream | Callable | Returns a stream to the pool. |
| Request Stream Set | Callable | Takes a stream set from the pool. |
| Return Stream Set | Callable | Returns a stream set to the pool. |
| Request Mesh Builder | Callable | Takes a mesh builder from the pool. |
| Return Mesh Builder | Callable | Returns a mesh builder to the pool. |
| Return All Streams | Callable | Returns every object handed out back to the pool. |
| Free All Streams | Callable | Releases every pooled object. |
Keys
LOD, buffer set, section and stream keys identify parts of a mesh.
UMeshFluxBlueprintFunctionLibrary
| Node | Type | Description |
| LODIndex to LODKey | Pure | Autocast from an integer LOD index to a LOD key. |
| Make LOD Key | Pure | LOD key for a LOD index. |
| Make Buffer Set Key Unique | Pure | Buffer set key with a generated unique name. |
| Make Buffer Set Key Indexed | Pure | Buffer set key from an index. |
| Make Buffer Set Key Named | Pure | Buffer set key from a name. |
| Make Section Group Key Unique | Pure | Hidden compatibility alias of Make Buffer Set Key Unique. |
| Make Section Group Key Indexed | Pure | Hidden compatibility alias of Make Buffer Set Key Indexed. |
| Make Section Group Key Named | Pure | Hidden compatibility alias of Make Buffer Set Key Named. |
| Make Section Key Unique | Pure | Section key with a generated unique name. |
| Make Section Key Indexed | Pure | Section key from an index. |
| Make Section Key Named | Pure | Section key from a name. |
| Make Section Key For Polygon Group | Pure | Key of the section created automatically for a poly group. |
| Break LOD Key | Pure | LOD index of a LOD key. |
| Make Stream Range | Pure | Vertex and index range used when creating sections. |
| Make Stream Key | Pure | Stream key from a stream type and name. |
| Get Common Stream Key | Pure | Key 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
| Node | Type | Description |
| Add Sphere | Callable | Appends a sphere to a Simple Geometry struct; outputs its index. |
| Insert Sphere | Callable | Inserts a sphere at an index. |
| Get Sphere By Name | Callable | Finds a sphere by name. |
| Update Sphere | Callable | Replaces the sphere at an index. |
| Remove Sphere | Callable | Removes the sphere at an index. |
| Remove Sphere By Name | Callable | Removes a sphere by name. |
| Add Box | Callable | Appends a box to a Simple Geometry struct; outputs its index. |
| Insert Box | Callable | Inserts a box at an index. |
| Get Box By Name | Callable | Finds a box by name. |
| Update Box | Callable | Replaces the box at an index. |
| Remove Box | Callable | Removes the box at an index. |
| Remove Box By Name | Callable | Removes a box by name. |
| Add Capsule | Callable | Appends a capsule to a Simple Geometry struct; outputs its index. |
| Insert Capsule | Callable | Inserts a capsule at an index. |
| Get Capsule By Name | Callable | Finds a capsule by name. |
| Update Capsule | Callable | Replaces the capsule at an index. |
| Remove Capsule | Callable | Removes the capsule at an index. |
| Remove Capsule By Name | Callable | Removes a capsule by name. |
| Add Tapered Capsule | Callable | Appends a tapered capsule to a Simple Geometry struct; outputs its index. |
| Insert Tapered Capsule | Callable | Inserts a tapered capsule at an index. |
| Get Tapered Capsule By Name | Callable | Finds a tapered capsule by name. |
| Update Tapered Capsule | Callable | Replaces the tapered capsule at an index. |
| Remove Tapered Capsule | Callable | Removes the tapered capsule at an index. |
| Remove Tapered Capsule By Name | Callable | Removes a tapered capsule by name. |
| Add Convex | Callable | Appends a convex hull to a Simple Geometry struct; outputs its index. |
| Insert Convex | Callable | Inserts a convex hull at an index. |
| Get Convex By Name | Callable | Finds a convex hull by name. |
| Update Convex | Callable | Replaces the convex hull at an index. |
| Remove Convex | Callable | Removes the convex hull at an index. |
| Remove Convex By Name | Callable | Removes a convex hull by name. |
UMeshFluxCollisionTools
| Node | Type | Description |
| Find Collision UV Mesh Flux | Callable | Returns the UV at a hit on a MeshFlux component. Requires Project Settings > Physics > Support UV From Hit Results. |
| Cook Convex Hull | Callable | Cooks a convex hull shape ahead of use. |
| Cook Complex Mesh | Callable | Cooks a complex collision mesh ahead of use. |
Structs and enums
| Type | Kind | Description |
| FMeshFluxLODKey | Struct | Identifies a LOD. |
| FMeshFluxBufferSetKey | Struct | Identifies a buffer set (LOD plus name or index). |
| FMeshFluxSectionKey | Struct | Identifies a section inside a buffer set. |
| FMeshFluxStreamKey | Struct | Identifies a stream (vertex or index type plus name). |
| FMeshFluxStreamRange | Struct | Vertex and index range of a section. |
| FMeshFluxLODConfig | Struct | bIsVisible, ScreenSize. |
| FMeshFluxBufferSetConfig | Struct | DrawType (Static or Dynamic), bComputeWritable. |
| FMeshFluxSectionConfig | Struct | MaterialSlot, bIsVisible, bCastsShadow, bIsMainPassRenderable, bForceOpaque. |
| FMeshFluxCollisionConfiguration | Struct | bUseComplexAsSimpleCollision, bUseAsyncCook, bShouldFastCookMeshes, bFlipNormals, bDeformableMesh, bMergeAllMeshes. |
| FMeshFluxSimpleGeometry | Struct | Simple collision shapes of a mesh. |
| FMeshFluxCollisionBox / FMeshFluxCollisionSphere / FMeshFluxCollisionCapsule / FMeshFluxCollisionTaperedCapsule / FMeshFluxCollisionConvex | Struct | Individual collision shapes (name, center, rotation and size). |
| FMeshFluxCollisionMesh | Struct | Triangle mesh used for complex collision. |
| FMeshFluxMaterialSlot | Struct | Slot name and material. |
| FMeshFluxBasicVertex | Struct | Vertex input for Add Vertex: position, normal, tangent, color, UVs. |
| FMeshFluxStreamRowPtr | Struct | Handle to a stream row used by the stream element nodes. |
| FMeshFluxStreamSetFromComponents | Struct | Plain arrays (triangles, poly groups, positions, normals, tangents, binormals, colors, UV0-UV3) for Copy Stream Set From Components. |
| FMeshFluxProceduralTangent | Struct | Tangent input of the Procedural mesh type. |
| FMeshFluxDistanceField / FMeshFluxCardRepresentation | Struct | Distance-field and Lumen card data you supply. |
| FMeshFluxStaticMeshConversionOptions / FStreamSetStaticMeshConversionOptions | Struct | Options for the Static Mesh converter (LOD or LOD range, tangents, UVs, colors, poly groups, materials). |
| EMeshFluxSectionDrawType | Enum | Static or Dynamic buffer allocation. |
| EMeshFluxSimpleStreamConfig / EMeshFluxSimpleStreamType | Enum | Builder layout options and Blueprint stream element types. |
| EMeshFluxStreamType | Enum | Vertex or index stream. |
| EMeshFluxProxyUpdateStatus | Enum | Result 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
| Symbol | Type | Description |
| TMeshFluxBuilderLocal | Class | Templated mesh builder: AddVertex(...).SetNormalAndTangent(...).SetColor(...).SetTexCoord(...), AddTriangle(A, B, C, PolyGroup). |
| TMeshFluxStreamBuilder | Class | Typed array view over one stream. |
| FMeshFluxDynamicBuilder | Class | Non-templated builder whose layout is chosen at runtime. |
| ProcessMesh / ProcessBufferSet | Callable | Read a buffer set's data under the mesh lock without copying. |
| IMeshFluxSimple_V1 | Class | Self-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
| Variable | Default | Description |
| r.RayTracing.Geometry.MeshFlux | 1 | Include MeshFlux meshes in ray tracing. |
| r.MeshFlux.ShowNormals | 0 | Draw vertex normals. |
| r.MeshFlux.ShowTangents | 0 | Draw vertex tangents. |
| r.MeshFlux.ShowBinormals | 0 | Draw vertex binormals. |
| r.MeshFlux.ShowVertexColors | 0 | Show vertex colors. |
| r.MeshFlux.DebugLineLength | 5.0 | Length of the debug lines. |
| MeshFlux.InPlaceUpdate.Enabled | 1 | Use the in-place GPU update path for Dynamic buffer sets (0 forces full updates). |
| MeshFlux.StreamPool.MaxPoolSize | 256 | Maximum pooled streams. |
| MeshFlux.StreamSetPool.MaxPoolSize | 64 | Maximum pooled stream sets. |
| MeshFlux.Builder.MaxPoolSize | 16 | Maximum 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.
| Actor | Type | Shows |
| AMeshFluxExample_Simple_HelloTriangle | Class | One two-sided triangle with the mesh builder; the minimal path. |
| AMeshFluxExample_Simple_ComponentSetup | Class | Adding a MeshFlux component to a plain actor. |
| AMeshFluxExample_Simple_StreamBuilders | Class | Building with per-stream builders. |
| AMeshFluxExample_Simple_MultipleUVs | Class | Two UV channels. |
| AMeshFluxExample_Simple_VertexColors | Class | Four ways to author vertex colors. |
| AMeshFluxExample_Simple_BasicShapes | Class | Boxes from the basic shape tools. |
| AMeshFluxExample_Simple_MultipleSections | Class | Several sections and materials in one buffer set via poly groups. |
| AMeshFluxExample_Simple_LODs | Class | Four LODs with screen sizes. |
| AMeshFluxExample_Simple_Collision | Class | Simple box collision and complex-as-simple collision. |
| AMeshFluxExample_Simple_HighPoly | Class | Subdivided sphere with 32-bit indices. |
| AMeshFluxExample_Simple_DynamicUpdate | Class | Grid rebuilt every frame with UpdateBufferSet. |
| AMeshFluxExample_Simple_FastUpdate | Class | Same animation with in-place updates (full grid or a ranged middle band). |
| AMeshFluxExample_Simple_AsyncBuild | Class | Generation on a worker thread, commit on the game thread. |
| AMeshFluxExample_Simple_ComputeIndirect | Class | GPU-driven indirect draw arguments (needs a real GPU). |
| AMeshFluxExample_Procedural_Basic | Class | A box through Create Mesh Section. |
| AMeshFluxExample_Procedural_Update | Class | A grid animated with Update Mesh Section. |
Content
Example Blueprints in MeshFlux Content/Examples (all derive from MeshFluxActor and build their mesh in Blueprint).
| Asset | Type | Shows |
| BP_MeshFlux_HelloTriangle | Blueprint | The minimal mesh-builder graph (see Quick start). |
| BP_MeshFlux_ComponentSetup | Blueprint | Using the MeshFlux component variable directly with the mesh builder. |
| BP_MeshFlux_StreamBuilders | Blueprint | Building with Make Stream and Add Stream instead of the mesh builder. |
| BP_MeshFlux_MultipleUVs | Blueprint | A mesh builder with more than one UV channel. |
| BP_MeshFlux_VertexColors | Blueprint | Per-vertex colors with the mesh builder. |
| BP_MeshFlux_BasicShapes | Blueprint | Append Box Mesh into a stream set. |
| BP_MeshFlux_MultipleSections | Blueprint | Poly groups, sections and material slots. |
| BP_MeshFlux_LODs | Blueprint | Add LOD and Update LOD Config with one box per LOD. |
| BP_MeshFlux_Collision | Blueprint | SetCollisionConfig and SetSimpleGeometry with a box shape. |
| BP_MeshFlux_DynamicUpdate | Blueprint | Edit 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
| Symptom | Cause and fix |
| Nothing renders after CreateBufferSet | Check 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 visible | Enable Show Plugin Content in the Content Browser settings and look in MeshFlux Content/Examples. |
| Simulated physics does not work on the mesh | Complex (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 false | Enable Project Settings > Physics > Support UV From Hit Results. |
| Copying from a Static Mesh fails in a packaged game | Reading 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 mesh | The 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 multiplayer | Geometry is not replicated. Build the mesh on every machine (construction script or BeginPlay); see Networking. |
| The ComputeIndirect example shows nothing | It needs a real GPU and does not work with -NullRHI. |