mirror of
https://github.com/storytold/spark.git
synced 2026-10-09 00:09:53 +00:00
Bump dist build
This commit is contained in:
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-1
@@ -1 +0,0 @@
|
||||
036a74f83f15454b92ba145ae743052e65ea1ee1
|
||||
Vendored
+305
-87
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+112
-83
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+305
-87
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+4262
-4081
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+20
@@ -4,6 +4,19 @@ import { SplatFileType } from './SplatLoader';
|
||||
import { DynoProgram, DynoProgramTemplate, DynoUniform } from './dyno';
|
||||
import { TPackedSplats } from './dyno/splats';
|
||||
import * as THREE from "three";
|
||||
export type SplatEncoding = {
|
||||
rgbMin?: number;
|
||||
rgbMax?: number;
|
||||
lnScaleMin?: number;
|
||||
lnScaleMax?: number;
|
||||
sh1Min?: number;
|
||||
sh1Max?: number;
|
||||
sh2Min?: number;
|
||||
sh2Max?: number;
|
||||
sh3Min?: number;
|
||||
sh3Max?: number;
|
||||
};
|
||||
export declare const DEFAULT_SPLAT_ENCODING: SplatEncoding;
|
||||
export type PackedSplatsOptions = {
|
||||
url?: string;
|
||||
fileBytes?: Uint8Array | ArrayBuffer;
|
||||
@@ -14,18 +27,24 @@ export type PackedSplatsOptions = {
|
||||
numSplats?: number;
|
||||
construct?: (splats: PackedSplats) => Promise<void> | void;
|
||||
extra?: Record<string, unknown>;
|
||||
splatEncoding?: SplatEncoding;
|
||||
};
|
||||
export declare class PackedSplats {
|
||||
maxSplats: number;
|
||||
numSplats: number;
|
||||
packedArray: Uint32Array | null;
|
||||
extra: Record<string, unknown>;
|
||||
splatEncoding?: SplatEncoding;
|
||||
initialized: Promise<PackedSplats>;
|
||||
isInitialized: boolean;
|
||||
target: THREE.WebGLArrayRenderTarget | null;
|
||||
source: THREE.DataArrayTexture | null;
|
||||
needsUpdate: boolean;
|
||||
dyno: DynoUniform<typeof TPackedSplats, "packedSplats">;
|
||||
dynoRgbMinMaxLnScaleMinMax: DynoUniform<"vec4", "rgbMinMaxLnScaleMinMax">;
|
||||
dynoSh1MinMax: DynoUniform<"vec2", "sh1MinMax">;
|
||||
dynoSh2MinMax: DynoUniform<"vec2", "sh2MinMax">;
|
||||
dynoSh3MinMax: DynoUniform<"vec2", "sh3MinMax">;
|
||||
constructor(options?: PackedSplatsOptions);
|
||||
reinitialize(options: PackedSplatsOptions): void;
|
||||
initialize(options: PackedSplatsOptions): void;
|
||||
@@ -77,6 +96,7 @@ export declare const dynoPackedSplats: (packedSplats?: PackedSplats) => DynoPack
|
||||
export declare class DynoPackedSplats extends DynoUniform<typeof TPackedSplats, "packedSplats", {
|
||||
texture: THREE.DataArrayTexture;
|
||||
numSplats: number;
|
||||
rgbMinMaxLnScaleMinMax: THREE.Vector4;
|
||||
}> {
|
||||
packedSplats?: PackedSplats;
|
||||
constructor({ packedSplats }?: {
|
||||
|
||||
Vendored
+20
@@ -1,3 +1,4 @@
|
||||
import { SplatEncoding } from './PackedSplats';
|
||||
import { RgbaArray } from './RgbaArray';
|
||||
import { SparkViewpoint, SparkViewpointOptions } from './SparkViewpoint';
|
||||
import { SplatAccumulator } from './SplatAccumulator';
|
||||
@@ -11,6 +12,11 @@ export type SparkRendererOptions = {
|
||||
* rendering and significantly reduces performance.
|
||||
*/
|
||||
renderer: THREE.WebGLRenderer;
|
||||
/**
|
||||
* Whether to use premultiplied alpha when accumulating splat RGB
|
||||
* @default true
|
||||
*/
|
||||
premultipliedAlpha?: boolean;
|
||||
/**
|
||||
* Pass in a THREE.Clock to synchronize time-based effects across different
|
||||
* systems. Alternatively, you can set the SparkRenderer properties time and
|
||||
@@ -110,13 +116,20 @@ export type SparkRendererOptions = {
|
||||
* radial distance or Z-depth)
|
||||
*/
|
||||
view?: SparkViewpointOptions;
|
||||
/**
|
||||
* Override the default splat encoding ranges for the PackedSplats.
|
||||
* (default: undefined)
|
||||
*/
|
||||
splatEncoding?: SplatEncoding;
|
||||
};
|
||||
export declare class SparkRenderer extends THREE.Mesh {
|
||||
renderer: THREE.WebGLRenderer;
|
||||
premultipliedAlpha: boolean;
|
||||
material: THREE.ShaderMaterial;
|
||||
uniforms: ReturnType<typeof SparkRenderer.makeUniforms>;
|
||||
autoUpdate: boolean;
|
||||
preUpdate: boolean;
|
||||
needsUpdate: boolean;
|
||||
originDistance: number;
|
||||
maxStdDev: number;
|
||||
maxPixelRadius: number;
|
||||
@@ -129,6 +142,7 @@ export declare class SparkRenderer extends THREE.Mesh {
|
||||
falloff: number;
|
||||
clipXY: number;
|
||||
focalAdjustment: number;
|
||||
splatEncoding: SplatEncoding;
|
||||
splatTexture: null | {
|
||||
enable?: boolean;
|
||||
texture?: THREE.Data3DTexture;
|
||||
@@ -237,12 +251,18 @@ export declare class SparkRenderer extends THREE.Mesh {
|
||||
type: string;
|
||||
value: THREE.DataArrayTexture;
|
||||
};
|
||||
rgbMinMaxLnScaleMinMax: {
|
||||
value: THREE.Vector4;
|
||||
};
|
||||
time: {
|
||||
value: number;
|
||||
};
|
||||
deltaTime: {
|
||||
value: number;
|
||||
};
|
||||
premultipliedAlpha: {
|
||||
value: boolean;
|
||||
};
|
||||
encodeLinear: {
|
||||
value: boolean;
|
||||
};
|
||||
|
||||
Vendored
+3
-2
@@ -1,5 +1,5 @@
|
||||
import { FileLoader, Loader, LoadingManager } from 'three';
|
||||
import { PackedSplats } from './PackedSplats';
|
||||
import { PackedSplats, SplatEncoding } from './PackedSplats';
|
||||
import { SplatMesh } from './SplatMesh';
|
||||
export declare class SplatLoader extends Loader {
|
||||
fileLoader: FileLoader;
|
||||
@@ -64,11 +64,12 @@ export declare function tryPcSogsZip(input: ArrayBuffer | Uint8Array): {
|
||||
name: string;
|
||||
json: PcSogsJson;
|
||||
} | undefined;
|
||||
export declare function unpackSplats({ input, extraFiles, fileType, pathOrUrl, }: {
|
||||
export declare function unpackSplats({ input, extraFiles, fileType, pathOrUrl, splatEncoding, }: {
|
||||
input: Uint8Array | ArrayBuffer;
|
||||
extraFiles?: Record<string, ArrayBuffer>;
|
||||
fileType?: SplatFileType;
|
||||
pathOrUrl?: string;
|
||||
splatEncoding?: SplatEncoding;
|
||||
}): Promise<{
|
||||
packedArray: Uint32Array;
|
||||
numSplats: number;
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,4 @@
|
||||
import { PackedSplats } from './PackedSplats';
|
||||
import { PackedSplats, SplatEncoding } from './PackedSplats';
|
||||
import { RgbaArray } from './RgbaArray';
|
||||
import { SplatEdit } from './SplatEdit';
|
||||
import { GsplatModifier, SplatGenerator, SplatTransformer } from './SplatGenerator';
|
||||
@@ -23,6 +23,7 @@ export type SplatMeshOptions = {
|
||||
}) => void;
|
||||
objectModifier?: GsplatModifier;
|
||||
worldModifier?: GsplatModifier;
|
||||
splatEncoding?: SplatEncoding;
|
||||
};
|
||||
export type SplatMeshContext = {
|
||||
transform: SplatTransformer;
|
||||
|
||||
Vendored
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { SplatEncoding } from './PackedSplats';
|
||||
export declare function decodeAntiSplat(fileBytes: Uint8Array, initNumSplats: (numSplats: number) => void, splatCallback: (index: number, x: number, y: number, z: number, scaleX: number, scaleY: number, scaleZ: number, quatX: number, quatY: number, quatZ: number, quatW: number, opacity: number, r: number, g: number, b: number) => void): void;
|
||||
export declare function unpackAntiSplat(fileBytes: Uint8Array): {
|
||||
export declare function unpackAntiSplat(fileBytes: Uint8Array, splatEncoding: SplatEncoding): {
|
||||
packedArray: Uint32Array;
|
||||
numSplats: number;
|
||||
};
|
||||
|
||||
Vendored
-1
@@ -1,6 +1,5 @@
|
||||
export declare const LN_SCALE_MIN = -12;
|
||||
export declare const LN_SCALE_MAX = 9;
|
||||
export declare const LN_RESCALE: number;
|
||||
export declare const SCALE_MIN: number;
|
||||
export declare const SCALE_MAX: number;
|
||||
export declare const LN_SCALE_ZERO = -30;
|
||||
|
||||
Vendored
+4
-2
@@ -1,15 +1,17 @@
|
||||
import { Dyno } from './base';
|
||||
import { Gsplat } from './splats';
|
||||
import { DynoVal, DynoValue, HasDynoOut } from './value';
|
||||
export declare const outputPackedSplat: (gsplat: DynoVal<typeof Gsplat>) => OutputPackedSplat;
|
||||
export declare const outputPackedSplat: (gsplat: DynoVal<typeof Gsplat>, rgbMinMaxLnScaleMinMax: DynoVal<"vec4">) => OutputPackedSplat;
|
||||
export declare const outputRgba8: (rgba8: DynoVal<"vec4">) => OutputRgba8;
|
||||
export declare class OutputPackedSplat extends Dyno<{
|
||||
gsplat: typeof Gsplat;
|
||||
rgbMinMaxLnScaleMinMax: "vec4";
|
||||
}, {
|
||||
output: "uvec4";
|
||||
}> implements HasDynoOut<"uvec4"> {
|
||||
constructor({ gsplat }: {
|
||||
constructor({ gsplat, rgbMinMaxLnScaleMinMax, }: {
|
||||
gsplat?: DynoVal<typeof Gsplat>;
|
||||
rgbMinMaxLnScaleMinMax?: DynoVal<"vec4">;
|
||||
});
|
||||
dynoOut(): DynoValue<"uvec4">;
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -19,3 +19,5 @@ export { type JointId, JointEnum, JOINT_IDS, NUM_JOINTS, JOINT_INDEX, JOINT_RADI
|
||||
export { SparkControls, FpsMovement, PointerControls } from './controls';
|
||||
export { isMobile, isAndroid, isOculus, flipPixels, pixelsToPngUrl, toHalf, fromHalf, floatToUint8, floatToSint8, Uint8ToFloat, Sint8ToFloat, setPackedSplat, unpackSplat, } from './utils';
|
||||
export * as utils from './utils';
|
||||
export { LN_SCALE_MIN, LN_SCALE_MAX } from './defines';
|
||||
export * as defines from './defines';
|
||||
|
||||
Vendored
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { SplatEncoding } from './PackedSplats';
|
||||
export declare function decodeKsplat(fileBytes: Uint8Array, initNumSplats: (numSplats: number) => void, splatCallback: (index: number, x: number, y: number, z: number, scaleX: number, scaleY: number, scaleZ: number, quatX: number, quatY: number, quatZ: number, quatW: number, opacity: number, r: number, g: number, b: number) => void, shCallback?: (index: number, sh1: Float32Array, sh2?: Float32Array, sh3?: Float32Array) => void): void;
|
||||
export declare function unpackKsplat(fileBytes: Uint8Array): {
|
||||
export declare function unpackKsplat(fileBytes: Uint8Array, splatEncoding: SplatEncoding): {
|
||||
packedArray: Uint32Array;
|
||||
numSplats: number;
|
||||
extra: Record<string, unknown>;
|
||||
|
||||
Vendored
+3
-2
@@ -1,10 +1,11 @@
|
||||
import { SplatEncoding } from './PackedSplats';
|
||||
import { PcSogsJson } from './SplatLoader';
|
||||
export declare function unpackPcSogs(json: PcSogsJson, extraFiles: Record<string, ArrayBuffer>): Promise<{
|
||||
export declare function unpackPcSogs(json: PcSogsJson, extraFiles: Record<string, ArrayBuffer>, splatEncoding: SplatEncoding): Promise<{
|
||||
packedArray: Uint32Array;
|
||||
numSplats: number;
|
||||
extra: Record<string, unknown>;
|
||||
}>;
|
||||
export declare function unpackPcSogsZip(fileBytes: Uint8Array): Promise<{
|
||||
export declare function unpackPcSogsZip(fileBytes: Uint8Array, splatEncoding: SplatEncoding): Promise<{
|
||||
packedArray: Uint32Array;
|
||||
numSplats: number;
|
||||
extra: Record<string, unknown>;
|
||||
|
||||
Vendored
+36
-8
@@ -39,14 +39,33 @@ export declare class FreeList<T, Args> {
|
||||
free(item: T): void;
|
||||
disposeAll(): void;
|
||||
}
|
||||
export declare function setPackedSplat(packedSplats: Uint32Array, index: number, x: number, y: number, z: number, scaleX: number, scaleY: number, scaleZ: number, quatX: number, quatY: number, quatZ: number, quatW: number, opacity: number, r: number, g: number, b: number): void;
|
||||
export declare function setPackedSplat(packedSplats: Uint32Array, index: number, x: number, y: number, z: number, scaleX: number, scaleY: number, scaleZ: number, quatX: number, quatY: number, quatZ: number, quatW: number, opacity: number, r: number, g: number, b: number, encoding?: {
|
||||
rgbMin?: number;
|
||||
rgbMax?: number;
|
||||
lnScaleMin?: number;
|
||||
lnScaleMax?: number;
|
||||
}): void;
|
||||
export declare function setPackedSplatCenter(packedSplats: Uint32Array, index: number, x: number, y: number, z: number): void;
|
||||
export declare function setPackedSplatScales(packedSplats: Uint32Array, index: number, scaleX: number, scaleY: number, scaleZ: number): void;
|
||||
export declare function setPackedSplatScales(packedSplats: Uint32Array, index: number, scaleX: number, scaleY: number, scaleZ: number, encoding?: {
|
||||
lnScaleMin?: number;
|
||||
lnScaleMax?: number;
|
||||
}): void;
|
||||
export declare function setPackedSplatQuat(packedSplats: Uint32Array, index: number, quatX: number, quatY: number, quatZ: number, quatW: number): void;
|
||||
export declare function setPackedSplatRgba(packedSplats: Uint32Array, index: number, r: number, g: number, b: number, a: number): void;
|
||||
export declare function setPackedSplatRgb(packedSplats: Uint32Array, index: number, r: number, g: number, b: number): void;
|
||||
export declare function setPackedSplatRgba(packedSplats: Uint32Array, index: number, r: number, g: number, b: number, a: number, encoding?: {
|
||||
rgbMin?: number;
|
||||
rgbMax?: number;
|
||||
}): void;
|
||||
export declare function setPackedSplatRgb(packedSplats: Uint32Array, index: number, r: number, g: number, b: number, encoding?: {
|
||||
rgbMin?: number;
|
||||
rgbMax?: number;
|
||||
}): void;
|
||||
export declare function setPackedSplatOpacity(packedSplats: Uint32Array, index: number, opacity: number): void;
|
||||
export declare function unpackSplat(packedSplats: Uint32Array, index: number): {
|
||||
export declare function unpackSplat(packedSplats: Uint32Array, index: number, encoding?: {
|
||||
rgbMin?: number;
|
||||
rgbMax?: number;
|
||||
lnScaleMin?: number;
|
||||
lnScaleMax?: number;
|
||||
}): {
|
||||
center: THREE.Vector3;
|
||||
scales: THREE.Vector3;
|
||||
quaternion: THREE.Quaternion;
|
||||
@@ -132,9 +151,18 @@ export declare function encodeQuatEulerXyz888(q: THREE.Quaternion): number;
|
||||
* and then converting them back to Euler angles in [-π, π] and to a quaternion.
|
||||
*/
|
||||
export declare function decodeQuatEulerXyz888(encoded: number, out: THREE.Quaternion): THREE.Quaternion;
|
||||
export declare function encodeSh1Rgb(sh1Array: Uint32Array, index: number, sh1Rgb: Float32Array): void;
|
||||
export declare function encodeSh2Rgb(sh2Array: Uint32Array, index: number, sh2Rgb: Float32Array): void;
|
||||
export declare function encodeSh3Rgb(sh3Array: Uint32Array, index: number, sh3Rgb: Float32Array): void;
|
||||
export declare function encodeSh1Rgb(sh1Array: Uint32Array, index: number, sh1Rgb: Float32Array, encoding?: {
|
||||
sh1Min?: number;
|
||||
sh1Max?: number;
|
||||
}): void;
|
||||
export declare function encodeSh2Rgb(sh2Array: Uint32Array, index: number, sh2Rgb: Float32Array, encoding?: {
|
||||
sh2Min?: number;
|
||||
sh2Max?: number;
|
||||
}): void;
|
||||
export declare function encodeSh3Rgb(sh3Array: Uint32Array, index: number, sh3Rgb: Float32Array, encoding?: {
|
||||
sh3Min?: number;
|
||||
sh3Max?: number;
|
||||
}): void;
|
||||
export declare function decompressPartialGzip(fileBytes: Uint8Array, numBytes: number): Uint8Array;
|
||||
export declare class GunzipReader {
|
||||
fileBytes: Uint8Array;
|
||||
|
||||
Reference in New Issue
Block a user