3d-tiles-rendererjs-3dgs-plugin

中文文档
0.3.1发布于 2026/11/01Apache-2.0TypeScriptES Module零依赖构建来源已验证近 30 天下载 3.3万

Gaussian splat tile plugin for 3d-tiles-renderer with WebGPU and WebGL2 rendering powered by Gaussian Splat Lite.

原始使用文档
文档目录12 节
  1. Rendering backends
  2. Requirements
  3. Installation
  4. Quick start
  5. WebGPU
  6. WebGL2
  7. WebXR / VR
  8. Gaussian Splat Lite renderer
  9. Supported content
  10. API
  11. Example and development
  12. License

3d-tiles-rendererjs-3dgs-plugin

npm version CI License

3D Tiles Gaussian Splatting · WebGPU · WebGL2 · GIS / ECEF

3D-Tiles-RendererJS-3DGS-Plugin

Stream 3D Gaussian Splatting tiles into Three.js with 3d-tiles-renderer and Gaussian Splat Lite. WebGPU and WebGL2 are supported through Gaussian Splat Lite 1.6.

The plugin loads standard uncompressed and SPZ-compressed Gaussian splat tiles in glTF/GLB format. It supports explicit and implicit 3D Tiles, tile disposal and memory accounting, large GIS/ECEF coordinates, and TilesFadePlugin transitions.

[!IMPORTANT] Upgrading to 0.3? Update Gaussian Splat Lite to ^1.6.0 and Three.js to >=0.187.0. Review the renderer and raycast default changes in the 0.2.x to 0.3.x migration guide. For applications still on 0.1.x, follow the Spark-to-GSL migration guide first.

Rendering backends

RendererBackendSplat sorting
WebGPURendererNative WebGPUGPU sorting before drawing
WebGPURenderer with forceWebGL, or automatic fallbackWebGL2Asynchronous Worker/WASM sorting
WebGLRendererWebGL2Asynchronous Worker/WASM sorting

The same GaussianSplatPlugin setup works with all three paths. Renderer selection, sorting, and drawing are handled by Gaussian Splat Lite; the plugin handles tile loading, transforms, fading, and disposal.

Requirements

  • three@>=0.187.0
  • 3d-tiles-renderer@^0.5.0
  • gaussian-splat-lite@^1.6.0
  • A browser with WebAssembly, Web Workers, ES modules, and WebGPU or WebGL2
  • Native WebGPU requires a compatible browser/GPU and a secure context (HTTPS or localhost)

Installation

npm install 3d-tiles-rendererjs-3dgs-plugin@^0.3.1 gaussian-splat-lite@^1.6.0 three@^0.187.0 3d-tiles-renderer@^0.5.0

Quick start

WebGPU

import { Scene, PerspectiveCamera, Vector2 } from 'three';
import { WebGPURenderer } from 'three/webgpu';
import { TilesRenderer } from '3d-tiles-renderer';
import { TilesFadePlugin } from '3d-tiles-renderer/plugins';
import { GaussianSplatRenderer } from 'gaussian-splat-lite';
import { GaussianSplatPlugin } from '3d-tiles-rendererjs-3dgs-plugin';

const renderer = new WebGPURenderer({ antialias: false });
await renderer.init(); // Initialize before creating GaussianSplatRenderer.
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const scene = new Scene();
const camera = new PerspectiveCamera(
  60,
  window.innerWidth / window.innerHeight,
  0.1,
  10000,
);
camera.position.set(0, 0, 3); // Adjust the camera to your tileset's coordinates.

const tiles = new TilesRenderer('https://example.com/tileset.json');
tiles.setCamera(camera);
const size = new Vector2();
tiles.setResolution(camera, renderer.getSize(size));

// The application owns one scene-level Gaussian renderer.
const splatRenderer = new GaussianSplatRenderer({ renderer });
scene.add(splatRenderer);
tiles.registerPlugin(new TilesFadePlugin());
tiles.registerPlugin(new GaussianSplatPlugin());

scene.add(tiles.group);

renderer.setAnimationLoop(() => {
  tiles.update();
  renderer.render(scene, camera);
});

window.addEventListener('resize', () => {
  camera.aspect = window.innerWidth / window.innerHeight;
  camera.updateProjectionMatrix();
  renderer.setSize(window.innerWidth, window.innerHeight);
  tiles.setResolution(camera, renderer.getSize(size));
});

WebGPURenderer automatically falls back to WebGL2 when WebGPU is unavailable. The example uses setResolution(camera, renderer.getSize(size)) so it also type-checks with [email protected], whose setResolutionFromRenderer declaration accepts only WebGLRenderer.

WebGL2

To force the WebGL2 backend of WebGPURenderer, change its constructor:

