Update nexus wiki content

This commit is contained in:
2026-05-03 05:42:06 +08:00
parent 90f3811b83
commit 111bc65b7b
707 changed files with 32306 additions and 7289 deletions

View File

@@ -1,40 +1,48 @@
---
title: "Large World Coordinates"
title: "LargeWorldCoordinates"
type: concept
tags: ["unreal-engine", "coordinate-system", "precision", "ue5", "open-world"]
tags: ["unreal-engine", "coordinates", "precision", "open-world"]
sources: ["unreal-world-builder"]
last_updated: 2026-04-26
last_updated: 2026-04-30
---
## Aliases
- LWC
- Large World Coordinates
- 大世界坐标
- 双精度坐标
## Definition
Large World CoordinatesLWCUE5 双精度坐标系统,通过在引擎层面使用 double64 位浮点)替代 float32 位浮点)存储世界位置坐标,解决超大世界(>2km远距离处的浮点精度误差问题
Large World CoordinatesLWC是 Unreal Engine 5 引入的双精度double坐标系统用于解决超大世界任何轴超过 2km中的浮点精度问题。无 LWC 时,约 20km 处开始出现可见的浮点精度误。
## The Precision Problem
- 单精度浮点float距离原点约 20km 处开始出现可见精度误差
- 误差表现抖动Jitter、接缝Seam、几何体重影Ghosting
- 开放世界项目4km² ~ 64km²极易触碰到此阈值
## Precision Problem
IEEE 754 单精度浮点float以下场景产生精度损失:
- **大数值**:坐标值越大,相邻值之间的 gap 越大
- **远距离相加**:大坐标值与小数值的加法丢失精度
- **累积误差**:多次变换后误差累积
## When LWC is Required
- **任何轴超过 2km 的世界必须启用 LWC**
- 测试方法:在距离原点 100km 处生成玩家,验证无视觉或物理瑕疵
## LWC Enabling Threshold
- **强制启用**:世界任何轴超过 2km
- **精度损失临界点**~20km无 LWC 时可见)
- **最大安全范围**:建议 100km 以内(即使启用 LWC
## LWC Compatibility Requirements
### Shader/Material
- 替换所有直接 world position 采样为 `LWCToFloat()` 函数
- 否则可能导致远处的材质出现视觉错误
## Code Changes Required
| 位置 | float → double 替代 |
|------|-------------------|
| 游戏性代码(位置计算) | `FVector``FVector3d` |
| 着色器/材质 | 直接世界位置采样 → `LWCToFloat()` 转换 |
| 网络复制 | 仍用单精度(本地双精度,复制时转换) |
### Gameplay Code
- 世界位置使用 `FVector3d`(双精度)而非 `FVector`(单精度)
- 特别是在处理坐标计算、Actor 放置、寻路等逻辑时
## LWC Compliance Audit
迁移到 LWC 时必须审查:
- [ ] 所有着色器和材质使用 `LWCToFloat()` 而非直接世界位置采样
- [ ] 游戏中所有位置计算使用 `FVector3d`
- [ ] 在 100km 以外spawn玩家并验证无视觉/物理瑕疵
### Asset Pipeline
- 检查第三方 DDCDerived Data Cache资产是否正确配置 LWC
- 某些旧资产导入流程可能未处理双精度坐标
## Connections
- [[UnrealWorldBuilder]] ← 坐标系统 ← LargeWorldCoordinates
- [[UnrealEngine5]] ← 核心引擎 ← LargeWorldCoordinates
- [[WorldPartition]] ← 空间管理 ← LargeWorldCoordinates
## Relationship to World Partition
LWC 与 World Partition 协同World Partition 管理大世界的分区流送LWC 解决大世界的坐标精度问题,两者共同支撑 UE5 开放世界技术栈。
## Related
- [[UnrealWorldBuilder]] — LWC 配置与审计专家
- [[WorldPartition]] — LWC 的配套分区管理框架
- [[Nanite]] — Nanite 虚拟几何体在大世界中的使用不受 LWC 影响Nanite 内部使用相对坐标)
## Sources
- [[unreal-world-builder]]