Files
nexus/wiki/concepts/ProceduralContentGeneration.md
2026-05-03 05:42:12 +08:00

54 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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
PCGProcedural 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.02.0
- `MinForestSeparation`: 1.08.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]]