# Nanite Foliage & Procedural Vegetation Editor

> **Category:** guide · **Engine:** Unreal Engine · **Related:** [G9 Rendering — Nanite & Lumen](G9_rendering_nanite_lumen.md), [G16 PCG Framework](G16_pcg_framework.md), [G18 Material System & Shaders](G18_material_system_shaders.md), [G36 Substrate Material System](G36_substrate_material_system.md)

Unreal Engine 5.7 introduces **Nanite Foliage** (Experimental) — a geometry rendering system purpose-built for dense, animated vegetation — and the **Procedural Vegetation Editor (PVE)**, a graph-based tool for authoring and customizing tree and plant assets entirely inside the engine. Together they enable teams to create foliage-heavy environments that render at 60 fps on current-gen hardware without hand-authored LODs.

---

## Nanite Foliage Overview (UE 5.7 — Experimental)

Nanite Foliage is composed of three linked subsystems that extend the core Nanite virtualized micro-polygon renderer to handle the unique demands of vegetation:

### Nanite Assemblies

Assemblies provide a variation and instancing layer for foliage meshes. Rather than placing unique Static Meshes per tree, you define an **Assembly** that describes how component parts (trunk, branches, leaf clusters) combine. The engine instances and randomizes these parts at placement time, producing high visual variety at low memory cost.

```
Key concepts:
- Assembly Definition asset — declares component slots + randomization rules
- Component Mesh — individual mesh piece (branch segment, leaf cluster)
- Variation Seed — per-instance seed driving random selection
```

### Nanite Skinning

Skinning brings skeletal deformation to Nanite-rendered meshes. This is how foliage bends and sways in wind without leaving the Nanite pipeline:

- A lightweight skeleton is assigned to the Nanite mesh (typically 4–12 bones for a tree).
- Wind animation is driven by the engine's wind system or custom Animation Blueprints.
- Deformation is computed on the GPU, keeping the Nanite draw path intact.
- Vertex count is irrelevant to animation cost — bone count and instance count matter.

### Nanite Voxel

The Voxel system solves the classic foliage LOD problem — millions of tiny, overlapping elements (pine needles, leaf clusters, ground cover) that break down at distance with traditional mesh LODs:

- Automatically converts fine-detail geometry into a volumetric voxel representation at distance.
- No cross-fades, popping, or manual LOD authoring required.
- Canopy, needles, and dense ground clutter render as a solid mass at stable frame rates.

---

## Procedural Vegetation Editor (PVE) — UE 5.7 Experimental

The PVE is a **PCG-based node-graph tool** for creating and customizing procedural 3D trees inside Unreal Engine. In its initial release it is primarily intended for **customizing existing assets** — specifically the free Quixel Megaplants on Fab — rather than building trees from scratch.

### Node Graph Architecture

The PVE organizes its nodes into six color-coded categories:

| Category | Purpose |
|----------|---------|
| **Preset Loader** | Defines the tree's base skeleton data — primary branch positioning, count, and curvature |
| **Growth** | Controls branch generation rules — length, angle, density, recursive depth |
| **Carve** | Prunes geometry — trim branches by elevation, radius, or manual selection |
| **Leaf** | Assigns leaf cluster meshes, density, and distribution along branches |
| **Mesh Output** | Configures final mesh generation — Nanite skeletal assembly output, material assignment |
| **Utility** | Debug visualization, random seed control, parameter exposure |

### Typical Workflow

```
1. Import a Megaplants preset via the Preset Loader node.
2. Adjust Growth parameters (branch density, droop angle, trunk taper).
3. Use Carve to prune lower branches or shape the crown.
4. Configure Leaf nodes for density and clustering.
5. Output as a Nanite Skeletal Assembly for placement in the level.
```

### Integration with PCG

Because PVE is built on the PCG framework (now **Production-Ready** in UE 5.7), vegetation assets generated by PVE can be scattered and managed by PCG graphs. This enables world-scale procedural forests where each tree instance is itself procedurally varied.

