gsplat-optimizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGaussian 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 or
.plyfiles for mobile/Apple GPU targets.splat - 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 / file path, target device class, and FPS target.
.ply.splatbash
undefined输入:提供/文件路径、目标设备类别和FPS目标。
.ply.splatbash
undefinedAnalyze 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 tipspython ~/.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 Class | GPU Budget | Max Gaussians (60fps) | Storage Mode |
|---|---|---|---|
| iPhone (A15+) | 4-6GB unified | ~2-4M | Shared |
| iPad Pro (M1+) | 8-16GB unified | ~6-8M | Shared |
| Mac (M1-M3) | 8-24GB unified | ~8-12M | Shared/Managed |
| Vision Pro | 16GB unified | ~4-6M (stereo) | Shared |
| Mac (discrete GPU) | 8-24GB VRAM | ~10-15M | Private |
| 设备类别 | GPU预算 | 最大高斯数量(60fps) | 存储模式 |
|---|---|---|---|
| iPhone (A15+) | 4-6GB unified | ~2-4M | Shared |
| iPad Pro (M1+) | 8-16GB unified | ~6-8M | Shared |
| Mac (M1-M3) | 8-24GB unified | ~8-12M | Shared/Managed |
| Vision Pro | 16GB unified | ~4-6M (stereo) | Shared |
| Mac (discrete GPU) | 8-24GB VRAM | ~10-15M | Private |
Step 3: Apply Pruning
步骤3:应用剪枝策略
If gaussian count exceeds device budget:
- Opacity threshold: Remove gaussians with opacity < 0.01-0.05
- Size culling: Remove sub-pixel gaussians (< 1px at target resolution)
- Importance pruning: Use LODGE algorithm for error-proxy selection
- Foveated rendering: For Vision Pro, reduce density in peripheral view
See references/pruning-strategies.md for details.
若高斯数量超出设备预算:
- 透明度阈值:移除透明度<0.01-0.05的高斯
- 尺寸剔除:移除亚像素高斯(目标分辨率下<1px)
- 重要性剪枝:使用LODGE算法进行误差代理选择
- 注视点渲染:针对Vision Pro,降低外围视野的高斯密度
详情请参阅references/pruning-strategies.md。
Step 4: Implement LOD (Large Scenes)
步骤4:实现LOD(大型场景)
For scenes exceeding single-frame budget:
- Distance bins: Near (0-10m), Mid (10-50m), Far (50m+)
- Hierarchical structure: Octree or LoD tree for spatial queries
- Chunk streaming: Load/unload based on camera position
- Smooth transitions: Opacity blending at chunk boundaries
See references/lod-schemes.md for details.
针对超出单帧预算的场景:
- 距离区间:近距(0-10米)、中距(10-50米)、远距(50米以上)
- 层级结构:使用八叉树或LOD树进行空间查询
- 分块流加载:根据相机位置加载/卸载
- 平滑过渡:在分块边界处进行透明度混合
详情请参阅references/lod-schemes.md。
Step 5: Apply Compression (If Needed)
步骤5:应用压缩(如有需要)
For bandwidth/storage constraints:
| Method | Compression | Use Case |
|---|---|---|
| SOGS | 20x | Web delivery, moderate quality |
| SOG | 24x | Web delivery, better quality |
| CodecGS | 30x+ | Maximum compression |
| C3DGS | 31x | Fast rendering priority |
See references/compression.md for details.
针对带宽/存储受限的情况:
| 压缩方法 | 压缩比 | 适用场景 |
|---|---|---|
| SOGS | 20x | Web分发、中等质量 |
| SOG | 24x | Web分发、更高质量 |
| CodecGS | 30x+ | 最大压缩比 |
| C3DGS | 31x | 优先考虑快速渲染 |
详情请参阅references/compression.md。
Step 6: Profile and Optimize Metal
步骤6:分析并优化Metal性能
- Choose storage mode: Private for static data, Shared for dynamic
- Optimize shaders: Function constants, thread occupancy
- Profile with Xcode: GPU Frame Capture, Metal System Trace
- Iterate: Measure, optimize, repeat
See references/metal-profiling.md for details.
- 选择存储模式:静态数据使用Private模式,动态数据使用Shared模式
- 优化着色器:使用函数常量、优化线程占用率
- 使用Xcode分析:GPU帧捕获、Metal系统追踪
- 迭代优化:测量、优化、重复
详情请参阅references/metal-profiling.md。
Key Metrics
关键指标
| Metric | Target | How to Measure |
|---|---|---|
| Frame time | 16.6ms (60fps) | Metal System Trace |
| GPU memory | < device budget | Xcode Memory Graph |
| Bandwidth | < 50GB/s | GPU Counters |
| Shader time | < 10ms | GPU Frame Capture |
| 指标 | 目标值 | 测量方式 |
|---|---|---|
| Frame time | 16.6ms (60fps) | Metal System Trace |
| GPU memory | < device budget | Xcode Memory Graph |
| Bandwidth | < 50GB/s | GPU Counters |
| Shader time | < 10ms | GPU Frame Capture |
Reference Implementation
参考实现
MetalSplatter is the primary reference for Swift/Metal gaussian splatting:
- Repository: https://github.com/scier/MetalSplatter
- Supports iOS, macOS, visionOS
- ~8M splat capacity with v1.1 optimizations
- Stereo rendering for Vision Pro
MetalSplatter是Swift/Metal高斯泼溅渲染的主要参考实现:
- 代码仓库:https://github.com/scier/MetalSplatter
- 支持iOS、macOS、visionOS
- v1.1优化后支持约800万splat数量
- 支持Vision Pro的立体渲染
Getting Started with MetalSplatter
MetalSplatter 快速开始
bash
git clone https://github.com/scier/MetalSplatter.git
cd MetalSplatter
open SampleApp/MetalSplatter_SampleApp.xcodeprojbash
git clone https://github.com/scier/MetalSplatter.git
cd MetalSplatter
open SampleApp/MetalSplatter_SampleApp.xcodeprojSet to Release scheme for best performance
切换至Release模式以获得最佳性能
undefinedundefinedResources
资源
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
研究论文
- LODGE - LOD for large-scale scenes
- FLoD - Flexible LOD for variable hardware
- Voyager - City-scale mobile rendering
- 3DGS Compression Survey