Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions docs/user-manual/gaussian-splatting/building/lod-streaming.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
---
title: LOD Streaming
description: "LOD streaming for large splat scenes: octree layout, generating lod-meta data, examples, and beta performance guidance."
description: "LOD streaming for large splat scenes: octree layout, generating lod-meta data, examples, and performance guidance."
---

LOD (Level of Detail) Streaming enables efficient rendering of large Gaussian splat scenes by dynamically loading appropriate levels of detail based on the camera's distance. This feature dramatically reduces memory usage and improves rendering performance for large-scale splat scenes.

:::info Beta Feature

LOD Streaming is currently in beta. If you encounter any issues, please report them on the [PlayCanvas Engine GitHub repository](https://github.com/playcanvas/engine/issues).

:::

## How It Works

LOD streaming works by:
Expand All @@ -24,15 +18,12 @@ This approach allows you to render massive splat scenes that would otherwise be

## Creating LOD Streaming Data

To use LOD streaming, you need to generate the streaming format from multiple splat files with different levels of detail. The tool takes your pre-generated LOD files and creates an optimized streaming format.

See the [Generating LOD Format](/user-manual/splat-transform#generating-lod-format) section in the SplatTransform documentation for detailed instructions on how to create the required `lod-meta.json` format.
To use LOD streaming, you need to generate the streaming format — an octree-based `lod-meta.json` structure that organizes multiple levels of detail for efficient streaming. There are two ways to obtain the LOD levels:

:::tip
- **Provide your own LOD levels** — supply multiple splat files at progressively lower detail (LOD 0 = highest detail, higher numbers = lower detail), for example produced during training or exported separately.
- **Generate them with SplatTransform** — use [SplatTransform](/user-manual/splat-transform) to decimate a single high-quality splat into lower-detail levels, so you don't have to author them yourself.

You must create the different LOD levels yourself (LOD 0 = highest detail, higher numbers = lower detail). The tool organizes these into a streaming-optimized format but doesn't create the simplified versions.

:::
Once you have the LOD levels, SplatTransform bundles them into the streaming-optimized format. See the [Generating LOD Format](/user-manual/splat-transform#generating-lod-format) section in the SplatTransform documentation for detailed instructions.

## Live Examples

Expand All @@ -48,11 +39,7 @@ Explore these live examples to see LOD streaming in action:

## Enabling LOD Streaming

To enable LOD streaming, set the [`unified`](https://api.playcanvas.com/engine/classes/GSplatComponent.html#unified) property to `true` on your GSplat component and load a streaming LOD format asset:

```javascript
entity.gsplat.unified = true;
```
LOD streaming is enabled simply by loading a streaming LOD format asset (`lod-meta.json`) onto a GSplat component — no additional configuration is required.

## Controlling LOD Behavior

Expand All @@ -71,7 +58,7 @@ The default multiplier of 2 gives perceptually uniform transitions under perspec

### Scene-Level Control

The [`Scene.gsplat`](https://api.playcanvas.com/engine/classes/Scene.html#gsplat) property provides access to scene-wide settings for unified gsplat rendering. This includes options for:
The [`Scene.gsplat`](https://api.playcanvas.com/engine/classes/Scene.html#gsplat) property provides access to scene-wide settings for gsplat rendering. This includes options for:

- Performance tuning parameters
- Debug visualization settings
Expand All @@ -86,6 +73,8 @@ const gsplatSettings = app.scene.gsplat;
// (See API documentation for available properties)
```

The most important scene-level setting for LOD streaming is the global splat budget, which automatically balances detail across all GSplat assets to hit a target splat count. See [Global Splat Budget](/user-manual/gaussian-splatting/building/performance#global-splat-budget) in the Performance section for details.

## Using LOD Streaming in the Editor

Native support for LOD streaming in the PlayCanvas Editor will be added in the near future. In the meantime, you can use the Engine API in scripts to enable streaming LOD functionality in your Editor projects.
Expand Down
39 changes: 39 additions & 0 deletions docs/user-manual/gaussian-splatting/building/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,45 @@ These settings are useful for:

However, for typical rendering performance management, the global splat budget is more effective than LOD range limits. The budget automatically finds the right balance across all assets, while LOD range limits apply uniformly regardless of camera position or scene composition.

### Fast Time to First Frame

For large streamed scenes, you can display a rendered frame almost immediately by loading only the **lowest** (coarsest) level of detail first, then letting higher-detail levels stream in afterwards. This avoids waiting for high-quality data before anything appears on screen.

The approach has two steps:

1. When the GSplat asset is created, clamp the LOD range to the coarsest level only, so just the smallest amount of data loads first.
2. Listen for the GSplat system's `frame:ready` event. Once the coarse data has loaded and rendered — and nothing is still loading — restore the full LOD range so higher-detail levels stream in based on camera distance.

```javascript
const gsplatSystem = app.systems.gsplat;

// `entity` has a gsplat component using a loaded LOD-streaming asset
const gsplat = entity.gsplat;

// 1. Start with the lowest (coarsest) LOD only, for the fastest first frame
const lodLevels = gsplat.resource?.octree?.lodLevels;
if (lodLevels) {
const worstLod = lodLevels - 1;
app.scene.gsplat.lodRangeMin = worstLod;
app.scene.gsplat.lodRangeMax = worstLod;
}

// 2. Once the coarse data is loaded and rendered, open the LOD range back up
// so higher-detail levels stream in
const onFrameReady = (camera, layer, ready, loadingCount) => {
if (ready && loadingCount === 0) {
gsplatSystem.off('frame:ready', onFrameReady);

// restore the full LOD range (0 = highest detail)
app.scene.gsplat.lodRangeMin = 0;
app.scene.gsplat.lodRangeMax = lodLevels - 1;
}
};
gsplatSystem.on('frame:ready', onFrameReady);
```

This technique is demonstrated in the live [LOD Streaming example](/user-manual/gaussian-splatting/building/lod-streaming#live-examples).

### Recommended Configuration

For most applications:
Expand Down
22 changes: 20 additions & 2 deletions docs/user-manual/splat-transform/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,12 @@ splat-transform \

### Generating LOD Format {#generating-lod-format}

The LOD (Level of Detail) format enables efficient streaming and rendering of large Gaussian splat scenes. The tool takes multiple pre-generated LOD files as input and generates an optimized streaming format with an octree structure for progressive download.
The LOD (Level of Detail) format enables efficient streaming and rendering of large Gaussian splat scenes. SplatTransform builds an optimized streaming format with an octree structure for progressive download from a set of LOD levels, where each level has progressively fewer Gaussians (LOD 0 = highest detail, higher numbers = lower detail).

**Note:** The tool does NOT create the LOD levels themselves — you must supply multiple LOD files with progressively fewer Gaussians (LOD 0 = highest detail, higher numbers = lower detail).
You can obtain those LOD levels in two ways:

- **Supply your own LOD files** — provide a separate splat file for each level, for example produced during training or exported from another tool.
- **Generate them by decimating a single source** — use [`--decimate`](#actions) to create the lower-detail levels from one high-quality input, so you don't have to author each level separately.

:::warning Output Filename Requirements

Expand All @@ -481,6 +484,20 @@ splat-transform \
--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 -F 50% lod1.ply
splat-transform source.ply -F 25% lod2.ply
splat-transform source.ply -F 10% lod3.ply
# Step 2: bundle the full-detail source and the decimated levels into a streaming LOD 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

# Generate LOD with custom chunk settings for better performance
splat-transform \
-C 1024 \
Expand Down Expand Up @@ -508,6 +525,7 @@ splat-transform scene.lcc output/lod-meta.json

**Tips:**

- Use `--decimate` (`-F`) to generate lower LOD levels from a single high-quality source, instead of authoring each level separately
- Use `--filter-nan` to remove invalid Gaussians before processing
- Use `--filter-harmonics 0` to reduce file size if colour detail is less critical
- Use `-C` to control the number of generated SOG files containing splats
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
---
title: LODストリーミング
description: "大規模スプラットシーン向けLODストリーミング:オクツリー構成、lod-metaデータの生成、例、ベータ時のパフォーマンス指針です。"
description: "大規模スプラットシーン向けLODストリーミング:オクツリー構成、lod-metaデータの生成、例、パフォーマンス指針です。"
---

LOD(Level of Detail)ストリーミングは、カメラの距離に基づいて適切な詳細レベルを動的にロードすることで、大規模なGaussian splatシーンの効率的なレンダリングを可能にします。この機能により、大規模なスプラットシーンのメモリ使用量を大幅に削減し、レンダリングパフォーマンスを向上させます。

:::info ベータ機能

LODストリーミングは現在ベータ版です。問題が発生した場合は、[PlayCanvas Engine GitHubリポジトリ](https://github.com/playcanvas/engine/issues)で報告してください。

:::

## 仕組み

LODストリーミングは以下のように動作します:
Expand All @@ -24,15 +18,12 @@ LODストリーミングは以下のように動作します:

## LODストリーミングデータの作成

LODストリーミングを使用するには、異なる詳細レベルを持つ複数のスプラットファイルからストリーミング形式を生成する必要があります。ツールは事前生成されたLODファイルを受け取り、最適化されたストリーミング形式を作成します。

必要な`lod-meta.json`形式の作成方法の詳細については、SplatTransformドキュメントの[LOD形式の生成](/user-manual/splat-transform#generating-lod-format)セクションを参照してください。
LODストリーミングを使用するには、ストリーミング形式(複数の詳細レベルを効率的なストリーミングのためにオクツリー構造で整理した`lod-meta.json`)を生成する必要があります。LODレベルを用意する方法は2つあります:

:::tip
- **独自のLODレベルを用意する** — 詳細度を段階的に下げた複数のスプラットファイル(LOD 0 = 最高詳細、数字が大きいほど詳細が低い)を、例えばトレーニング時に生成したものや個別にエクスポートしたものとして用意します。
- **SplatTransformで生成する** — [SplatTransform](/user-manual/splat-transform)を使用して、1つの高品質スプラットをデシメート(簡略化)し、詳細度の低いレベルを生成できます。自分で用意する必要はありません。

異なるLODレベルは自分で作成する必要があります(LOD 0 = 最高詳細、数字が大きいほど詳細が低い)。ツールはこれらをストリーミング最適化形式に整理しますが、簡略化バージョンは作成しません。

:::
LODレベルが揃ったら、SplatTransformがそれらをストリーミング最適化形式にまとめます。詳細については、SplatTransformドキュメントの[LOD形式の生成](/user-manual/splat-transform#generating-lod-format)セクションを参照してください。

## ライブサンプル

Expand All @@ -48,11 +39,7 @@ LODストリーミングの動作を確認するには、以下のライブサ

## LODストリーミングの有効化

LODストリーミングを有効にするには、GSplatコンポーネントの[`unified`](https://api.playcanvas.com/engine/classes/GSplatComponent.html#unified)プロパティを`true`に設定し、ストリーミングLOD形式アセットをロードします:

```javascript
entity.gsplat.unified = true;
```
LODストリーミングは、ストリーミングLOD形式アセット(`lod-meta.json`)をGSplatコンポーネントにロードするだけで有効になります。追加の設定は必要ありません。

## LOD動作の制御

Expand All @@ -69,7 +56,7 @@ entity.gsplat.lodDistances = [10, 20, 40, 80];

### シーンレベルの制御

[`Scene.gsplat`](https://api.playcanvas.com/engine/classes/Scene.html#gsplat)プロパティは、統合gsplatレンダリングのシーン全体の設定へのアクセスを提供します。これには以下のオプションが含まれます:
[`Scene.gsplat`](https://api.playcanvas.com/engine/classes/Scene.html#gsplat)プロパティは、gsplatレンダリングのシーン全体の設定へのアクセスを提供します。これには以下のオプションが含まれます:

- パフォーマンスチューニングパラメータ
- デバッグ可視化設定
Expand All @@ -84,6 +71,8 @@ const gsplatSettings = app.scene.gsplat;
// (利用可能なプロパティについてはAPIドキュメントを参照)
```

LODストリーミングで最も重要なシーンレベルの設定はグローバルスプラット予算で、すべてのGSplatアセット全体で目標スプラット数に収まるよう詳細度を自動的に調整します。詳細については、パフォーマンスセクションの[グローバルスプラット予算](/user-manual/gaussian-splatting/building/performance#global-splat-budget)を参照してください。

## エディターでのLODストリーミングの使用

PlayCanvas EditorでのLODストリーミングのネイティブサポートは近い将来追加される予定です。それまでの間、Editorプロジェクトでストリーミングロード機能を有効にするには、スクリプト内でEngine APIを使用できます。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,45 @@ app.scene.gsplat.lodRangeMax = 3; // LOD 3より低くはしない

ただし、一般的なレンダリングパフォーマンス管理には、LOD範囲制限よりもグローバルスプラットバジェットの方が効果的です。バジェットはすべてのアセット間で適切なバランスを自動的に見つけますが、LOD範囲制限はカメラ位置やシーン構成に関係なく一律に適用されます。

### 最初のフレームを高速に表示する

大規模なストリーミングシーンでは、最初に**最も低い**(最も粗い)詳細レベルだけをロードし、その後により高い詳細レベルをストリーミングで読み込むことで、ほぼ即座にレンダリング結果を表示できます。これにより、何かが画面に表示される前に高品質データの読み込みを待つ必要がなくなります。

この手法は2つのステップで構成されます:

1. GSplatアセットの作成時に、LOD範囲を最も粗いレベルのみに制限し、最小限のデータだけが先にロードされるようにします。
2. GSplatシステムの`frame:ready`イベントをリッスンします。粗いデータがロードされてレンダリングされ、かつ読み込み中のものがなくなったら、LOD範囲を元に戻し、カメラ距離に基づいてより高い詳細レベルがストリーミングされるようにします。

```javascript
const gsplatSystem = app.systems.gsplat;

// `entity` は、ロード済みのLODストリーミングアセットを使用する gsplat コンポーネントを持ちます
const gsplat = entity.gsplat;

// 1. 最初のフレームを最速にするため、最も低い(最も粗い)LODのみで開始
const lodLevels = gsplat.resource?.octree?.lodLevels;
if (lodLevels) {
const worstLod = lodLevels - 1;
app.scene.gsplat.lodRangeMin = worstLod;
app.scene.gsplat.lodRangeMax = worstLod;
}

// 2. 粗いデータがロードされてレンダリングされたら、LOD範囲を元に戻して
// より高い詳細レベルをストリーミングする
const onFrameReady = (camera, layer, ready, loadingCount) => {
if (ready && loadingCount === 0) {
gsplatSystem.off('frame:ready', onFrameReady);

// 完全なLOD範囲を復元(0 = 最高詳細)
app.scene.gsplat.lodRangeMin = 0;
app.scene.gsplat.lodRangeMax = lodLevels - 1;
}
};
gsplatSystem.on('frame:ready', onFrameReady);
```

この手法は、ライブの[LODストリーミングサンプル](/user-manual/gaussian-splatting/building/lod-streaming)で実演されています。

### 推奨設定

ほとんどのアプリケーションでは:
Expand Down
Loading