Skip to content
PRODUCT GITHUB  ↗

Examples

Every example is a self-contained C++ actor you can drop into a level and see rendering immediately (most build their mesh in OnConstruction). The Simple/Procedural/Dynamic/RealtimeMeshConstructedActor examples live in the RealtimeMeshExamples module; the Nanite examples live in the separate, editor-only RealtimeMeshNaniteExamples module. See Installation: Examples for where they live and how to make sure plugin content is visible.


The general-purpose, CPU-authored leaf type. Roughly beginner-to-advanced order:

  • ARealtimeMeshExample_Simple_HelloTriangle — the canonical first example: one two-sided triangle, built with TRealtimeMeshBuilderLocal and a single section group. Start here (see the Quickstart, which walks through this exact example).
  • ARealtimeMeshExample_Simple_ComponentSetup — wires up a URealtimeMeshComponent by hand on a plain AActor, for when you’re not subclassing ARealtimeMeshActor.
  • ARealtimeMeshExample_Simple_StreamBuilders — the same triangle, built with the lower-level per-stream TRealtimeMeshStreamBuilder instead of the all-in-one local builder.
  • ARealtimeMeshExample_Simple_MultipleUVs — the same triangle again, with two UV channels per vertex.
  • ARealtimeMeshExample_Simple_VertexColors — four ways to author per-vertex color: a rainbow grid, an RGB corner-colored box, a radial gradient disc, and a height-gradient cylinder.
  • ARealtimeMeshExample_Simple_BasicShapes — generates boxes with URealtimeMeshBasicShapeTools instead of hand-authoring vertices.
  • ARealtimeMeshExample_Simple_MultipleSections — multiple section groups and material slots, packing several boxes per group via poly groups — the idiomatic way to render one mesh with many materials.
  • ARealtimeMeshExample_Simple_LODs — multiple LODs, each a differently rotated/colored box, showing AddLOD and per-LOD screen-size configuration.
  • ARealtimeMeshExample_Simple_Collision — the two collision setups: an explicit simple box shape, and complex-as-simple collision that follows the rendered triangles.
  • ARealtimeMeshExample_Simple_HighPoly — a subdividable high-poly sphere using 32-bit indices, for stress-testing large buffers.
  • ARealtimeMeshExample_Simple_DynamicUpdate — a grid that ripples every tick by re-pushing a fresh StreamSet via UpdateBufferSet — the simplest “mesh that changes over time” pattern.
  • ARealtimeMeshExample_Simple_FastUpdate — the cheaper in-place update paths (EditMeshInPlace / EditMeshInPlaceRanged) on a Dynamic draw-type section group, including a partial (middle-band-only) update.
  • ARealtimeMeshExample_Simple_AsyncBuild — builds an expensive StreamSet on a worker thread and commits it on the game thread with DoOnAsyncThread + ContinueOnGameThread — the recommended pattern for heavy procedural geometry.
  • ARealtimeMeshExample_Simple_ObjLoad (new) — loads a mesh from an OBJ file at runtime.
  • ARealtimeMeshExample_Simple_StaticMeshConvert (new) — converts a UStaticMesh into a URealtimeMeshSimple at runtime, defaulting to the engine’s basic cube.
  • ARealtimeMeshExample_Simple_DistanceField — builds a box and asks the standalone RealtimeMeshSDF module for a dense signed distance field, visualizing a slice with debug draw.
  • ARealtimeMeshExample_Simple_LumenSupport (new) — applies a generated distance field and Lumen card representation to a mesh so it participates correctly in Lumen GI.
  • ARealtimeMeshExample_Simple_DistanceFieldProfile / ARealtimeMeshExample_Simple_CardProfile — profile the CPU/GPU signed-distance-field and Lumen card generators on a high-poly sphere and log timings.
  • ARealtimeMeshExample_Simple_ComputeIndirect / ARealtimeMeshExample_Simple_ComputeWave — GPU-driven indirect draw and per-frame compute-shader mesh mutation via RealtimeMeshCompute providers. Both require a real RHI (not testable under -NullRHI).

The ProceduralMeshComponent-parity leaf, for near-drop-in PMC migration:

  • ARealtimeMeshExample_Procedural_Basic — creates a box section the PMC way: parallel TArrays of positions/triangles/normals/UVs/colors via CreateMeshSection.
  • ARealtimeMeshExample_Procedural_Update — creates a grid section once, then animates only vertex positions every frame with UpdateMeshSection — the PMC-parity partial-update path.

The UDynamicMeshComponent-replacement leaf, backed by an owned FDynamicMesh3:

  • ARealtimeMeshExample_Dynamic_Basic — builds an FDynamicMesh3 with two triangle groups and hands it over with SetMesh; the converter turns each group into its own section/material slot.
  • ARealtimeMeshExample_Dynamic_Edit — edits the owned UDynamicMesh in place each frame using the fast vertex-update path (EditMesh with FastUpdate).
  • ARealtimeMeshConstructedActor — the data-driven provider/generator path: a URealtimeMeshConstructed whose geometry is produced on demand by a generator resolved from a config struct, with no CPU-side mesh storage.
  • ARealtimeMeshSpatialStreamingActor — end-to-end demo of the spatial streaming state machine (LOD/quadtree traversal) driving the provider/generator path, loading and unloading cells as the player moves.

Nanite (RealtimeMeshNaniteExamples module, editor-only)

Section titled “Nanite (RealtimeMeshNaniteExamples module, editor-only)”
  • ARealtimeMeshExample_Nanite_BasicRawData — the core pipeline from raw vertex/triangle arrays: CreateFromRawMesh → BuildMinimalHierarchy → BuildRealtimeNaniteMesh → SetNaniteResources, across a low-poly sphere, a high-poly torus, and a dense tessellated plane.
  • ARealtimeMeshExample_Nanite_ManualClusters — manually constructed Nanite clusters: a multi-cluster box (one cluster per face) and a single cluster with multiple material ranges.
  • ARealtimeMeshExample_Nanite_HierarchicalLODs — the BuildHierarchicalLODs + BuildLODAwareHierarchy pipeline on a dense UV sphere, logging the LOD pyramid; toggle against the single-LOD BuildMinimalHierarchy path for an A/B comparison.
  • ARealtimeMeshExample_Nanite_LODInspector — builds the full hierarchical-LOD pyramid for a sphere and lays out each LOD level side by side, for visually inspecting simplifier artifacts per level.
  • ARealtimeMeshExample_Nanite_FrequentUpdates — stress-tests frame-by-frame Nanite mesh updates at three frequencies: every frame, every 5 frames, and every 30 frames.
  • ARealtimeMeshExample_Nanite_PrebuiltData — copies prebuilt Nanite resources from a UStaticMesh asset directly onto a RealtimeMesh component, bypassing RMC’s own Nanite build pipeline, to isolate whether a rendering issue is in the component or the builder.

New to the plugin? Start with ARealtimeMeshExample_Simple_HelloTriangle and the Quickstart, then branch out by mesh type — see Mesh Types for the conceptual comparison between Simple, Procedural, Dynamic, and Constructed.