gsplat-optimizer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gaussian Splat Optimizer

Gaussian Splat 优化工具

Optimize 3D Gaussian Splatting scenes for real-time rendering on Apple platforms (iOS, macOS, visionOS) using Metal.
使用Metal优化Apple平台(iOS、macOS、visionOS)上3D Gaussian Splatting场景的实时渲染。

When to Use

适用场景

  • Optimizing
    .ply
    or
    .splat
    files for mobile/Apple GPU targets
  • Reducing gaussian count for performance (pruning strategies)
  • Implementing Level-of-Detail (LOD) for large scenes
  • Compressing splat data for bandwidth/storage constraints
  • Profiling and optimizing Metal rendering performance
  • Targeting specific FPS goals on Apple hardware
  • 针对移动/Apple GPU目标优化
    .ply
    .splat
    文件
  • 为提升性能减少高斯数量(剪枝策略)
  • 为大型场景实现Level-of-Detail (LOD)
  • 在带宽/存储受限情况下压缩splat数据
  • 分析并优化Metal渲染性能
  • 在Apple硬件上达成特定FPS目标

Quick Start

快速开始

Input: Provide a
.ply
/
.splat
file path, target device class, and FPS target.
bash
undefined
输入:提供
.ply
/
.splat
文件路径、目标设备类别和FPS目标。
bash
undefined

Analyze a splat file

Analyze a splat file

python ~/.claude/skills/gsplat-optimizer/scripts/analyze_splat.py scene.ply --device iphone --fps 60

**Output**: The skill provides:
1. Point/gaussian pruning plan (opacity, size, error thresholds)
2. LOD scheme suggestion (distance bins, gaussian subsets)
3. Compression recommendation (if bandwidth/storage bound)
4. Metal profiling checklist with shader/compute tips
python ~/.claude/skills/gsplat-optimizer/scripts/analyze_splat.py scene.ply --device iphone --fps 60

**输出**:本工具提供以下内容:
1. 点/高斯剪枝方案(透明度、尺寸、误差阈值)
2. LOD方案建议(距离区间、高斯子集)
3. 压缩建议(若带宽/存储受限)
4. 包含着色器/计算技巧的Metal性能分析清单

Optimization Workflow

优化工作流

Step 1: Analyze the Scene

步骤1:分析场景

First, understand your scene characteristics:
  • Gaussian count: Total number of splats
  • Opacity distribution: Histogram of opacity values
  • Size distribution: Gaussian scale statistics
  • Memory footprint: Estimated GPU memory usage
首先,了解场景的特征:
  • 高斯数量:splat的总数
  • 透明度分布:透明度值的直方图
  • 尺寸分布:高斯尺度统计数据
  • 内存占用:预估GPU内存使用量

Step 2: Determine Target Device

步骤2:确定目标设备

Device ClassGPU BudgetMax Gaussians (60fps)Storage Mode
iPhone (A15+)4-6GB unified~2-4MShared
iPad Pro (M1+)8-16GB unified~6-8MShared
Mac (M1-M3)8-24GB unified~8-12MShared/Managed
Vision Pro16GB unified~4-6M (stereo)Shared
Mac (discrete GPU)8-24GB VRAM~10-15MPrivate
设备类别GPU预算最大高斯数量(60fps)存储模式
iPhone (A15+)4-6GB unified~2-4MShared
iPad Pro (M1+)8-16GB unified~6-8MShared
Mac (M1-M3)8-24GB unified~8-12MShared/Managed
Vision Pro16GB unified~4-6M (stereo)Shared
Mac (discrete GPU)8-24GB VRAM~10-15MPrivate

Step 3: Apply Pruning

步骤3:应用剪枝策略

If gaussian count exceeds device budget:
  1. Opacity threshold: Remove gaussians with opacity < 0.01-0.05
  2. Size culling: Remove sub-pixel gaussians (< 1px at target resolution)
  3. Importance pruning: Use LODGE algorithm for error-proxy selection
  4. Foveated rendering: For Vision Pro, reduce density in peripheral view
