Logo: Ue Landscape And Foliage

Ue Landscape And Foliage

Communautéit
kevinpbuckley
ue-landscape-and-foliage

Terrain, instanced vegetation, and procedural environment generation in Unreal C++ — ALandscape / ALandscapeProxy / ULandscapeComponent (heightmap grid, material layers, edit layers, splines, Nanite landscape), UFoliageType / AInstancedFoliageActor / UHierarchicalInstancedStaticMeshComponent (HISM-backed instanced foliage, procedural foliage volumes), and the PCG framework (UPCGComponent / UPCGGraph, point data, landscape sampling, runtime generation). Use when creating or sculpting terrain, painting weight layers or foliage, adding landscape splines, batching vegetation with HISM, authoring PCG graphs, querying landscape data from C++, or debugging instancing and PCG generation issues.

Iwwersiicht

Editeurkevinpbuckley
Repositoryunreal-engine-skills
Skill-Nummue-landscape-and-foliage
Stären
89
Forks
9
Matgeliwwert Dateien
3
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    kevinpbuckley huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Ue Landscape And Foliage an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/kevinpbuckley/unreal-engine-skills/tree/master/skills/core/ue-landscape-and-foliage
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kevinpbuckley/unreal-engine-skills.git /tmp/unreal-engine-skills
mkdir -p .claude/skills
cp -r /tmp/unreal-engine-skills/skills/core/ue-landscape-and-foliage .claude/skills/ue-landscape-and-foliage
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Ue Landscape And Foliage an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Ue Landscape And Foliage automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Ue Landscape And Foliage net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Landscape & foliage

For automatic terrain shading, use ue-auto-landscape-materials. For runtime virtual textures and material-driven grass, use ue-landscape-rvt-and-grass.

Three complementary systems cover terrain and environment population:

SystemActor / ComponentPurpose
LandscapeALandscape → ULandscapeComponentHeightmap terrain with painted weight layers and splines
Foliage / HISMAInstancedFoliageActor → HISMHand-painted instanced vegetation at low draw-call cost
PCGUPCGComponent + UPCGGraphRule-based graph pipeline for procedural placement

When to use this skill

  • Creating, sculpting, or importing a heightmap landscape; tuning component/section sizes.
  • Authoring landscape materials with Layer Blend nodes and ULandscapeLayerInfoObjects.
  • Painting foliage (UFoliageType_InstancedStaticMesh) onto terrain or meshes; tuning density, culling, collision, and scalability.
  • Adding landscape splines (ALandscapeSplineActor) for roads/rivers/paths.
  • Enabling Nanite on a landscape (bEnableNanite).
  • Authoring or extending a PCG graph from C++ — subclassing UPCGSettings, querying UPCGData, calling Generate()/Cleanup() from code.
  • Debugging foliage not rendering, PCG not generating, landscape layer info missing.

Landscape

Class hierarchy

ALandscape extends ALandscapeProxy (which itself extends APartitionActor). The proxy holds the component grid, material, and dimension metadata. ALandscape is the authoritative root; large landscapes in World Partition spawn ALandscapeStreamingProxy instances to load per-region.

ALandscape : ALandscapeProxy : APartitionActor
                  └── TArray<ULandscapeComponent*> LandscapeComponents  (LandscapeProxy.h:682)
                  └── UMaterialInterface* LandscapeMaterial             (LandscapeProxy.h:604)
                  └── int32 ComponentSizeQuads                          (LandscapeProxy.h:924)
                  └── int32 SubsectionSizeQuads                         (LandscapeProxy.h:927)
                  └── int32 NumSubsections                              (LandscapeProxy.h:930)
                  └── bool  bEnableNanite                               (LandscapeProxy.h:491)

ULandscapeComponent (LandscapeComponent.h:431) extends UPrimitiveComponent — it is the renderable, collidable unit of terrain.

Heightmap dimensions

Landscape dimensions are not arbitrary. Each component contains NumSubsections × NumSubsections sections, each SubsectionSizeQuads quads wide. Total landscape quads in one axis is NumComponents × ComponentSizeQuads. The corresponding heightmap vertex count is (NumComponents × ComponentSizeQuads) + 1. Common valid size: 8129 × 8129 vertices (32 × 32 components, 4 sections/component, 63 quads/section). Heights are stored as 16-bit values mapping to ±256 m at default Z scale 100.

Material layers and ULandscapeLayerInfoObject

Each paintable weight layer requires a ULandscapeLayerInfoObject data asset (LandscapeLayerInfoObject.h:59) paired with a LandscapeLayerBlend node in the landscape material. Layer weights are stored per-component in weightmap textures.

