PolyTerrain materials and bake
The MPD owns materials, channels, layers, and build variants. Bake turns Base + modifiers into compiled section and weight assets through one evaluator plus the Transformer Pipeline.
MPD four sections
Asset: .polypartitiondefinition (naming tip: MPD_<Name>).
Material
| Setting | Purpose |
|---|---|
| Material hint | Atom material for preview / compiled display (e.g. PolyPartitionSplat) |
| Channel texel size | World meters per weight texel (smaller = finer) |
| Weight channels | Name, format (typically R8), bake-to-runtime, debug color |
| Physical material channels | Weight channel → PhysX material mapping |
| Default physical material | Fallback when no positive weight wins |
Undeclared channels can be painted in the editor but are not baked to runtime textures. Display splat supports up to 16 packed channels (four RGBA planes); more than 16 needs a custom material consuming the slice-array path.
Default gem material: Gems/PolyTerrain/Assets/Materials/PolyTerrain/PolyPartitionSplat_Default.material. Material Canvas nodes under PolyTerrain include Channel Sample, Channel Inspector, and Sample Vt * helpers.
Modifiers
Ordered Priority Layer names (index 0 evaluates first) and a default sub-priority step (e.g. 10) for insertions.
Build
| Setting | Purpose |
|---|---|
| Variants | Named compiled configs (e.g. HighEnd / LowEnd) with optional platform maps |
| Transformer Pipeline | Ordered stages after evaluation (asset or embedded) |
Preview
Max section complexity (vertex budget for Preview / Refine refusal) and optional lighter preview pipeline.
MPD hot-reload clears preview caches and dirties all sections. Optional partition Auto build on save runs incremental bake on level save.
Transformer Pipeline stages
Typical compiled order:
Evaluated mesh + weights
→ StaticMesh (LOD chain)
→ Subsection (optional split)
→ Skirt (border walls / seam cover)
→ Collision (triangle / convex)
→ FarField (HLOD proxy)
→ WS Actor Properties (streaming metadata)
→ VT (optional metadata / write hints)
| Stage | Preview | Compiled | Notes |
|---|---|---|---|
| StaticMesh | yes | yes | LOD count from lodDistances; border verts locked when simplifying |
| Subsection | optional | yes | Can respect Subsection Hint AABBs |
| Skirt | yes | yes | Covers Refine / density seams; optional thickness |
| Collision | simplified | yes | Triangle budget, dominant-channel or per-chunk material blend, optional convex hulls |
| FarField | no | yes | Coarse mesh for World Streaming HLOD |
| WS properties | no | yes | Cell / layer metadata for PrefabProcessor |
| VT | metadata | yes | Hints consumed when VtEnabled |
LOD distance ladder: when distances are a strict ascending ladder, runtime can pin LOD by camera distance; otherwise Atom screen-coverage selection applies.
Bake path
1 Build Compiled Sections (editor)
→ export .polypartition (skip write if bytes unchanged)
2 PolyPartitionBuilder (AssetProcessor)
→ evaluate full stack + pipeline
→ .polypartitionsection + .polypartitionweights
3 PolyPartitionPrefabProcessor
→ inject runtime section (+ collision) entities
→ optional WorldStreamingMember (before WS processors)
| Flag | Behavior |
|---|---|
Incremental true | Skip source rewrite when snapshot matches disk; AP still driven by product needs |
Incremental false | Force export |
ContentHash includes Base, modifier params, MPD material/channel/physics settings, and hash-sensitive Transformer fields. Changing only Preview-only UI state does not invalidate bake.
Physics materials from weights
- Dominant channel: per-triangle material index at cook time.
- Per-chunk blend: optional chunk size on Collision Transformer; runtime can reblend friction when weight rewrite is on.
- Convex hulls: optional V-HACD path; per-hull materials can follow rewrite when
CollisionConvexReweightEnabledis on.
See Optional features for runtime weight rewrite gates.
Checklist before Play
- MPD layers and channels match modifier / paint names.
- Build variant includes StaticMesh + Collision (and Skirt for multi-section).
- AssetProcessor finished without builder errors.
- PrefabProcessor expanded runtime entities (or you placed Runtime Section components manually).
- For WS levels, section entities are in the expected cells (Focus Load WS Cells helps in editor).