gaussian-splat-lite 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/README.md +22 -13
  3. package/dist/gaussian-splat-lite.cjs +700 -51
  4. package/dist/gaussian-splat-lite.cjs.map +1 -1
  5. package/dist/gaussian-splat-lite.min.cjs +40 -13
  6. package/dist/gaussian-splat-lite.min.cjs.map +1 -1
  7. package/dist/gaussian-splat-lite.module.js +702 -53
  8. package/dist/gaussian-splat-lite.module.js.map +1 -1
  9. package/dist/gaussian-splat-lite.module.min.js +2660 -2199
  10. package/dist/gaussian-splat-lite.module.min.js.map +1 -1
  11. package/dist/types/addons/TAAPass.d.cts +6 -15
  12. package/dist/types/addons/TAAPass.d.ts +6 -15
  13. package/dist/types/capture/SplatCapture.d.cts +66 -0
  14. package/dist/types/capture/SplatCapture.d.ts +66 -0
  15. package/dist/types/capture/WebGLCapture.d.cts +13 -0
  16. package/dist/types/capture/WebGLCapture.d.ts +13 -0
  17. package/dist/types/capture/WebGPUCapture.d.cts +17 -0
  18. package/dist/types/capture/WebGPUCapture.d.ts +17 -0
  19. package/dist/types/capture/pixels.d.cts +5 -0
  20. package/dist/types/capture/pixels.d.ts +5 -0
  21. package/dist/types/capture/rendererState.d.cts +3 -0
  22. package/dist/types/capture/rendererState.d.ts +3 -0
  23. package/dist/types/capture/sceneView.d.cts +3 -0
  24. package/dist/types/capture/sceneView.d.ts +3 -0
  25. package/dist/types/index.d.cts +1 -1
  26. package/dist/types/index.d.ts +1 -1
  27. package/dist/types/rendering/GaussianSplatRenderer.d.cts +13 -11
  28. package/dist/types/rendering/GaussianSplatRenderer.d.ts +13 -11
  29. package/dist/types/rendering/SplatAccumulator.d.cts +2 -1
  30. package/dist/types/rendering/SplatAccumulator.d.ts +2 -1
  31. package/dist/types/rendering/backend.d.cts +1 -1
  32. package/dist/types/rendering/backend.d.ts +1 -1
  33. package/dist/types/rendering/rendererUtils.d.cts +1 -5
  34. package/dist/types/rendering/rendererUtils.d.ts +1 -5
  35. package/dist/types/rendering/tsl/tslCompat.d.cts +1 -0
  36. package/dist/types/rendering/tsl/tslCompat.d.ts +1 -0
  37. package/dist/types/rendering/uniforms.d.cts +0 -3
  38. package/dist/types/rendering/uniforms.d.ts +0 -3
  39. package/dist/types/scene/SplatMesh.d.cts +1 -1
  40. package/dist/types/scene/SplatMesh.d.ts +1 -1
  41. package/docs/Architecture.md +48 -3
  42. package/docs/GaussianSplatRenderer.md +71 -55
  43. package/docs/PostDecode.md +52 -36
  44. package/docs/RadStreamScheduler.md +53 -41
  45. package/docs/SogStreamScheduler.md +49 -39
  46. package/docs/SplatCapture.md +147 -0
  47. package/docs/SplatEdit.md +33 -26
  48. package/docs/SplatFileType.md +11 -13
  49. package/docs/SplatLoader.md +19 -14
  50. package/docs/SplatMesh.md +69 -49
  51. package/docs/Splats.md +33 -26
  52. package/docs/StochasticRendering.md +27 -30
  53. package/docs/TAAPass.md +97 -73
  54. package/package.json +1 -1
  55. package/docs/SplatAccumulator.md +0 -37
@@ -3,9 +3,10 @@ import { Pass } from 'three/addons/postprocessing/Pass.js';
3
3
  /**
4
4
  * Temporal reprojection for WebGLRenderer, using depth and camera motion.
5
5
  * Object motion is not tracked; no velocity texture is required.
6
- * Owns scene capture, camera jitter, and history. By default it blends and
7
- * accumulates in the output color space, like direct canvas rendering, and
8
- * presents the result without OutputPass.
6
+ * Owns scene capture, camera jitter, and history. It blends and accumulates
7
+ * in the output color space, like direct canvas rendering, then hands the
8
+ * composer a working-space result. Use EffectComposer with OutputPass for
9
+ * output.
9
10
  */