cpp
// Reading landscape layer weight at runtime (C++ — editor or runtime with proper setup):
// ULandscapeInfo::GetLayerWeightAtLocation is the key query path.
// ULandscapeLayerInfoObject holds PhysicalMaterial and layer blend settings.

Edit Layers (LandscapeEditLayer.h) allow non-destructive stacking of sculpt/paint operations — each edit layer renders additively/subtractively into the final heightmap.

Landscape splines

ALandscapeSplineActor (LandscapeSplineActor.h:14) owns a ULandscapeSplinesComponent containing control points and segments. Splines deform terrain beneath them (raise/lower) and optionally spawn static meshes along their length as decoration or road surfaces.

Nanite landscape

Set bEnableNanite = true on the ALandscapeProxy to render the landscape as a Nanite mesh on supported platforms. The engine generates and maintains a ULandscapeNaniteComponent alongside the traditional LOD components. LOD settings under NaniteLODIndex control the source LOD used for Nanite mesh generation (default 0). See ue-nanite-and-rendering.

Foliage (instanced placement)

Class hierarchy

UFoliageType (abstract, UObject)              — FoliageType.h:105
  └── UFoliageType_InstancedStaticMesh        — FoliageType_InstancedStaticMesh.h:13
  └── UFoliageType_Actor                      — FoliageType_Actor.h
AInstancedFoliageActor : AISMPartitionActor   — InstancedFoliageActor.h:28
UHierarchicalInstancedStaticMeshComponent     — HierarchicalInstancedStaticMeshComponent.h:135
  (extends UInstancedStaticMeshComponent)

AInstancedFoliageActor stores a TMap<UFoliageType*, FFoliageInfo> and manages the underlying HISM instances. One AInstancedFoliageActor per world-partition cell holds all foliage painted in that cell.

UFoliageType key properties (FoliageType.h)

PropertyPurpose
DensityInstances per 1000 × 1000 UU area
RadiusMinimum spacing between instances
Scaling / ScaleX/Y/ZRandom scale ranges per axis
AlignToNormalTilt instance to match surface normal
GroundSlopeAngleValid placement slope range
LandscapeLayersRestrict painting to named weight layers
CullDistancePer-instance screen-size cull

HISM internals

UHierarchicalInstancedStaticMeshComponent builds a BVH cluster tree over its instances (ClusterTreePtr, FClusterNode). Rendering culls entire clusters with a single check. Adding/removing instances invalidates the tree; BuildTreeIfOutdated(bool Async, bool Force) triggers a rebuild (synchronous or async).

Key API (HierarchicalInstancedStaticMeshComponent.h):

  • AddInstance(Transform, bWorldSpace):303 — add one instance; returns index.
  • AddInstances(Transforms, bReturnIndices, bWorldSpace):304 — batch add.
  • RemoveInstance(Index):305 / RemoveInstances(Indices):306 — remove by index.
  • UpdateInstanceTransform(Index, NewTransform, bWorldSpace, bMarkDirty, bTeleport):308.
  • BuildTreeIfOutdated(Async, ForceUpdate):330 — explicit rebuild trigger.
cpp
// Batch-adding foliage instances from C++ (illustrative):
UHierarchicalInstancedStaticMeshComponent* HISM = NewObject<UHierarchicalInstancedStaticMeshComponent>(this);
HISM->SetStaticMesh(TreeMesh);
HISM->RegisterComponent();

TArray<FTransform> Transforms;
for (const FVector& Pos : SpawnPositions)
{
    FTransform T(FRotator(0, FMath::RandRange(0.f, 360.f), 0),
                 Pos,
                 FVector(FMath::RandRange(0.8f, 1.2f)));
    Transforms.Add(T);
}
HISM->AddInstances(Transforms, /*bShouldReturnIndices=*/false, /*bWorldSpace=*/true);
// Tree rebuilds async after the next tick; forcing sync:
HISM->BuildTreeIfOutdated(/*Async=*/false, /*ForceUpdate=*/true);

Procedural foliage volumes

UProceduralFoliageComponent (ProceduralFoliageComponent.h:42) is placed on a volume actor and references a UProceduralFoliageSpawner. The spawner holds an array of UFoliageType entries with competition rules (spread radius, priority). Simulation runs at cook/editor time and bakes instances into AInstancedFoliageActors.

PCG (Procedural Content Generation)

PCG is a shipped plugin at Engine/Plugins/PCG/. Enable it in .uproject if not present.

Core types

