gaussian-splat-lite 1.2.0 → 1.2.2
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.
- package/CHANGELOG.md +44 -2
- package/README.md +22 -13
- package/dist/gaussian-splat-lite.cjs +819 -88
- package/dist/gaussian-splat-lite.cjs.map +1 -1
- package/dist/gaussian-splat-lite.min.cjs +81 -20
- package/dist/gaussian-splat-lite.min.cjs.map +1 -1
- package/dist/gaussian-splat-lite.module.js +821 -90
- package/dist/gaussian-splat-lite.module.js.map +1 -1
- package/dist/gaussian-splat-lite.module.min.js +2984 -2427
- package/dist/gaussian-splat-lite.module.min.js.map +1 -1
- package/dist/types/addons/TAANode.d.cts +4 -2
- package/dist/types/addons/TAANode.d.ts +4 -2
- package/dist/types/addons/TAAPass.d.cts +6 -15
- package/dist/types/addons/TAAPass.d.ts +6 -15
- package/dist/types/addons/taaShared.d.cts +4 -2
- package/dist/types/addons/taaShared.d.ts +4 -2
- package/dist/types/capture/SplatCapture.d.cts +66 -0
- package/dist/types/capture/SplatCapture.d.ts +66 -0
- package/dist/types/capture/WebGLCapture.d.cts +13 -0
- package/dist/types/capture/WebGLCapture.d.ts +13 -0
- package/dist/types/capture/WebGPUCapture.d.cts +17 -0
- package/dist/types/capture/WebGPUCapture.d.ts +17 -0
- package/dist/types/capture/pixels.d.cts +5 -0
- package/dist/types/capture/pixels.d.ts +5 -0
- package/dist/types/capture/rendererState.d.cts +3 -0
- package/dist/types/capture/rendererState.d.ts +3 -0
- package/dist/types/capture/sceneView.d.cts +3 -0
- package/dist/types/capture/sceneView.d.ts +3 -0
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/rendering/GaussianSplatRenderer.d.cts +17 -11
- package/dist/types/rendering/GaussianSplatRenderer.d.ts +17 -11
- package/dist/types/rendering/SplatAccumulator.d.cts +2 -1
- package/dist/types/rendering/SplatAccumulator.d.ts +2 -1
- package/dist/types/rendering/backend.d.cts +1 -1
- package/dist/types/rendering/backend.d.ts +1 -1
- package/dist/types/rendering/rendererUtils.d.cts +1 -5
- package/dist/types/rendering/rendererUtils.d.ts +1 -5
- package/dist/types/rendering/tsl/ProjectionProgram.d.cts +2 -0
- package/dist/types/rendering/tsl/ProjectionProgram.d.ts +2 -0
- package/dist/types/rendering/tsl/SplatMaterial.d.cts +1 -0
- package/dist/types/rendering/tsl/SplatMaterial.d.ts +1 -0
- package/dist/types/rendering/tsl/tslCompat.d.cts +1 -0
- package/dist/types/rendering/tsl/tslCompat.d.ts +1 -0
- package/dist/types/rendering/uniforms.d.cts +3 -3
- package/dist/types/rendering/uniforms.d.ts +3 -3
- package/dist/types/scene/SplatMesh.d.cts +1 -1
- package/dist/types/scene/SplatMesh.d.ts +1 -1
- package/docs/Architecture.md +54 -3
- package/docs/GaussianSplatRenderer.md +71 -55
- package/docs/PostDecode.md +52 -36
- package/docs/RadStreamScheduler.md +53 -41
- package/docs/SogStreamScheduler.md +49 -39
- package/docs/SplatCapture.md +147 -0
- package/docs/SplatEdit.md +33 -26
- package/docs/SplatFileType.md +11 -13
- package/docs/SplatLoader.md +19 -14
- package/docs/SplatMesh.md +69 -49
- package/docs/Splats.md +33 -26
- package/docs/StochasticRendering.md +27 -30
- package/docs/TAAPass.md +98 -73
- package/package.json +1 -1
- package/docs/SplatAccumulator.md +0 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DepthTexture, Matrix4, OrthographicCamera, PerspectiveCamera, Scene } from 'three';
|
|
2
|
-
import { NodeBuilder, NodeFrame,
|
|
2
|
+
import { Node, NodeBuilder, NodeFrame, TextureNode } from 'three/webgpu';
|
|
3
3
|
/** Camera/depth TAA for WebGPURenderer, including its WebGL2 fallback. */
|
|
4
|
-
export declare class TAANode extends
|
|
4
|
+
export declare class TAANode extends Node<"vec4"> {
|
|
5
5
|
scene: Scene;
|
|
6
6
|
camera: PerspectiveCamera | OrthographicCamera;
|
|
7
7
|
static get type(): string;
|
|
@@ -11,6 +11,8 @@ export declare class TAANode extends TempNode<"vec4"> {
|
|
|
11
11
|
useSubpixelCorrection: boolean;
|
|
12
12
|
private readonly source;
|
|
13
13
|
private readonly history;
|
|
14
|
+
private readonly historyColor;
|
|
15
|
+
private readonly historyDepth;
|
|
14
16
|
private readonly textureNode;
|
|
15
17
|
private readonly material;
|
|
16
18
|
private readonly quad;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DepthTexture, Matrix4, OrthographicCamera, PerspectiveCamera, Scene } from 'three';
|
|
2
|
-
import { NodeBuilder, NodeFrame,
|
|
2
|
+
import { Node, NodeBuilder, NodeFrame, TextureNode } from 'three/webgpu';
|
|
3
3
|
/** Camera/depth TAA for WebGPURenderer, including its WebGL2 fallback. */
|
|
4
|
-
export declare class TAANode extends
|
|
4
|
+
export declare class TAANode extends Node<"vec4"> {
|
|
5
5
|
scene: Scene;
|
|
6
6
|
camera: PerspectiveCamera | OrthographicCamera;
|
|
7
7
|
static get type(): string;
|
|
@@ -11,6 +11,8 @@ export declare class TAANode extends TempNode<"vec4"> {
|
|
|
11
11
|
useSubpixelCorrection: boolean;
|
|
12
12
|
private readonly source;
|
|
13
13
|
private readonly history;
|
|
14
|
+
private readonly historyColor;
|
|
15
|
+
private readonly historyDepth;
|
|
14
16
|
private readonly textureNode;
|
|
15
17
|
private readonly material;
|
|
16
18
|
private readonly quad;
|
|
@@ -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.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
49
|
-
render(renderer: WebGLRenderer, writeBuffer
|
|
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.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
49
|
-
render(renderer: WebGLRenderer, writeBuffer
|
|
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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Camera, Matrix4, OrthographicCamera, PerspectiveCamera, RenderTarget, Vector2, Vector3 } from 'three';
|
|
1
|
+
import { Camera, Matrix4, OrthographicCamera, PerspectiveCamera, RenderTarget, TextureDataType, Vector2, Vector3 } from 'three';
|
|
2
2
|
type TAACamera = PerspectiveCamera | OrthographicCamera;
|
|
3
3
|
type TAAParameters = {
|
|
4
4
|
depthThreshold: number;
|
|
@@ -22,7 +22,7 @@ export declare function createTAAState<FloatUniform extends {
|
|
|
22
22
|
(value: Vector2): Vec2Uniform;
|
|
23
23
|
(value: Vector3): Vec3Uniform;
|
|
24
24
|
(value: Matrix4): Mat4Uniform;
|
|
25
|
-
}, targets: RenderTarget[]): {
|
|
25
|
+
}, targets: RenderTarget[], nodeLogDepth?: boolean): {
|
|
26
26
|
uniforms: {
|
|
27
27
|
renderSize: Vec2Uniform;
|
|
28
28
|
projection: Mat4Uniform;
|
|
@@ -34,6 +34,7 @@ export declare function createTAAState<FloatUniform extends {
|
|
|
34
34
|
reversed: BoolUniform;
|
|
35
35
|
logarithmic: BoolUniform;
|
|
36
36
|
logFar: Vec2Uniform;
|
|
37
|
+
logNear: Vec2Uniform;
|
|
37
38
|
depthThreshold: FloatUniform;
|
|
38
39
|
edgeDepthDiff: FloatUniform;
|
|
39
40
|
maxMotionLength: FloatUniform;
|
|
@@ -44,6 +45,7 @@ export declare function createTAAState<FloatUniform extends {
|
|
|
44
45
|
jitterIndex: number;
|
|
45
46
|
reset(): void;
|
|
46
47
|
setSize(width: number, height: number): void;
|
|
48
|
+
setStencil(stencil: boolean, depthType: TextureDataType): void;
|
|
47
49
|
beginCapture(camera: TAACamera): void;
|
|
48
50
|
endCapture(camera: TAACamera): void;
|
|
49
51
|
prepareResolve(camera: TAACamera, parameters: TAAParameters): 0 | 1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Camera, Matrix4, OrthographicCamera, PerspectiveCamera, RenderTarget, Vector2, Vector3 } from 'three';
|
|
1
|
+
import { Camera, Matrix4, OrthographicCamera, PerspectiveCamera, RenderTarget, TextureDataType, Vector2, Vector3 } from 'three';
|
|
2
2
|
type TAACamera = PerspectiveCamera | OrthographicCamera;
|
|
3
3
|
type TAAParameters = {
|
|
4
4
|
depthThreshold: number;
|
|
@@ -22,7 +22,7 @@ export declare function createTAAState<FloatUniform extends {
|
|
|
22
22
|
(value: Vector2): Vec2Uniform;
|
|
23
23
|
(value: Vector3): Vec3Uniform;
|
|
24
24
|
(value: Matrix4): Mat4Uniform;
|
|
25
|
-
}, targets: RenderTarget[]): {
|
|
25
|
+
}, targets: RenderTarget[], nodeLogDepth?: boolean): {
|
|
26
26
|
uniforms: {
|
|
27
27
|
renderSize: Vec2Uniform;
|
|
28
28
|
projection: Mat4Uniform;
|
|
@@ -34,6 +34,7 @@ export declare function createTAAState<FloatUniform extends {
|
|
|
34
34
|
reversed: BoolUniform;
|
|
35
35
|
logarithmic: BoolUniform;
|
|
36
36
|
logFar: Vec2Uniform;
|
|
37
|
+
logNear: Vec2Uniform;
|
|
37
38
|
depthThreshold: FloatUniform;
|
|
38
39
|
edgeDepthDiff: FloatUniform;
|
|
39
40
|
maxMotionLength: FloatUniform;
|
|
@@ -44,6 +45,7 @@ export declare function createTAAState<FloatUniform extends {
|
|
|
44
45
|
jitterIndex: number;
|
|
45
46
|
reset(): void;
|
|
46
47
|
setSize(width: number, height: number): void;
|
|
48
|
+
setStencil(stencil: boolean, depthType: TextureDataType): void;
|
|
47
49
|
beginCapture(camera: TAACamera): void;
|
|
48
50
|
endCapture(camera: TAACamera): void;
|
|
49
51
|
prepareResolve(camera: TAACamera, parameters: TAAParameters): 0 | 1;
|
|
@@ -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;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -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';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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.
|
|
@@ -44,7 +50,8 @@ export interface GaussianSplatRendererOptions {
|
|
|
44
50
|
/**
|
|
45
51
|
* Maximum standard deviations from the center to render Gaussians. Values
|
|
46
52
|
* Math.sqrt(4)..Math.sqrt(9) produce acceptable results and can be tweaked for
|
|
47
|
-
* performance.
|
|
53
|
+
* performance. A Gaussian still above minAlpha at this distance fades to
|
|
54
|
+
* minAlpha there instead of ending in a step.
|
|
48
55
|
* @default Math.sqrt(8)
|
|
49
56
|
*/
|
|
50
57
|
maxStdDev?: number;
|
|
@@ -54,12 +61,6 @@ export interface GaussianSplatRendererOptions {
|
|
|
54
61
|
* @default 1.0
|
|
55
62
|
*/
|
|
56
63
|
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
64
|
/**
|
|
64
65
|
* Minimum alpha value for splat rendering.
|
|
65
66
|
* @default 0.5 / 255
|
|
@@ -161,10 +162,11 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
161
162
|
readonly uniforms: ReturnType<typeof GaussianSplatRenderer.makeUniforms>;
|
|
162
163
|
autoUpdate: boolean;
|
|
163
164
|
preUpdate: boolean;
|
|
165
|
+
/** @internal False for a second renderer on the same scene, so each `onFrame` runs once per frame. */
|
|
166
|
+
frameCallbacks: boolean;
|
|
164
167
|
renderSize: THREE.Vector2;
|
|
165
168
|
maxStdDev: number;
|
|
166
169
|
minPixelRadius: number;
|
|
167
|
-
maxPixelRadius: number;
|
|
168
170
|
minAlpha: number;
|
|
169
171
|
preBlurAmount: number;
|
|
170
172
|
blurAmount: number;
|
|
@@ -183,6 +185,7 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
183
185
|
private stochasticFrame;
|
|
184
186
|
private _stochasticSort;
|
|
185
187
|
private _premultipliedAlpha;
|
|
188
|
+
private _encodeLinear;
|
|
186
189
|
private _transparent;
|
|
187
190
|
private readonly sortedBlending;
|
|
188
191
|
private _depthTest;
|
|
@@ -253,12 +256,12 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
253
256
|
minPixelRadius: {
|
|
254
257
|
value: number;
|
|
255
258
|
};
|
|
256
|
-
maxPixelRadius: {
|
|
257
|
-
value: number;
|
|
258
|
-
};
|
|
259
259
|
minAlpha: {
|
|
260
260
|
value: number;
|
|
261
261
|
};
|
|
262
|
+
edgeFade: {
|
|
263
|
+
value: THREE.Vector2;
|
|
264
|
+
};
|
|
262
265
|
preBlurAmount: {
|
|
263
266
|
value: number;
|
|
264
267
|
};
|
|
@@ -353,6 +356,9 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
353
356
|
*/
|
|
354
357
|
private getGenerationCamera;
|
|
355
358
|
private driveSort;
|
|
359
|
+
/** Decode sRGB before blending; undefined follows the active blend space. */
|
|
360
|
+
get encodeLinear(): boolean | undefined;
|
|
361
|
+
set encodeLinear(value: boolean | undefined);
|
|
356
362
|
get premultipliedAlpha(): boolean;
|
|
357
363
|
set premultipliedAlpha(value: boolean);
|
|
358
364
|
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.
|
|
@@ -44,7 +50,8 @@ export interface GaussianSplatRendererOptions {
|
|
|
44
50
|
/**
|
|
45
51
|
* Maximum standard deviations from the center to render Gaussians. Values
|
|
46
52
|
* Math.sqrt(4)..Math.sqrt(9) produce acceptable results and can be tweaked for
|
|
47
|
-
* performance.
|
|
53
|
+
* performance. A Gaussian still above minAlpha at this distance fades to
|
|
54
|
+
* minAlpha there instead of ending in a step.
|
|
48
55
|
* @default Math.sqrt(8)
|
|
49
56
|
*/
|
|
50
57
|
maxStdDev?: number;
|
|
@@ -54,12 +61,6 @@ export interface GaussianSplatRendererOptions {
|
|
|
54
61
|
* @default 1.0
|
|
55
62
|
*/
|
|
56
63
|
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
64
|
/**
|
|
64
65
|
* Minimum alpha value for splat rendering.
|
|
65
66
|
* @default 0.5 / 255
|
|
@@ -161,10 +162,11 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
161
162
|
readonly uniforms: ReturnType<typeof GaussianSplatRenderer.makeUniforms>;
|
|
162
163
|
autoUpdate: boolean;
|
|
163
164
|
preUpdate: boolean;
|
|
165
|
+
/** @internal False for a second renderer on the same scene, so each `onFrame` runs once per frame. */
|
|
166
|
+
frameCallbacks: boolean;
|
|
164
167
|
renderSize: THREE.Vector2;
|
|
165
168
|
maxStdDev: number;
|
|
166
169
|
minPixelRadius: number;
|
|
167
|
-
maxPixelRadius: number;
|
|
168
170
|
minAlpha: number;
|
|
169
171
|
preBlurAmount: number;
|
|
170
172
|
blurAmount: number;
|
|
@@ -183,6 +185,7 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
183
185
|
private stochasticFrame;
|
|
184
186
|
private _stochasticSort;
|
|
185
187
|
private _premultipliedAlpha;
|
|
188
|
+
private _encodeLinear;
|
|
186
189
|
private _transparent;
|
|
187
190
|
private readonly sortedBlending;
|
|
188
191
|
private _depthTest;
|
|
@@ -253,12 +256,12 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
253
256
|
minPixelRadius: {
|
|
254
257
|
value: number;
|
|
255
258
|
};
|
|
256
|
-
maxPixelRadius: {
|
|
257
|
-
value: number;
|
|
258
|
-
};
|
|
259
259
|
minAlpha: {
|
|
260
260
|
value: number;
|
|
261
261
|
};
|
|
262
|
+
edgeFade: {
|
|
263
|
+
value: THREE.Vector2;
|
|
264
|
+
};
|
|
262
265
|
preBlurAmount: {
|
|
263
266
|
value: number;
|
|
264
267
|
};
|
|
@@ -353,6 +356,9 @@ export declare class GaussianSplatRenderer extends THREE.Mesh<SplatGeometry, Spl
|
|
|
353
356
|
*/
|
|
354
357
|
private getGenerationCamera;
|
|
355
358
|
private driveSort;
|
|
359
|
+
/** Decode sRGB before blending; undefined follows the active blend space. */
|
|
360
|
+
get encodeLinear(): boolean | undefined;
|
|
361
|
+
set encodeLinear(value: boolean | undefined);
|
|
356
362
|
get premultipliedAlpha(): boolean;
|
|
357
363
|
set premultipliedAlpha(value: boolean);
|
|
358
364
|
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;
|