const renderer = new WebGPURenderer({ antialias: false, forceWebGL: true });
await renderer.init();

For the classic WebGL renderer, replace the WebGPU import, constructor, and initialization with:

import { WebGLRenderer } from 'three';

const renderer = new WebGLRenderer({ antialias: false });

Keep the remaining scene, tile, and GaussianSplatRenderer setup unchanged.

WebXR / VR

The Gaussian splat renderer is WebXR-aware when renderer.xr.isPresenting. WebXR applications must switch TilesRenderer between the normal camera and Three.js' XR ArrayCamera as sessions start and end. See the WebXR / VR integration guide for the complete setup.

Gaussian Splat Lite renderer

GaussianSplatPlugin does not create, configure, or dispose a GaussianSplatRenderer. Create one, retain its reference, and add it directly to the scene before rendering:

const gaussianSplatRenderer = new GaussianSplatRenderer({
  renderer,
  renderDepth: true,
});
scene.add(gaussianSplatRenderer);

tiles.registerPlugin(new GaussianSplatPlugin());

The plugin does not validate that the renderer exists. Without one, tile SplatMesh instances still load but are not drawn. Pass render settings such as blurAmount, focalAdjustment, depthTest, and renderDepth directly to Gaussian Splat Lite, not to this plugin.

renderDepth adds a companion Splat depth draw for occlusion of geometry rendered later. GSL 1.0 also provides optional stochastic, autoStochastic, and StochasticResolvePass rendering. These are renderer features and work with the tile-created Splats on WebGPU and WebGL2.

For the complete list of options, defaults, runtime properties, and on-demand rendering setup, see the GaussianSplatRenderer settings page.

Supported content

Standard uncompressed and SPZ-compressed Gaussian splat tiles are supported in glTF/GLB format. Both work with the same plugin setup.

Uncompressed tiles currently require sRGB colors. Other compression formats are not supported.

API

new GaussianSplatPlugin({
  minRaycastOpacity: 0.15,
});
OptionDefaultDescription
minRaycastOpacityGaussian Splat Lite default (0.15 in GSL 1.0)Per-splat kernel-alpha threshold that clips the raycast hit area. Set an explicit value to preserve this threshold across GSL upgrades.

Public exports:

import {
  GaussianSplatPlugin,
  type GaussianSplatPluginOptions,
} from '3d-tiles-rendererjs-3dgs-plugin';

Example and development

The examples/ WebGL2 demo includes explicit and implicit sample tilesets, a globe, tileset switching, and LOD controls. Development requires Node.js 22.12.0 or newer.

The sample data in data/ was converted from PLY-format 3D Gaussian Splatting files with 3DGS-PLY-3DTiles-Converter.

npm install
npm start               # Run the demo with Vite
npm run check           # Type-check the package
npm run build           # Build the npm package
npm run build-examples  # Build the static demo

License

Apache-2.0

版本与发布记录

3d-tiles-rendererjs-3dgs-plugin 共发布 22 个版本,首次发布于 2026/04/17;过去 12 个月发布了 22 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.1latest2026/11/014 天前
0.3.02026/09/091 个月前
0.2.22026/08/302 个月前
0.2.12026/08/282 个月前
0.2.02026/08/282 个月前
0.1.162026/08/062 个月前

关于 3d-tiles-rendererjs-3dgs-plugin 的常见问题

3d-tiles-rendererjs-3dgs-plugin 是什么?

Gaussian splat tile plugin for 3d-tiles-renderer with WebGPU and WebGL2 rendering powered by Gaussian Splat Lite.

如何安装 3d-tiles-rendererjs-3dgs-plugin?

在项目目录运行 npm install 3d-tiles-rendererjs-3dgs-plugin,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:three(>=0.187.0)、3d-tiles-renderer(^0.5.0)、gaussian-splat-lite(^1.6.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

3d-tiles-rendererjs-3dgs-plugin 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

3d-tiles-rendererjs-3dgs-plugin 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

3d-tiles-rendererjs-3dgs-plugin 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.12.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

3d-tiles-rendererjs-3dgs-plugin 可以商用吗?

3d-tiles-rendererjs-3dgs-plugin 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

3d-tiles-rendererjs-3dgs-plugin 的下载量有多少?

根据 npm 官方下载统计,3d-tiles-rendererjs-3dgs-plugin 在 2026/10/04 – 2026/11/02 这 30 天内被下载 33,330 次,日均约 1,111 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

3d-tiles-rendererjs-3dgs-plugin 还在维护吗?

最新版本 0.3.1 发布于 2026/11/01(4 天前);至今共发布 22 个版本,其中过去 12 个月发布了 22 个;首次发布于 2026/04/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。