See references/pruning-strategies.md for details.
若高斯数量超出设备预算:
  1. 透明度阈值:移除透明度<0.01-0.05的高斯
  2. 尺寸剔除:移除亚像素高斯(目标分辨率下<1px)
  3. 重要性剪枝:使用LODGE算法进行误差代理选择
  4. 注视点渲染:针对Vision Pro,降低外围视野的高斯密度
详情请参阅references/pruning-strategies.md

Step 4: Implement LOD (Large Scenes)

步骤4:实现LOD(大型场景)

For scenes exceeding single-frame budget:
  1. Distance bins: Near (0-10m), Mid (10-50m), Far (50m+)
  2. Hierarchical structure: Octree or LoD tree for spatial queries
  3. Chunk streaming: Load/unload based on camera position
  4. Smooth transitions: Opacity blending at chunk boundaries
See references/lod-schemes.md for details.
针对超出单帧预算的场景:
  1. 距离区间:近距(0-10米)、中距(10-50米)、远距(50米以上)
  2. 层级结构:使用八叉树或LOD树进行空间查询
  3. 分块流加载:根据相机位置加载/卸载
  4. 平滑过渡:在分块边界处进行透明度混合
详情请参阅references/lod-schemes.md

Step 5: Apply Compression (If Needed)

步骤5:应用压缩(如有需要)

For bandwidth/storage constraints:
MethodCompressionUse Case
SOGS20xWeb delivery, moderate quality
SOG24xWeb delivery, better quality
CodecGS30x+Maximum compression
C3DGS31xFast rendering priority
See references/compression.md for details.
针对带宽/存储受限的情况:
压缩方法压缩比适用场景
SOGS20xWeb分发、中等质量
SOG24xWeb分发、更高质量
CodecGS30x+最大压缩比
C3DGS31x优先考虑快速渲染
详情请参阅references/compression.md

Step 6: Profile and Optimize Metal

步骤6:分析并优化Metal性能

  1. Choose storage mode: Private for static data, Shared for dynamic
  2. Optimize shaders: Function constants, thread occupancy
  3. Profile with Xcode: GPU Frame Capture, Metal System Trace
  4. Iterate: Measure, optimize, repeat
See references/metal-profiling.md for details.
  1. 选择存储模式:静态数据使用Private模式,动态数据使用Shared模式
  2. 优化着色器:使用函数常量、优化线程占用率
  3. 使用Xcode分析:GPU帧捕获、Metal系统追踪
  4. 迭代优化:测量、优化、重复
详情请参阅references/metal-profiling.md

Key Metrics

关键指标

MetricTargetHow to Measure
Frame time16.6ms (60fps)Metal System Trace
GPU memory< device budgetXcode Memory Graph
Bandwidth< 50GB/sGPU Counters
Shader time< 10msGPU Frame Capture
指标目标值测量方式
Frame time16.6ms (60fps)Metal System Trace
GPU memory< device budgetXcode Memory Graph
Bandwidth< 50GB/sGPU Counters
Shader time< 10msGPU Frame Capture

Reference Implementation

参考实现

MetalSplatter is the primary reference for Swift/Metal gaussian splatting:
MetalSplatter是Swift/Metal高斯泼溅渲染的主要参考实现:

Getting Started with MetalSplatter

MetalSplatter 快速开始

bash
git clone https://github.com/scier/MetalSplatter.git
cd MetalSplatter
open SampleApp/MetalSplatter_SampleApp.xcodeproj
bash
git clone https://github.com/scier/MetalSplatter.git
cd MetalSplatter
open SampleApp/MetalSplatter_SampleApp.xcodeproj

Set to Release scheme for best performance

切换至Release模式以获得最佳性能

undefined
undefined

Resources

资源

Reference Documentation

参考文档

  • Pruning Strategies - Gaussian reduction techniques
  • LOD Schemes - Level-of-detail approaches
  • Compression - Bandwidth/storage optimization
  • Metal Profiling - Apple GPU optimization
  • 剪枝策略 - 高斯数量减少技术
  • LOD方案 - 细节层次实现方法
  • 压缩技术 - 带宽/存储优化
  • Metal性能分析 - Apple GPU优化

Research Papers

研究论文

Apple Developer Resources

Apple开发者资源