TypeHeaderRole
UPCGComponentPCGComponent.h:112Runs a graph on its actor; entry point for generate/cleanup
UPCGGraphPCGGraph.h:332Asset containing nodes and edges
UPCGGraphInterfacePCGGraph.h:159Abstract base for graphs and graph instances
UPCGDataPCGData.hBase for all spatial/attribute data flowing through the graph
UPCGPointDataData/PCGPointData.hPoint cloud — the primary per-instance data type
UPCGLandscapeDataData/PCGLandscapeData.hSamples landscape height/normals/layers

UPCGComponent lifecycle

Generate()      — schedules an async graph execution, result baked as managed resources
Cleanup()       — removes all managed resources (ISM components, spawned actors)
GenerateLocal() — local-only generate (not replicated); use in editor automation
CleanupLocal()  — local-only cleanup
NotifyPropertiesChangedFromBlueprint() — dirty + re-generate from Blueprint

GenerationTrigger (EPCGComponentGenerationTrigger: GenerateOnLoad, GenerateOnDemand, GenerateAtRuntime) controls when the graph runs automatically. Set bIsComponentPartitioned to distribute generation across World Partition cells via UPCGSubsystem.

Working with PCG from C++

To extend PCG, subclass UPCGSettings (defines node inputs/outputs/properties) and pair it with a UPCGElement subclass (Execute(FPCGContext*)). For runtime queries:

cpp
// Triggering PCG generation from gameplay code:
UPROPERTY(VisibleAnywhere)
TObjectPtr<UPCGComponent> PCGComp;

void AMyActor::BeginPlay()
{
    Super::BeginPlay();
    if (PCGComp)
    {
        // Force a fresh generation regardless of trigger type:
        PCGComp->Generate(/*bForce=*/true);
    }
}

// Listening to generation completion:
PCGComp->OnPCGGraphGeneratedExternal.AddDynamic(this, &AMyActor::OnPCGDone);

PCG landscape data (UPCGLandscapeData) exposes layer weights as point attributes when bGetLayerWeights = true (PCGLandscapeData.h). Filter points by attribute value in the graph to, for example, restrict scatter to slope ranges below a threshold.

Performance

  • Draw calls: foliage HISM merges thousands of instances into one draw call per cluster. Actor foliage (UFoliageType_Actor) costs one draw call per instance — avoid at scale.
  • Cull distance: set CullDistance (start + end) on each UFoliageType; far instances fade with PerInstanceFadeAmount in the material.
  • HISM tree rebuild: batching AddInstances is far cheaper than repeated AddInstance; prefer a single batch call then one BuildTreeIfOutdated.
  • Nanite foliage/rocks: Nanite eliminates LOD transitions on dense geometry; enable it on high-poly rocks and detailed meshes (see ue-nanite-and-rendering).
  • PCG generate cost: graph execution is async but can still spike on large volumes; trigger on load / pre-bake where possible; prefer GenerateOnLoad over GenerateAtRuntime for static content.
  • Landscape component count: aim for ≤ 1024 components; each has a render-thread CPU cost. Prefer fewer, larger components over many small ones.
  • World Partition streaming: landscape proxies stream by region; foliage uses a separate 256 m grid (configurable in Project Settings → Instanced Foliage Grid Size).

Gotchas

  • Invalid heightmap dimensions — landscape widths/heights must follow (N × ComponentQuads) + 1; arbitrary resolutions will be rejected or silently resized. Use the recommended size table (Landscape Technical Guide).
  • Missing layer info objects — painting a weight layer requires a ULandscapeLayerInfoObject asset assigned to the layer in the landscape material; without it the layer appears in the UI but cannot be painted.
  • Actor foliage at density — UFoliageType_Actor instances spawn one actor per instance, not an HISM; high density is a performance cliff. Use UFoliageType_InstancedStaticMesh unless you need per-instance Blueprint logic.
  • HISM tree stale after edit — AddInstance marks the tree dirty; until the async rebuild completes, the BVH is inconsistent; call BuildTreeIfOutdated(false, true) after bulk edits if you need it immediately.
  • Collision on all foliage — enabling complex collision on dense grass/foliage is extremely expensive; disable collision or use simple sphere/capsule only for interactive foliage.
  • PCG generate at runtime carelessly — calling Generate() mid-frame on a large volume can hitch; use the async path (GenerateLocal) and observe the delegate for completion.
  • Foliage in World Partition — foliage instances live in AInstancedFoliageActors that load per cell; painting across cell boundaries splits instances. Keep foliage within cells or use PCG for cross-cell content.
  • Nanite landscape + LOD materials — per-LOD material overrides (PerLODOverrideMaterials on ALandscapeProxy) do not apply to the Nanite mesh; use a single material that works at all distances.

