生成流式 SOG
流式 SOG 支持大型场景高效加载。splat-transform 将逐级减少单元的 LOD 组织为空间树,0 最精细,数字越大越粗。
引擎加载渲染见 LOD 指南。
获取层级
两种方式:
- 自有文件:训练生成或其他工具导出,各层独立文件。
- 简化单源:--decimate 从高质量数据统一比例减少;--decimate-adaptive 按局部误差,适合天空等混合尺度,但内存更高。
备注
简化必须是末操作且输出 PLY,因此先写各层,再第二次调用打包。分块流式简化可扩展到亿级,极深目标的中间层可能需 scratch-dir;未设置时不写磁盘,内存不够就报错。
输出名称要求
文件名决定格式,不能任意命名:
- lod-meta.json:流式,多块与空间树。
- meta.json:非打包单 SOG,不流式。
必须精确名称,只有目录可变,例如 output/lod-meta.json。
使用 tag-lod
-l / --tag-lod 放在对应输入后,流式输出每输入都需标记:
- n >= 0:细节层,0 最高。
- -1:环境,如天空远景,写 env/meta.json,由 environment 引用,不进入 LOD 分桶。
LCC/LCC2 已含层级和可选环境,无需显式标记。
备注
环境仅写入流式输出,其他格式忽略并警告丢弃。
示例
# Generate Streamed SOG format from multiple input files
# Each input file represents a different detail level (LOD 0 is highest quality)
splat-transform \
lod0.ply -l 0 \
lod1.ply -l 1 \
lod2.ply -l 2 \
lod3.ply -l 3 \
output/lod-meta.json \
--filter-nan \
--filter-harmonics 0
# Generate the lower-detail levels by decimating a single high-quality source
# Step 1: create progressively smaller versions of the source splat
splat-transform source.ply -d 50% lod1.ply
splat-transform source.ply -d 25% lod2.ply
splat-transform source.ply -d 10% lod3.ply
# (for mixed-scale content such as skies, use --decimate-adaptive instead of -d)
# Step 2: bundle the full-detail source and the decimated levels into Streamed SOG format
splat-transform \
source.ply -l 0 \
lod1.ply -l 1 \
lod2.ply -l 2 \
lod3.ply -l 3 \
output/lod-meta.json \
--filter-nan
# Include an environment (backdrop) splat alongside the LOD levels
splat-transform \
scene.ply -l 0 \
sky.ply --tag-lod -1 \
output/lod-meta.json
# Generate LOD with custom chunk settings for better performance
splat-transform \
--lod-chunk-count 1024 \
--lod-chunk-extent 32 \
lod0.ply -l 0 \
lod1.ply -l 1 \
lod2.ply -l 2 \
output/lod-meta.json \
--filter-nan
# Generate Streamed SOG format directly from an LCC or LCC2 file
# (these already contain multiple LOD levels)
splat-transform scene.lcc output/lod-meta.json
回读
可作输入,-L / --select-lod 选择层,--info 无转换检查结构:
# Extract the highest-detail level back to PLY
splat-transform scene/lod-meta.json --select-lod 0 lod0.ply
# Inspect format and per-LOD splat counts without writing anything
splat-transform scene/lod-meta.json --info null
建议
- --decimate/-d 生成层级,混合尺度用 adaptive。
- --filter-nan 去非法值。
- 颜色细节不重要时 --filter-harmonics 0 减体积。
- --lod-chunk-count 控制分块文件数量。
- --lod-chunk-extent 控节点范围,大场景增大,避免节点过多。
- --lod-chunk-min 避免天空远景分成大量空块,少于阈值(单位 K,默认 8)不按范围分割。
- --info 检查各层数量。