10
11
  export declare class TAAPass extends Pass {
11
12
  scene: Scene;
@@ -18,20 +19,10 @@ export declare class TAAPass extends Pass {
18
19
  maxMotionLength: number;
19
20
  /** Increase current-frame weight for subpixel camera motion. */
20
21
  useSubpixelCorrection: boolean;
21
- /**
22
- * Capture and accumulate in the renderer's output color space, ready for
23
- * presentation. Set false to stay in the working color space for linear
24
- * effects, followed by OutputPass.
25
- */
26
- accumulateInOutputSpace: boolean;
27
22
  private readonly _source;
28
23
  private readonly _history;
29
- private readonly _size;
30
24
  private readonly _clearColor;
31
25
  private readonly _state;
32
- private _workingColorSpace;
33
- private _toneMapping;
34
- private _toneMappingExposure;
35
26
  private readonly _uniforms;
36
27
  private readonly _resolveMaterial;
37
28
  private readonly _copyMaterial;
@@ -45,7 +36,7 @@ export declare class TAAPass extends Pass {
45
36
  setSize(width: number, height: number): void;
46
37
  /** Discard history after a camera cut, scene replacement, or color-space change. */
47
38
  reset(): void;
48
- /** Render the scene and TAA to the canvas, a target, or the composer's buffer. */
49
- render(renderer: WebGLRenderer, writeBuffer?: WebGLRenderTarget | null): void;
39
+ /** Render the scene and resolve TAA into the composer's working-space buffer. */
40
+ render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget): void;
50
41
  dispose(): void;
51
42
  }
@@ -3,9 +3,10 @@ import { Pass } from 'three/addons/postprocessing/Pass.js';
3
3
  /**
4
4
  * Temporal reprojection for WebGLRenderer, using depth and camera motion.
5
5
  * Object motion is not tracked; no velocity texture is required.
6
- * Owns scene capture, camera jitter, and history. By default it blends and
7
- * accumulates in the output color space, like direct canvas rendering, and
8
- * presents the result without OutputPass.
6
+ * Owns scene capture, camera jitter, and history. It blends and accumulates
7
+ * in the output color space, like direct canvas rendering, then hands the
8
+ * composer a working-space result. Use EffectComposer with OutputPass for
9
+ * output.
9
10
  */
10
11
  export declare class TAAPass extends Pass {
11
12
  scene: Scene;
@@ -18,20 +19,10 @@ export declare class TAAPass extends Pass {
18
19
  maxMotionLength: number;
19
20
  /** Increase current-frame weight for subpixel camera motion. */
20
21
  useSubpixelCorrection: boolean;
21
- /**
22
- * Capture and accumulate in the renderer's output color space, ready for
23
- * presentation. Set false to stay in the working color space for linear
24
- * effects, followed by OutputPass.
25
- */
26
- accumulateInOutputSpace: boolean;
27
22
  private readonly _source;
28
23
  private readonly _history;
29
- private readonly _size;
30
24
  private readonly _clearColor;
31
25
  private readonly _state;
32
- private _workingColorSpace;
33
- private _toneMapping;
34
- private _toneMappingExposure;
35
26
  private readonly _uniforms;
36
27
  private readonly _resolveMaterial;
37
28
  private readonly _copyMaterial;
@@ -45,7 +36,7 @@ export declare class TAAPass extends Pass {
45
36
  setSize(width: number, height: number): void;
46
37
  /** Discard history after a camera cut, scene replacement, or color-space change. */
47
38
  reset(): void;
48
- /** Render the scene and TAA to the canvas, a target, or the composer's buffer. */
49
- render(renderer: WebGLRenderer, writeBuffer?: WebGLRenderTarget | null): void;
39
+ /** Render the scene and resolve TAA into the composer's working-space buffer. */
40
+ render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget): void;
50
41
  dispose(): void;
51
42
  }
@@ -0,0 +1,66 @@
1
+ import { GaussianSplatRenderer } from '../rendering/GaussianSplatRenderer.cjs';
2
+ import * as THREE from "three";
3
+ export type SplatCaptureTargetOptions = {
4
+ width: number;
5
+ height: number;
6
+ doubleBuffer?: boolean;
7
+ superXY?: number;
8
+ } & Omit<THREE.RenderTargetOptions, "stencilBuffer">;
9
+ export interface SplatCaptureOptions {
10
+ splatRenderer: GaussianSplatRenderer;
11
+ target?: SplatCaptureTargetOptions;
12
+ }
13
+ export interface SplatCaptureCubeOptions {
14
+ scene: THREE.Scene;
15
+ worldCenter: THREE.Vector3;
16
+ size?: number;
17
+ near?: number;
18
+ far?: number;
19
+ hideObjects?: THREE.Object3D[];
20
+ filter?: boolean;
21
+ }
22
+ export type SplatCaptureEnvOptions = Omit<SplatCaptureCubeOptions, "filter">;
23
+ type SceneView = {
24
+ scene: THREE.Scene;
25
+ camera: THREE.Camera;
26
+ };
27
+ /** Optional offscreen capture and environment maps, independent of core rendering. */
28
+ export declare class SplatCapture {
29
+ readonly splatRenderer: GaussianSplatRenderer;
30
+ readonly superXY: number;
31
+ target?: THREE.RenderTarget;
32
+ backTarget?: THREE.RenderTarget;
33
+ superPixels?: Uint8Array;
34
+ targetPixels?: Uint8Array;
35
+ private disposed;
36
+ private readonly captureRenderer;
37
+ private readonly capturePass;
38
+ private pending;
39
+ private readonly cubeRenders;
40
+ private lastCube;
41
+ private pmrem;
42
+ constructor({ splatRenderer, target }: SplatCaptureOptions);
43
+ private initializeTarget;
44
+ get renderer(): import('../rendering/rendererUtils.cjs').GaussianSplatCompatibleRenderer;
45
+ private get stencilBuffer();
46
+ private assertActive;
47
+ private enqueue;
48
+ private renderCapture;
49
+ /** Snapshots the camera now; the capture may wait for earlier ones. */
50
+ private targetCapture;
51
+ renderTarget(view: SceneView): Promise<THREE.RenderTarget>;
52
+ /** Reuses the returned buffer; copy it if a later read must not overwrite it. */
53
+ readTarget(): Promise<Uint8Array>;
54
+ renderReadTarget(view: SceneView): Promise<Uint8Array>;
55
+ private renderCube;
56
+ /** Validates and snapshots the center now; the capture may wait for earlier ones. */
57
+ private cubeCapture;
58
+ renderCubeMap(options: SplatCaptureCubeOptions): Promise<THREE.CubeTexture>;
59
+ /** Faces of the latest cube capture, in the WebGL layout on every backend. */
60
+ readCubeTargets(): Promise<Uint8Array[]>;
61
+ /** The caller owns the result; texture.dispose() also releases its render target. */
62
+ renderEnvMap(options: SplatCaptureEnvOptions): Promise<THREE.Texture>;
63
+ recurseSetEnvMap(root: THREE.Object3D, envMap: THREE.Texture): void;
64
+ dispose(): void;
65
+ }
66
+ export {};
@@ -0,0 +1,66 @@
1
+ import { GaussianSplatRenderer } from '../rendering/GaussianSplatRenderer';
2
+ import * as THREE from "three";
3
+ export type SplatCaptureTargetOptions = {
4
+ width: number;
5
+ height: number;
6
+ doubleBuffer?: boolean;
7
+ superXY?: number;
8
+ } & Omit<THREE.RenderTargetOptions, "stencilBuffer">;
9
+ export interface SplatCaptureOptions {
10
+ splatRenderer: GaussianSplatRenderer;
11
+ target?: SplatCaptureTargetOptions;
12
+ }
13
+ export interface SplatCaptureCubeOptions {
14
+ scene: THREE.Scene;
15
+ worldCenter: THREE.Vector3;
16
+ size?: number;
17
+ near?: number;
18
+ far?: number;
19
+ hideObjects?: THREE.Object3D[];
20
+ filter?: boolean;
21
+ }
22
+ export type SplatCaptureEnvOptions = Omit<SplatCaptureCubeOptions, "filter">;
23
+ type SceneView = {
24
+ scene: THREE.Scene;
25
+ camera: THREE.Camera;
26
+ };
27
+ /** Optional offscreen capture and environment maps, independent of core rendering. */
28
+ export declare class SplatCapture {
29
+ readonly splatRenderer: GaussianSplatRenderer;
30
+ readonly superXY: number;
31
+ target?: THREE.RenderTarget;
32
+ backTarget?: THREE.RenderTarget;
33
+ superPixels?: Uint8Array;
34
+ targetPixels?: Uint8Array;
35
+ private disposed;
36
+ private readonly captureRenderer;
37
+ private readonly capturePass;
38
+ private pending;
39
+ private readonly cubeRenders;
40
+ private lastCube;
41
+ private pmrem;
42
+ constructor({ splatRenderer, target }: SplatCaptureOptions);
43
+ private initializeTarget;
44
+ get renderer(): import('../rendering/rendererUtils').GaussianSplatCompatibleRenderer;
45
+ private get stencilBuffer();
46
+ private assertActive;
47
+ private enqueue;
48
+ private renderCapture;
49
+ /** Snapshots the camera now; the capture may wait for earlier ones. */
50
+ private targetCapture;
51
+ renderTarget(view: SceneView): Promise<THREE.RenderTarget>;
52
+ /** Reuses the returned buffer; copy it if a later read must not overwrite it. */
53
+ readTarget(): Promise<Uint8Array>;
54
+ renderReadTarget(view: SceneView): Promise<Uint8Array>;
55
+ private renderCube;
56
+ /** Validates and snapshots the center now; the capture may wait for earlier ones. */
57
+ private cubeCapture;
58
+ renderCubeMap(options: SplatCaptureCubeOptions): Promise<THREE.CubeTexture>;
59
+ /** Faces of the latest cube capture, in the WebGL layout on every backend. */
60
+ readCubeTargets(): Promise<Uint8Array[]>;
61
+ /** The caller owns the result; texture.dispose() also releases its render target. */
62
+ renderEnvMap(options: SplatCaptureEnvOptions): Promise<THREE.Texture>;
63
+ recurseSetEnvMap(root: THREE.Object3D, envMap: THREE.Texture): void;
64
+ dispose(): void;
65
+ }
66
+ export {};
@@ -0,0 +1,13 @@
1
+ import * as THREE from "three";
2
+ /** Blend in output space like the canvas, then convert to texture storage. */
3
+ export declare class WebGLCapture {
4
+ private readonly renderer;
5
+ private readonly depthTexture;
6
+ private readonly target;
7
+ private readonly camera;
8
+ private readonly material;
9
+ private readonly quad;
10
+ constructor(renderer: THREE.WebGLRenderer);
11
+ render(scene: THREE.Scene, camera: THREE.Camera): void;
12
+ dispose(): void;
13
+ }
@@ -0,0 +1,13 @@
1
+ import * as THREE from "three";
2
+ /** Blend in output space like the canvas, then convert to texture storage. */
3
+ export declare class WebGLCapture {
4
+ private readonly renderer;
5
+ private readonly depthTexture;
6
+ private readonly target;
7
+ private readonly camera;
8
+ private readonly material;
9
+ private readonly quad;
10
+ constructor(renderer: THREE.WebGLRenderer);
11
+ render(scene: THREE.Scene, camera: THREE.Camera): void;
12
+ dispose(): void;
13
+ }
@@ -0,0 +1,17 @@
1
+ import { WebGPURenderer } from 'three/webgpu';
2
+ import * as THREE from "three";
3
+ /** Blend in working space, then convert to texture storage. */
4
+ export declare class WebGPUCapture {
5
+ private readonly renderer;
6
+ private readonly depthTexture;
7
+ private readonly target;
8
+ private readonly material;
9
+ private readonly quad;
10
+ private workingColorSpace;
11
+ private outputColorSpace;
12
+ private storageColorSpace;
13
+ private toneMapping;
14
+ constructor(renderer: WebGPURenderer);
15
+ render(scene: THREE.Scene, camera: THREE.Camera): void;
16
+ dispose(): void;
17
+ }
@@ -0,0 +1,17 @@
1
+ import { WebGPURenderer } from 'three/webgpu';
2
+ import * as THREE from "three";
3
+ /** Blend in working space, then convert to texture storage. */
4
+ export declare class WebGPUCapture {
5
+ private readonly renderer;
6
+ private readonly depthTexture;
7
+ private readonly target;
8
+ private readonly material;
9
+ private readonly quad;
10
+ private workingColorSpace;
11
+ private outputColorSpace;
12
+ private storageColorSpace;
13
+ private toneMapping;
14
+ constructor(renderer: WebGPURenderer);
15
+ render(scene: THREE.Scene, camera: THREE.Camera): void;
16
+ dispose(): void;
17
+ }
@@ -0,0 +1,5 @@
1
+ import { GaussianSplatCompatibleRenderer } from '../rendering/rendererUtils.cjs';
2
+ import * as THREE from "three";
3
+ /** Packed RGBA8, with the bottom row first on every backend. */
4
+ export declare function readPixels(renderer: GaussianSplatCompatibleRenderer, target: THREE.RenderTarget, pixels: Uint8Array, face?: number): Promise<void>;
5
+ export declare function downsamplePixels(source: Uint8Array, width: number, height: number, superXY: number, output: Uint8Array): void;
@@ -0,0 +1,5 @@
1
+ import { GaussianSplatCompatibleRenderer } from '../rendering/rendererUtils';
2
+ import * as THREE from "three";
3
+ /** Packed RGBA8, with the bottom row first on every backend. */
4
+ export declare function readPixels(renderer: GaussianSplatCompatibleRenderer, target: THREE.RenderTarget, pixels: Uint8Array, face?: number): Promise<void>;
5
+ export declare function downsamplePixels(source: Uint8Array, width: number, height: number, superXY: number, output: Uint8Array): void;
@@ -0,0 +1,3 @@
1
+ import { GaussianSplatCompatibleRenderer } from '../rendering/rendererUtils.cjs';
2
+ /** Wrap synchronous drawing only; output state must never survive an await. */
3
+ export declare function withCaptureState<T>(renderer: GaussianSplatCompatibleRenderer, draw: () => T): T;
@@ -0,0 +1,3 @@
1
+ import { GaussianSplatCompatibleRenderer } from '../rendering/rendererUtils';
2
+ /** Wrap synchronous drawing only; output state must never survive an await. */
3
+ export declare function withCaptureState<T>(renderer: GaussianSplatCompatibleRenderer, draw: () => T): T;
@@ -0,0 +1,3 @@
1
+ import * as THREE from "three";
2
+ /** Filter capture data without changing visibility while sorting is pending. */
3
+ export declare function captureSceneView(scene: THREE.Scene, hideObjects: readonly THREE.Object3D[]): THREE.Scene;
@@ -0,0 +1,3 @@
1
+ import * as THREE from "three";
2
+ /** Filter capture data without changing visibility while sorting is pending. */
3
+ export declare function captureSceneView(scene: THREE.Scene, hideObjects: readonly THREE.Object3D[]): THREE.Scene;
@@ -1,7 +1,7 @@
1
1
  export { GaussianSplatRenderer, type GaussianSplatRendererOptions, } from './rendering/GaussianSplatRenderer.cjs';
2
- export { SplatAccumulator, type SplatMapping, } from './rendering/SplatAccumulator.cjs';
3
2
  export { TAAPass } from './addons/TAAPass.cjs';
4
3
  export { TAANode } from './addons/TAANode.cjs';
4
+ export { SplatCapture, type SplatCaptureOptions, type SplatCaptureTargetOptions, type SplatCaptureCubeOptions, type SplatCaptureEnvOptions, } from './capture/SplatCapture.cjs';
5
5
  export { SplatLoader } from './loaders/SplatLoader.cjs';
6
6
  export { RadStreamScheduler, type RadStreamSchedulerOptions, type RadStreamStats, } from './loaders/stream/rad-stream/RadStreamScheduler.cjs';
7
7
  export type { SplatFileInput, SplatFileResolver, SplatLoadStage, SplatProgressEvent, } from './loaders/loadTypes.cjs';
@@ -1,7 +1,7 @@
1
1
  export { GaussianSplatRenderer, type GaussianSplatRendererOptions, } from './rendering/GaussianSplatRenderer';
2
- export { SplatAccumulator, type SplatMapping, } from './rendering/SplatAccumulator';
3
2
  export { TAAPass } from './addons/TAAPass';
4
3
  export { TAANode } from './addons/TAANode';
4
+ export { SplatCapture, type SplatCaptureOptions, type SplatCaptureTargetOptions, type SplatCaptureCubeOptions, type SplatCaptureEnvOptions, } from './capture/SplatCapture';
5
5
  export { SplatLoader } from './loaders/SplatLoader';
6
6
  export { RadStreamScheduler, type RadStreamSchedulerOptions, type RadStreamStats, } from './loaders/stream/rad-stream/RadStreamScheduler';
7
7
  export type { SplatFileInput, SplatFileResolver, SplatLoadStage, SplatProgressEvent, } from './loaders/loadTypes';
@@ -23,6 +23,12 @@ export interface GaussianSplatRendererOptions {
23
23
  * @default true
24
24
  */
25
25
  premultipliedAlpha?: boolean;
26
+ /**
27
+ * Decode stored sRGB Splat colors to linear before blending. When omitted,
28
+ * conversion follows the active blend space automatically.
29
+ * @default undefined
30
+ */
31
+ encodeLinear?: boolean;
26
32
  /**
27
33
  * Pass in a THREE.Timer to synchronize time-based effects across different
28
34
  * systems. A supplied timer remains owned and updated by the caller.
@@ -54,15 +60,9 @@ export interface GaussianSplatRendererOptions {
54
60
  * @default 1.0
55
61
  */
56
62
  minPixelRadius?: number;
57
- /**
58
- * Maximum screen-pixel radius for splat rendering, independent of the
59
- * internal projection scale used by focalAdjustment.
60
- * @default 256.0
61
- */
62
- maxPixelRadius?: number;
63
63
  /**
64
64
  * Minimum alpha value for splat rendering.
65
- * @default 0.5 / 255
65
+ * @default 1 / 255
66
66
  */
67
67
  minAlpha?: number;
68
68
  /**
@@ -161,10 +161,11 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
161
161
  readonly uniforms: ReturnType<typeof GaussianSplatRenderer.makeUniforms>;
162
162
  autoUpdate: boolean;
163
163
  preUpdate: boolean;
164
+ /** @internal False for a second renderer on the same scene, so each `onFrame` runs once per frame. */
165
+ frameCallbacks: boolean;
164
166
  renderSize: THREE.Vector2;
165
167
  maxStdDev: number;
166
168
  minPixelRadius: number;
167
- maxPixelRadius: number;
168
169
  minAlpha: number;
169
170
  preBlurAmount: number;
170
171
  blurAmount: number;
@@ -183,6 +184,7 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
183
184
  private stochasticFrame;
184
185
  private _stochasticSort;
185
186
  private _premultipliedAlpha;
187
+ private _encodeLinear;
186
188
  private _transparent;
187
189
  private readonly sortedBlending;
188
190
  private _depthTest;
@@ -253,9 +255,6 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
253
255
  minPixelRadius: {
254
256
  value: number;
255
257
  };
256
- maxPixelRadius: {
257
- value: number;
258
- };
259
258
  minAlpha: {
260
259
  value: number;
261
260
  };
@@ -353,6 +352,9 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
353
352
  */
354
353
  private getGenerationCamera;
355
354
  private driveSort;
355
+ /** Decode sRGB before blending; undefined follows the active blend space. */
356
+ get encodeLinear(): boolean | undefined;
357
+ set encodeLinear(value: boolean | undefined);
356
358
  get premultipliedAlpha(): boolean;
357
359
  set premultipliedAlpha(value: boolean);
358
360
  get transparent(): boolean;
@@ -23,6 +23,12 @@ export interface GaussianSplatRendererOptions {
23
23
  * @default true
24
24
  */
25
25
  premultipliedAlpha?: boolean;
26
+ /**
27
+ * Decode stored sRGB Splat colors to linear before blending. When omitted,
28
+ * conversion follows the active blend space automatically.
29
+ * @default undefined
30
+ */
31
+ encodeLinear?: boolean;
26
32
  /**
27
33
  * Pass in a THREE.Timer to synchronize time-based effects across different
28
34
  * systems. A supplied timer remains owned and updated by the caller.
@@ -54,15 +60,9 @@ export interface GaussianSplatRendererOptions {
54
60
  * @default 1.0
55
61
  */
56
62
  minPixelRadius?: number;
57
- /**
58
- * Maximum screen-pixel radius for splat rendering, independent of the
59
- * internal projection scale used by focalAdjustment.
60
- * @default 256.0
61
- */
62
- maxPixelRadius?: number;
63
63
  /**
64
64
  * Minimum alpha value for splat rendering.
65
- * @default 0.5 / 255
65
+ * @default 1 / 255
66
66
  */
67
67
  minAlpha?: number;
68
68
  /**
@@ -161,10 +161,11 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
161
161
  readonly uniforms: ReturnType<typeof GaussianSplatRenderer.makeUniforms>;
162
162
  autoUpdate: boolean;
163
163
  preUpdate: boolean;
164
+ /** @internal False for a second renderer on the same scene, so each `onFrame` runs once per frame. */
165
+ frameCallbacks: boolean;
164
166
  renderSize: THREE.Vector2;
165
167
  maxStdDev: number;
166
168
  minPixelRadius: number;
167
- maxPixelRadius: number;
168
169
  minAlpha: number;
169
170
  preBlurAmount: number;
170
171
  blurAmount: number;
@@ -183,6 +184,7 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
183
184
  private stochasticFrame;
184
185
  private _stochasticSort;
185
186
  private _premultipliedAlpha;
187
+ private _encodeLinear;
186
188
  private _transparent;
187
189
  private readonly sortedBlending;
188
190
  private _depthTest;
@@ -253,9 +255,6 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
253
255
  minPixelRadius: {
254
256
  value: number;
255
257
  };
256
- maxPixelRadius: {
257
- value: number;
258
- };
259
258
  minAlpha: {
260
259
  value: number;
261
260
  };
@@ -353,6 +352,9 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
353
352
  */
354
353
  private getGenerationCamera;
355
354
  private driveSort;
355
+ /** Decode sRGB before blending; undefined follows the active blend space. */
356
+ get encodeLinear(): boolean | undefined;
357
+ set encodeLinear(value: boolean | undefined);
356
358
  get premultipliedAlpha(): boolean;
357
359
  set premultipliedAlpha(value: boolean);
358
360
  get transparent(): boolean;
@@ -61,13 +61,14 @@ export declare class SplatAccumulator {
61
61
  count: number;
62
62
  renderer: GaussianSplatCompatibleRenderer;
63
63
  }): void;
64
- prepareGenerate({ renderer, scene, timer, camera, layerCamera, previous, }: {
64
+ prepareGenerate({ renderer, scene, timer, camera, layerCamera, previous, frameCallbacks, }: {
65
65
  renderer: GaussianSplatCompatibleRenderer;
66
66
  scene: THREE.Scene;
67
67
  timer: THREE.Timer;
68
68
  camera: THREE.Camera;
69
69
  layerCamera?: THREE.Camera;
70
70
  previous: SplatAccumulator;
71
+ frameCallbacks?: boolean;
71
72
  }): {
72
73
  version: number;
73
74
  sortUpdated: boolean;
@@ -61,13 +61,14 @@ export declare class SplatAccumulator {
61
61
  count: number;
62
62
  renderer: GaussianSplatCompatibleRenderer;
63
63
  }): void;
64
- prepareGenerate({ renderer, scene, timer, camera, layerCamera, previous, }: {
64
+ prepareGenerate({ renderer, scene, timer, camera, layerCamera, previous, frameCallbacks, }: {
65
65
  renderer: GaussianSplatCompatibleRenderer;
66
66
  scene: THREE.Scene;
67
67
  timer: THREE.Timer;
68
68
  camera: THREE.Camera;
69
69
  layerCamera?: THREE.Camera;
70
70
  previous: SplatAccumulator;
71
+ frameCallbacks?: boolean;
71
72
  }): {
72
73
  version: number;
73
74
  sortUpdated: boolean;
@@ -7,7 +7,7 @@ import { WebGPUSplatBackend } from './webgpu/SplatBackend.cjs';
7
7
  import * as THREE from "three";
8
8
  export type SplatBackend = WebGLSplatBackend | WebGPUSplatBackend | WebGLFallbackSplatBackend;
9
9
  export declare function createSplatBackend(renderer: GaussianSplatCompatibleRenderer, uniforms: Uniforms, options: SplatMaterialOptions): SplatBackend;
10
- export declare function configureSplatOutput(renderer: GaussianSplatCompatibleRenderer, target: THREE.RenderTarget | null, uniforms: Uniforms): void;
10
+ export declare function configureSplatOutput(renderer: GaussianSplatCompatibleRenderer, target: THREE.RenderTarget | null, uniforms: Uniforms, encodeLinear?: boolean): void;
11
11
  export type CPUOrderingUpdate = {
12
12
  ordering: Uint32Array;
13
13
  activeSplats: number;
@@ -7,7 +7,7 @@ import { WebGPUSplatBackend } from './webgpu/SplatBackend';
7
7
  import * as THREE from "three";
8
8
  export type SplatBackend = WebGLSplatBackend | WebGPUSplatBackend | WebGLFallbackSplatBackend;
9
9
  export declare function createSplatBackend(renderer: GaussianSplatCompatibleRenderer, uniforms: Uniforms, options: SplatMaterialOptions): SplatBackend;
10
- export declare function configureSplatOutput(renderer: GaussianSplatCompatibleRenderer, target: THREE.RenderTarget | null, uniforms: Uniforms): void;
10
+ export declare function configureSplatOutput(renderer: GaussianSplatCompatibleRenderer, target: THREE.RenderTarget | null, uniforms: Uniforms, encodeLinear?: boolean): void;
11
11
  export type CPUOrderingUpdate = {
12
12
  ordering: Uint32Array;
13
13
  activeSplats: number;
@@ -2,11 +2,7 @@ import * as THREE from "three";
2
2
  type WebGPURenderer = import('three/webgpu').WebGPURenderer;
3
3
  export type GaussianSplatCompatibleRenderer = THREE.WebGLRenderer | WebGPURenderer;
4
4
  export declare function isWebGPURenderer(renderer: GaussianSplatCompatibleRenderer): renderer is WebGPURenderer;
5
- export declare function usesNativeWebGPU(renderer: GaussianSplatCompatibleRenderer): renderer is WebGPURenderer & {
6
- backend: {
7
- isWebGPUBackend: true;
8
- };
9
- };
5
+ export declare function usesNativeWebGPU(renderer: GaussianSplatCompatibleRenderer): boolean;
10
6
  /**
11
7
  * The eyes of a WebXR camera, or the camera itself. An ArrayCamera without
12
8
  * eyes draws as a single view.
@@ -2,11 +2,7 @@ import * as THREE from "three";
2
2
  type WebGPURenderer = import('three/webgpu').WebGPURenderer;
3
3
  export type GaussianSplatCompatibleRenderer = THREE.WebGLRenderer | WebGPURenderer;
4
4
  export declare function isWebGPURenderer(renderer: GaussianSplatCompatibleRenderer): renderer is WebGPURenderer;
5
- export declare function usesNativeWebGPU(renderer: GaussianSplatCompatibleRenderer): renderer is WebGPURenderer & {
6
- backend: {
7
- isWebGPUBackend: true;
8
- };
9
- };
5
+ export declare function usesNativeWebGPU(renderer: GaussianSplatCompatibleRenderer): boolean;
10
6
  /**
11
7
  * The eyes of a WebXR camera, or the camera itself. An ArrayCamera without
12
8
  * eyes draws as a single view.
@@ -37,6 +37,7 @@ type UintWorkgroup = WorkgroupInfoNode & {
37
37
  setName(name: string): UintWorkgroup;
38
38
  };
39
39
  type Compatibility = {
40
+ convertColorSpace(value: Node<"vec4">, source: string, target: string): Node<"vec4">;
40
41
  floatBitsToUint<T extends keyof FloatToUint>(value: Node<T>): Node<FloatToUint[T]>;
41
42
  uintBitsToFloat<T extends keyof UintToFloat>(value: Node<T>): Node<UintToFloat[T]>;
42
43
  packHalf2x16(value: Node<"vec2">): Node<"uint">;
@@ -37,6 +37,7 @@ type UintWorkgroup = WorkgroupInfoNode & {
37
37
  setName(name: string): UintWorkgroup;
38
38
  };
39
39
  type Compatibility = {
40
+ convertColorSpace(value: Node<"vec4">, source: string, target: string): Node<"vec4">;
40
41
  floatBitsToUint<T extends keyof FloatToUint>(value: Node<T>): Node<FloatToUint[T]>;
41
42
  uintBitsToFloat<T extends keyof UintToFloat>(value: Node<T>): Node<UintToFloat[T]>;
42
43
  packHalf2x16(value: Node<"vec2">): Node<"uint">;
@@ -35,9 +35,6 @@ export declare function makeSplatUniforms(): {
35
35
  minPixelRadius: {
36
36
  value: number;
37
37
  };
38
- maxPixelRadius: {
39
- value: number;
40
- };
41
38
  minAlpha: {
42
39
  value: number;
43
40
  };
@@ -35,9 +35,6 @@ export declare function makeSplatUniforms(): {
35
35
  minPixelRadius: {
36
36
  value: number;
37
37
  };
38
- maxPixelRadius: {
39
- value: number;
40
- };
41
38
  minAlpha: {
42
39
  value: number;
43
40
  };
@@ -70,7 +70,7 @@ export declare class SplatMesh extends THREE.Object3D {
70
70
  dispose(): void;
71
71
  /** Copy cached local bounds; false includes scale/rotation and shape at source alpha 0.01. */
72
72
  getBoundingBox(centersOnly?: boolean, target?: THREE.Box3): THREE.Box3;
73
- frameUpdate({ time, deltaTime, globalEdits }: SplatMeshFrameContext): void;
73
+ frameUpdate({ time, deltaTime, globalEdits }: SplatMeshFrameContext, callbacks?: boolean): void;
74
74
  updateVersion({ sort }?: {
75
75
  sort?: boolean;
76
76
  }): void;
@@ -70,7 +70,7 @@ export declare class SplatMesh extends THREE.Object3D {
70
70
  dispose(): void;
71
71
  /** Copy cached local bounds; false includes scale/rotation and shape at source alpha 0.01. */
72
72
  getBoundingBox(centersOnly?: boolean, target?: THREE.Box3): THREE.Box3;
73
- frameUpdate({ time, deltaTime, globalEdits }: SplatMeshFrameContext): void;
73
+ frameUpdate({ time, deltaTime, globalEdits }: SplatMeshFrameContext, callbacks?: boolean): void;
74
74
  updateVersion({ sort }?: {
75
75
  sort?: boolean;
76
76
  }): void;