Version notes

  • UFoliageType_InstancedStaticMesh.NaniteOverrideMaterials was added in UE5 for Nanite foliage support.
  • CleanupLocal(bool bRemoveComponents, bool bSave) was deprecated in 5.6; use the bRemoveComponents-only overload (PCGComponent.h:232).
  • UPCGComponent.GenerationTrigger = GenerateAtRuntime enables the runtime generation scheduler (new in 5.3+; scheduler policy expanded in 5.6/5.7).
  • Landscape Edit Layers are stable since UE5; the underlying renderer classes (ULandscapeEditLayerBase) are Engine/Editor-only and should not be referenced from runtime game code.

References & source material

Engine source (UE 5.8):

  • Runtime/Landscape/Classes/Landscape.h — ALandscape:276 (extends ALandscapeProxy).
  • Runtime/Landscape/Classes/LandscapeProxy.h — ALandscapeProxy:450, LandscapeComponents:682, LandscapeMaterial:604, ComponentSizeQuads:924, SubsectionSizeQuads:927, NumSubsections:930, bEnableNanite:491.
  • Runtime/Landscape/Classes/LandscapeComponent.h — ULandscapeComponent:431.
  • Runtime/Landscape/Classes/LandscapeLayerInfoObject.h — ULandscapeLayerInfoObject:59.
  • Runtime/Landscape/Classes/LandscapeSplineActor.h — ALandscapeSplineActor:14.
  • Runtime/Foliage/Public/FoliageType.h — UFoliageType:105.
  • Runtime/Foliage/Public/FoliageType_InstancedStaticMesh.h — UFoliageType_InstancedStaticMesh:13.
  • Runtime/Foliage/Public/InstancedFoliageActor.h — AInstancedFoliageActor:28.
  • Runtime/Foliage/Public/ProceduralFoliageComponent.h — UProceduralFoliageComponent:42.
  • Runtime/Engine/Classes/Components/HierarchicalInstancedStaticMeshComponent.h — UHierarchicalInstancedStaticMeshComponent:135, AddInstance:303, AddInstances:304, RemoveInstance:305, UpdateInstanceTransform:308, BuildTreeIfOutdated:330.
  • Plugins/PCG/Source/PCG/Public/PCGComponent.h — UPCGComponent:112, Generate():253, Cleanup():257, GenerateLocal():221, GenerationTrigger:327.
  • Plugins/PCG/Source/PCG/Public/PCGGraph.h — UPCGGraph:332, UPCGGraphInterface:159.
  • Plugins/PCG/Source/PCG/Public/Data/PCGLandscapeData.h — UPCGLandscapeData, FPCGLandscapeDataProps (layer weights, height-only mode, GPU sampling).
  • Plugins/PCG/Source/PCG/Public/Data/PCGPointData.h — UPCGPointData.

Official docs (UE 5.8):

Deep-dive references in this skill:

  • references/landscape.md — component/section math, material layer setup, edit layers, splines, Nanite landscape, runtime queries.
  • references/foliage-and-hism.md — HISM internals, foliage type hierarchy, procedural foliage volumes, scalability, World Partition foliage.
  • references/pcg.md — PCG graph authoring, element/settings subclassing, landscape data queries, runtime generation, partitioned generation.

Related skills: ue-meshes-static-and-skeletal, ue-levels-and-world-partition, ue-nanite-and-rendering.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Ue Landscape And Foliage?

Terrain, instanced vegetation, and procedural environment generation in Unreal C++ — ALandscape / ALandscapeProxy / ULandscapeComponent (heightmap grid, material layers, edit layers, splines, Nanite landscape), UFoliageType / AInstancedFoliageActor / UHierarchicalInstancedStaticMeshComponent (HISM-backed instanced foliage, procedural foliage volumes), and the PCG framework (UPCGComponent / UPCGGraph, point data, landscape sampling, runtime generation). Use when creating or sculpting terrain, painting weight layers or foliage, adding landscape splines, batching vegetation with HISM, authorin...

Firwat Ue Landscape And Foliage op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Ue Landscape And Foliage besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Ue Landscape And Foliage an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/kevinpbuckley/unreal-engine-skills/tree/master/skills/core/ue-landscape-and-foliage an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Ue Landscape And Foliage benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Ue Landscape And Foliage benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Ue Landscape And Foliage domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Ue Landscape And Foliage gratis?

kevinpbuckley huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