54 lines
2.2 KiB
Markdown
54 lines
2.2 KiB
Markdown
---
|
||
title: "ProceduralContentGeneration"
|
||
type: concept
|
||
tags: ["unreal-engine", "procedural", "environment", "pcg"]
|
||
sources: ["unreal-technical-artist", "unreal-world-builder"]
|
||
last_updated: 2026-04-30
|
||
---
|
||
|
||
## Aliases
|
||
- PCG
|
||
- Procedural Content Generation
|
||
- UE5 PCG
|
||
- Procedural Foliage Tool
|
||
|
||
## Definition
|
||
PCG(Procedural Content Generation,程序化内容生成)是 UE5 中通过图形化节点系统自动生成大规模环境资产(植被、岩石、碎片等)的系统。通过采样表面、随机化和几何约束,在运行时或预烘焙模式下批量放置资产。
|
||
|
||
## PCG vs Foliage Tool 选型原则
|
||
| 场景 | 工具选择 |
|
||
|------|---------|
|
||
| 手绘英雄资产放置 | Foliage Tool(传统) |
|
||
| 大规模植被(1000+ 实例) | PCG + Nanite 预烘焙 |
|
||
| Runtime 生成(小区域 < 1km²) | PCG Runtime |
|
||
| 大面积开放世界(> 1km²) | PCG 预烘焙(流式兼容) |
|
||
|
||
## PCG Graph 标准结构(以 Forest Population 为例)
|
||
1. **Surface Sampler**:在 World Partition 表面采样点
|
||
2. **Attribute Filter**:按 biome mask 密度纹理过滤
|
||
3. **Exclusion**:道路(8m buffer)、路径(4m)、水体(2m)、建筑(15m sphere)
|
||
4. **Poisson Disk Distribution**:最小间距防止聚集
|
||
5. **Randomization**:旋转(Yaw 0-360°)和缩放(0.85-1.25x)
|
||
6. **Weighted Mesh Assignment**:按权重分配网格类型(如 40% Oak, 30% Pine, 20% Birch)
|
||
7. **Culling**:Nanite 资产 cull 80,000cm,非 Nanite cull 30,000cm
|
||
|
||
## PCG Exposed Parameters(设计师调优旋钮)
|
||
- `GlobalDensityMultiplier`: 0.0–2.0
|
||
- `MinForestSeparation`: 1.0–8.0m
|
||
- `RoadExclusionEnabled`: bool
|
||
|
||
## Performance Constraints
|
||
- 所有 PCG 放置资产应在条件允许时启用 Nanite
|
||
- 大面积(> 1km²)使用预烘焙输出以兼容流式加载
|
||
- Runtime PCG 仅限小区域,生成须在 3 秒内完成
|
||
|
||
## Connections
|
||
- [[UnrealWorldBuilder]] ← 植被放置 ← ProceduralContentGeneration
|
||
- [[UnrealEngine5]] ← 运行环境 ← ProceduralContentGeneration
|
||
- [[Nanite]] ← 几何支持 ← ProceduralContentGeneration
|
||
- [[WorldPartition]] ← 空间管理 ← ProceduralContentGeneration
|
||
|
||
## Sources
|
||
- [[unreal-technical-artist]]
|
||
- [[unreal-world-builder]]
|