---

## Quixel Megaplants

UE 5.7 ships alongside **Quixel Megaplants** — a free asset pack on Fab designed as PVE source material:

- High-quality scanned tree species (oak, birch, pine, tropical palms, etc.).
- Pre-configured PVE presets for each species.
- Optimized for Nanite Foliage output (skeletal assemblies, wind-ready skeletons).
- Download directly into your Content Browser from the Fab marketplace.

---

## Performance Considerations

### What Nanite Foliage Handles Well

- Dense canopy and ground cover rendering (millions of polygons).
- Eliminating LOD pop-in and manual LOD authoring.
- GPU-driven animation via Nanite Skinning.

### Current Limitations (Experimental — UE 5.7)

- **Physics & Collision:** Incomplete support — validate interaction with Chaos physics on your target scenarios.
- **Wind Animation:** Functional but may have edge cases with complex wind fields.
- **Mobile:** Not supported — Nanite Foliage targets current-gen consoles and PC.
- **Shadow Quality:** Virtual Shadow Maps are recommended; verify shadow behavior on dense foliage.
- **Memory:** Assemblies reduce memory vs. unique meshes, but very large forests still require profiling.

### Profiling Tips

```cpp
// Console commands for Nanite Foliage diagnostics
stat NaniteAssembly     // Assembly instance counts, memory
stat NaniteSkinning     // Skinned mesh GPU cost
stat NaniteVoxel        // Voxel conversion stats, draw calls

// Unreal Insights markers
TRACE_CPUPROFILER_EVENT_SCOPE(NaniteFoliage_AssemblyBuild);
```

Use **Unreal Insights** and the **GPU Visualizer** (`ProfileGPU`) to identify whether your bottleneck is in assembly instancing, skinning, or voxel conversion.

---

## Project Setup

### Enabling Nanite Foliage

1. Open **Edit → Plugins** and enable **Nanite Foliage** (Experimental).
2. Enable the **Procedural Vegetation Editor** plugin if you want PVE.
3. Ensure **Nanite** is enabled in **Project Settings → Rendering → Nanite**.
4. Enable **Virtual Shadow Maps** (recommended for best shadow quality with Nanite).
5. Restart the editor.

### Recommended Project Settings

```ini
; DefaultEngine.ini
[/Script/Engine.RendererSettings]
r.Nanite=1
r.VirtualShadowMaps=1
r.NaniteFoliage.Enable=1
```

---

## Best Practices

1. **Start with Megaplants presets** — customize via PVE rather than building from scratch in the initial Experimental release.
2. **Profile early on target hardware** — Nanite Foliage is designed for 60 fps on current-gen, but dense scenes need validation.
3. **Use PCG for placement** — combine PVE-generated assemblies with PCG scatter graphs for world-scale forests.
4. **Keep skeleton bone counts low** (4–12 per tree) to minimize skinning overhead across thousands of instances.
5. **Test physics interactions** separately — collision support is incomplete in the Experimental release.
6. **Pair with Substrate materials** (Production-Ready in UE 5.7) for physically accurate leaf shading and subsurface scattering.

---

## Version History

| Version | Status | Notes |
|---------|--------|-------|
| UE 5.7 | Experimental | Initial release — Nanite Assemblies, Skinning, Voxel; PVE plugin; Megaplants integration |

---

## Further Reading

- [UE 5.7 Release Notes — Nanite Foliage](https://www.unrealengine.com/en-US/news/unreal-engine-5-7-is-now-available)
- [Procedural Vegetation Editor Documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/procedural-vegetation-editor-pve-in-unreal-engine)
- [G9 Rendering — Nanite & Lumen](G9_rendering_nanite_lumen.md) — Core Nanite architecture
- [G16 PCG Framework](G16_pcg_framework.md) — Procedural Content Generation (Production-Ready in UE 5.7)
