@sparkjsdev/spark 2.2.0 → 2.3.0

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 (59) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/worker-Bh9P1XWl.js.map +1 -0
  3. package/dist/assets/worker-ReLDjp4s.js.map +1 -0
  4. package/dist/spark.cjs.js +15280 -17548
  5. package/dist/spark.cjs.js.map +1 -1
  6. package/dist/spark.cjs.min.js +357 -358
  7. package/dist/spark.cjs.min.js.map +1 -1
  8. package/dist/spark.module.js +15397 -17778
  9. package/dist/spark.module.js.map +1 -1
  10. package/dist/spark.module.min.js +10769 -14498
  11. package/dist/spark.module.min.js.map +1 -1
  12. package/dist/types/ExtSplats.d.ts +6 -4
  13. package/dist/types/PackedSplats.d.ts +11 -9
  14. package/dist/types/Readback.d.ts +3 -3
  15. package/dist/types/RgbaArray.d.ts +3 -3
  16. package/dist/types/SparkPortals.d.ts +1 -1
  17. package/dist/types/SparkRenderer.d.ts +23 -6
  18. package/dist/types/SparkXr.d.ts +56 -74
  19. package/dist/types/SplatAccumulator.d.ts +6 -6
  20. package/dist/types/SplatEdit.d.ts +5 -1
  21. package/dist/types/SplatGenerator.d.ts +11 -3
  22. package/dist/types/SplatLoader.d.ts +5 -25
  23. package/dist/types/SplatMesh.d.ts +12 -10
  24. package/dist/types/SplatPager.d.ts +22 -4
  25. package/dist/types/SplatSkinning.d.ts +7 -7
  26. package/dist/types/SplatWorker.d.ts +1 -1
  27. package/dist/types/defines.d.ts +45 -47
  28. package/dist/types/dyno/base.d.ts +3 -3
  29. package/dist/types/dyno/convert.d.ts +3 -3
  30. package/dist/types/dyno/logic.d.ts +3 -3
  31. package/dist/types/dyno/math.d.ts +4 -4
  32. package/dist/types/dyno/mathTypes.d.ts +1 -1
  33. package/dist/types/dyno/output.d.ts +3 -3
  34. package/dist/types/dyno/program.d.ts +1 -1
  35. package/dist/types/dyno/splats.d.ts +2 -2
  36. package/dist/types/dyno/texture.d.ts +3 -3
  37. package/dist/types/dyno/transform.d.ts +2 -2
  38. package/dist/types/dyno/trig.d.ts +3 -3
  39. package/dist/types/dyno/uniforms.d.ts +3 -3
  40. package/dist/types/dyno/util.d.ts +3 -3
  41. package/dist/types/dyno/value.d.ts +2 -2
  42. package/dist/types/dyno/vecmat.d.ts +3 -3
  43. package/dist/types/dyno.d.ts +16 -16
  44. package/dist/types/generators/snow.d.ts +14 -14
  45. package/dist/types/generators/static.d.ts +1 -1
  46. package/dist/types/generators.d.ts +2 -2
  47. package/dist/types/hands.d.ts +29 -29
  48. package/dist/types/hooks.d.ts +14 -0
  49. package/dist/types/index.d.ts +25 -25
  50. package/dist/types/modifiers/depthColor.d.ts +7 -7
  51. package/dist/types/modifiers/normalColor.d.ts +3 -3
  52. package/dist/types/modifiers.d.ts +2 -2
  53. package/dist/types/splatConstructors.d.ts +2 -2
  54. package/dist/types/spz.d.ts +35 -4
  55. package/dist/types/utils.d.ts +4 -1
  56. package/dist/types/worker.d.ts +1 -1
  57. package/package.json +15 -9
  58. package/dist/assets/worker-D4QoimE1.js.map +0 -1
  59. package/dist/assets/worker-D5xrpgfn.js.map +0 -1
@@ -15,8 +15,6 @@ export declare const SPLAT_TEX_MIN_HEIGHT = 1;
15
15
  export declare const SPLAT_TEX_WIDTH_MASK: number;
16
16
  export declare const SPLAT_TEX_HEIGHT_MASK: number;
17
17
  export declare const SPLAT_TEX_DEPTH_MASK: number;
18
- export declare const WASM_SPLAT_SORT = true;
19
- export declare const USE_COMPILED_PARSER_FUNCTION = true;
20
18
  export declare enum SplatFileType {
21
19
  PLY = "ply",
22
20
  SPZ = "spz",
@@ -27,61 +25,61 @@ export declare enum SplatFileType {
27
25
  RAD = "rad"
28
26
  }
29
27
  export type SplatEncoding = {
30
- rgbMin?: number;
31
- rgbMax?: number;
32
- lnScaleMin?: number;
33
- lnScaleMax?: number;
34
- sh1Max?: number;
35
- sh2Max?: number;
36
- sh3Max?: number;
37
- lodOpacity?: boolean;
28
+ rgbMin: number;
29
+ rgbMax: number;
30
+ lnScaleMin: number;
31
+ lnScaleMax: number;
32
+ sh1Max: number;
33
+ sh2Max: number;
34
+ sh3Max: number;
35
+ lodOpacity: boolean;
38
36
  };
39
37
  export declare const DEFAULT_SPLAT_ENCODING: SplatEncoding;
40
38
  export type RadMeta = {
41
- version: number;
42
- type: string;
43
- count: number;
44
- maxSh?: number;
45
- lodTree?: boolean;
46
- chunkSize?: number;
47
- chunks: {
48
- offset: number;
49
- bytes: number;
50
- base?: number;
51
- count?: number;
52
- filename?: string;
39
+ readonly version: number;
40
+ readonly type: string;
41
+ readonly count: number;
42
+ readonly maxSh?: number;
43
+ readonly lodTree?: boolean;
44
+ readonly chunkSize?: number;
45
+ readonly chunks: {
46
+ readonly offset: number;
47
+ readonly bytes: number;
48
+ readonly base?: number;
49
+ readonly count?: number;
50
+ readonly filename?: string;
53
51
  }[];
54
- splatEncoding?: SplatEncoding;
52
+ readonly splatEncoding?: SplatEncoding;
55
53
  };
56
54
  export type PackedExtra = {
57
- sh1?: Uint32Array;
58
- sh2?: Uint32Array;
59
- sh3?: Uint32Array;
60
- sh1Codes?: Uint32Array;
61
- sh2Codes?: Uint32Array;
62
- sh3Codes?: Uint32Array;
63
- lodTree?: Uint32Array;
64
- radMeta?: RadMeta;
55
+ readonly sh1?: Uint32Array;
56
+ readonly sh2?: Uint32Array;
57
+ readonly sh3?: Uint32Array;
58
+ readonly sh1Codes?: Uint32Array;
59
+ readonly sh2Codes?: Uint32Array;
60
+ readonly sh3Codes?: Uint32Array;
61
+ readonly lodTree?: Uint32Array;
62
+ readonly radMeta?: RadMeta;
65
63
  };
66
64
  export type PackedResult = {
67
- numSplats: number;
68
- packedArray: Uint32Array;
69
- extra: PackedExtra;
70
- splatEncoding: SplatEncoding;
65
+ readonly numSplats: number;
66
+ readonly packedArray: Uint32Array;
67
+ readonly extra: PackedExtra;
68
+ readonly splatEncoding: SplatEncoding;
71
69
  };
72
70
  export type ExtExtra = {
73
- sh1?: Uint32Array;
74
- sh2?: Uint32Array;
75
- sh3a?: Uint32Array;
76
- sh3b?: Uint32Array;
77
- sh1Codes?: Uint32Array;
78
- sh2Codes?: Uint32Array;
79
- sh3Codes?: [Uint32Array, Uint32Array];
80
- lodTree?: Uint32Array;
81
- radMeta?: RadMeta;
71
+ readonly sh1?: Uint32Array;
72
+ readonly sh2?: Uint32Array;
73
+ readonly sh3a?: Uint32Array;
74
+ readonly sh3b?: Uint32Array;
75
+ readonly sh1Codes?: Uint32Array;
76
+ readonly sh2Codes?: Uint32Array;
77
+ readonly sh3Codes?: [Uint32Array, Uint32Array];
78
+ readonly lodTree?: Uint32Array;
79
+ readonly radMeta?: RadMeta;
82
80
  };
83
81
  export type ExtResult = {
84
- numSplats: number;
85
- extArrays: [Uint32Array, Uint32Array];
86
- extra: ExtExtra;
82
+ readonly numSplats: number;
83
+ readonly extArrays: [Uint32Array, Uint32Array];
84
+ readonly extra: ExtExtra;
87
85
  };
@@ -1,6 +1,6 @@
1
- import { IUniform } from 'three';
2
- import { DynoType } from './types';
3
- import { DynoVal, DynoValue, HasDynoOut } from './value';
1
+ import type { IUniform } from "three";
2
+ import type { DynoType } from "./types";
3
+ import { type DynoVal, DynoValue, type HasDynoOut } from "./value";
4
4
  export declare class Compilation {
5
5
  globals: Set<string>;
6
6
  statements: string[];
@@ -1,6 +1,6 @@
1
- import { UnaryOp } from './base';
2
- import { SimpleTypes } from './types';
3
- import { DynoVal } from './value';
1
+ import { UnaryOp } from "./base";
2
+ import { type SimpleTypes } from "./types";
3
+ import type { DynoVal } from "./value";
4
4
  export declare const bool: <T extends "bool" | "int" | "uint" | "float">(value: DynoVal<T>) => DynoVal<"bool">;
5
5
  export declare const int: <T extends "bool" | "int" | "uint" | "float">(value: DynoVal<T>) => DynoVal<"int">;
6
6
  export declare const uint: <T extends "bool" | "int" | "uint" | "float">(value: DynoVal<T>) => DynoVal<"uint">;
@@ -1,6 +1,6 @@
1
- import { BinaryOp, TrinaryOp, UnaryOp } from './base';
2
- import { AllIntTypes, BoolTypes, IntTypes, ScalarTypes, SimpleTypes, UintTypes, ValueTypes } from './types';
3
- import { DynoVal } from './value';
1
+ import { BinaryOp, TrinaryOp, UnaryOp } from "./base";
2
+ import { type AllIntTypes, type BoolTypes, type IntTypes, type ScalarTypes, type SimpleTypes, type UintTypes, type ValueTypes } from "./types";
3
+ import { type DynoVal } from "./value";
4
4
  export declare const and: <T extends "bool" | AllIntTypes>(a: DynoVal<T>, b: DynoVal<T>) => DynoVal<T>;
5
5
  export declare const or: <T extends "bool" | AllIntTypes>(a: DynoVal<T>, b: DynoVal<T>) => DynoVal<T>;
6
6
  export declare const xor: <T extends "bool" | AllIntTypes>(a: DynoVal<T>, b: DynoVal<T>) => DynoVal<T>;
@@ -1,7 +1,7 @@
1
- import { BinaryOp, Dyno, TrinaryOp, UnaryOp } from './base';
2
- import { AddOutput, ClampOutput, DivOutput, IModOutput, IsInfOutput, IsNanOutput, MaxOutput, MinOutput, MixOutput, ModOutput, MulOutput, SmoothstepOutput, StepOutput, SubOutput } from './mathTypes';
3
- import { AllIntTypes, AllSignedTypes, AllValueTypes, BoolTypes, FloatTypes, SignedTypes, ValueTypes } from './types';
4
- import { DynoVal } from './value';
1
+ import { BinaryOp, Dyno, TrinaryOp, UnaryOp } from "./base";
2
+ import { type AddOutput, type ClampOutput, type DivOutput, type IModOutput, type IsInfOutput, type IsNanOutput, type MaxOutput, type MinOutput, type MixOutput, type ModOutput, type MulOutput, type SmoothstepOutput, type StepOutput, type SubOutput } from "./mathTypes";
3
+ import type { AllIntTypes, AllSignedTypes, AllValueTypes, BoolTypes, FloatTypes, SignedTypes, ValueTypes } from "./types";
4
+ import { type DynoVal } from "./value";
5
5
  export declare const add: <A extends AllValueTypes, B extends AllValueTypes>(a: DynoVal<A>, b: DynoVal<B>) => DynoVal<AddOutput<A, B>>;
6
6
  export declare const sub: <A extends AllValueTypes, B extends AllValueTypes>(a: DynoVal<A>, b: DynoVal<B>) => DynoVal<SubOutput<A, B>>;
7
7
  export declare const mul: <A extends AllValueTypes, B extends AllValueTypes>(a: DynoVal<A>, b: DynoVal<B>) => DynoVal<MulOutput<A, B>>;
@@ -1,4 +1,4 @@
1
- import { AllFloatTypes, AllIntTypes, AllSignedTypes, AllValueTypes, BaseType, BoolTypes, FloatTypes, IntTypes, SignedTypes, UintTypes, ValueTypes } from './types';
1
+ import { type AllFloatTypes, type AllIntTypes, type AllSignedTypes, type AllValueTypes, type BaseType, type BoolTypes, type FloatTypes, type IntTypes, type SignedTypes, type UintTypes, type ValueTypes } from "./types";
2
2
  export type AddOutput<A extends AllValueTypes, B extends AllValueTypes> = BaseType & (A extends B ? A : A extends "int" ? B extends IntTypes ? B : never : B extends "int" ? A extends IntTypes ? A : never : A extends "uint" ? B extends UintTypes ? B : never : B extends "uint" ? A extends UintTypes ? A : never : A extends "float" ? B extends AllFloatTypes ? B : never : B extends "float" ? A extends AllFloatTypes ? A : never : never);
3
3
  export type SubOutput<A extends AllValueTypes, B extends AllValueTypes> = AddOutput<A, B>;
4
4
  export type MulOutput<A extends AllValueTypes, B extends AllValueTypes> = BaseType & (A extends "int" ? B extends IntTypes ? B : never : B extends "int" ? A extends IntTypes ? A : never : A extends "uint" ? B extends UintTypes ? B : never : B extends "uint" ? A extends UintTypes ? A : never : A extends "float" ? B extends AllFloatTypes ? B : never : B extends "float" ? A extends AllFloatTypes ? A : never : A extends IntTypes ? B extends A ? A : never : B extends IntTypes ? A extends B ? A : never : A extends UintTypes ? B extends A ? A : never : B extends UintTypes ? A extends B ? A : never : A extends "vec2" ? B extends "vec2" | "mat2" | "mat2x2" ? "vec2" : B extends "mat3x2" ? "vec3" : B extends "mat4x2" ? "vec4" : never : A extends "vec3" ? B extends "mat2x3" ? "vec2" : B extends "vec3" | "mat3" | "mat3x3" ? "vec3" : B extends "mat4x3" ? "vec4" : never : A extends "vec4" ? B extends "mat2x4" ? "vec2" : B extends "mat3x4" ? "vec3" : B extends "vec4" | "mat4" | "mat4x4" ? "vec4" : never : B extends "vec2" ? A extends "mat2" | "mat2x2" ? "vec2" : A extends "mat2x3" ? "vec3" : A extends "mat2x4" ? "vec4" : never : B extends "vec3" ? A extends "mat3x2" ? "vec2" : A extends "mat3" | "mat3x3" ? "vec3" : A extends "mat3x4" ? "vec4" : never : B extends "vec4" ? A extends "mat4x2" ? "vec2" : A extends "mat4x3" ? "vec3" : A extends "mat4" | "mat4x4" ? "vec4" : never : A extends "mat2" | "mat2x2" ? B extends "mat2" | "mat2x2" ? "mat2" : B extends "mat3x2" ? "mat3x2" : B extends "mat4x2" ? "mat4x2" : never : A extends "mat2x3" ? B extends "mat2" | "mat2x2" ? "mat2x3" : B extends "mat3x2" ? "mat3" : B extends "mat4x2" ? "mat4x3" : never : A extends "mat2x4" ? B extends "mat2" | "mat2x2" ? "mat2x4" : B extends "mat3x2" ? "mat3x4" : B extends "mat4x2" ? "mat4" : never : A extends "mat3x2" ? B extends "mat2x3" ? "mat2" : B extends "mat3" | "mat3x3" ? "mat3x2" : B extends "mat4x3" ? "mat4x2" : never : A extends "mat3" | "mat3x3" ? B extends "mat2x3" ? "mat2x3" : B extends "mat3" | "mat3x3" ? "mat3" : B extends "mat4x3" ? "mat4x3" : never : A extends "mat3x4" ? B extends "mat2x3" ? "mat2x4" : B extends "mat3" | "mat3x3" ? "mat3x4" : B extends "mat4x3" ? "mat4" : never : A extends "mat4x2" ? B extends "mat2x4" ? "mat2" : B extends "mat3x4" ? "mat3x2" : B extends "mat4" | "mat4x4" ? "mat4x2" : never : A extends "mat4x3" ? B extends "mat2x4" ? "mat2x3" : B extends "mat3x4" ? "mat3" : B extends "mat4" | "mat4x4" ? "mat4x3" : never : A extends "mat4" | "mat4x4" ? B extends "mat2x4" ? "mat2x4" : B extends "mat3x4" ? "mat3x4" : B extends "mat4" | "mat4x4" ? "mat4" : never : never);
@@ -1,6 +1,6 @@
1
- import { Dyno } from './base';
2
- import { CovSplat, Gsplat } from './splats';
3
- import { DynoVal, DynoValue, HasDynoOut } from './value';
1
+ import { Dyno } from "./base";
2
+ import { CovSplat, Gsplat } from "./splats";
3
+ import { type DynoVal, type DynoValue, type HasDynoOut } from "./value";
4
4
  export declare const outputPackedSplat: (gsplat: DynoVal<typeof Gsplat>, rgbMinMaxLnScaleMinMax: DynoVal<"vec4">) => OutputPackedSplat;
5
5
  export declare const outputCovSplat: (covsplat: DynoVal<typeof CovSplat>, rgbMinMaxLnScaleMinMax: DynoVal<"vec4">) => OutputCovSplat;
6
6
  export declare const outputExtendedSplat: (gsplat: DynoVal<typeof Gsplat>) => OutputExtendedSplat;
@@ -1,5 +1,5 @@
1
- import { Dyno, IOTypes } from './base';
2
1
  import * as THREE from "three";
2
+ import { type Dyno, type IOTypes } from "./base";
3
3
  export declare class DynoProgram {
4
4
  graph: Dyno<IOTypes, IOTypes>;
5
5
  template: DynoProgramTemplate;
@@ -1,5 +1,5 @@
1
- import { Dyno, UnaryOp } from './base';
2
- import { DynoVal, DynoValue, HasDynoOut } from './value';
1
+ import { Dyno, UnaryOp } from "./base";
2
+ import { type DynoVal, type DynoValue, type HasDynoOut } from "./value";
3
3
  export declare const Gsplat: {
4
4
  type: "Gsplat";
5
5
  };
@@ -1,6 +1,6 @@
1
- import { Dyno } from './base';
2
- import { AllSamplerTypes, IsamplerTypes, NormalSamplerTypes, Sampler2DArrayTypes, Sampler2DTypes, Sampler3DTypes, SamplerCubeTypes, SamplerShadowTypes, SamplerTypes, UsamplerTypes } from './types';
3
- import { DynoVal, DynoValue, HasDynoOut } from './value';
1
+ import { Dyno } from "./base";
2
+ import type { AllSamplerTypes, IsamplerTypes, NormalSamplerTypes, Sampler2DArrayTypes, Sampler2DTypes, Sampler3DTypes, SamplerCubeTypes, SamplerShadowTypes, SamplerTypes, UsamplerTypes } from "./types";
3
+ import { type DynoVal, type DynoValue, type HasDynoOut } from "./value";
4
4
  export declare const textureSize: <T extends AllSamplerTypes>(texture: DynoVal<T>, lod?: DynoVal<"int">) => DynoVal<TextureSizeType<T>>;
5
5
  export declare const texture: <T extends AllSamplerTypes>(texture: DynoVal<T>, coord: DynoVal<TextureCoordType<T>>, bias?: DynoVal<"float">) => DynoVal<TextureReturnType<T>>;
6
6
  export declare const texelFetch: <T extends NormalSamplerTypes>(texture: DynoVal<T>, coord: DynoVal<TextureSizeType<T>>, lod?: DynoVal<"int">) => DynoVal<TextureReturnType<T>>;
@@ -1,5 +1,5 @@
1
- import { Dyno } from './base';
2
- import { DynoVal } from './value';
1
+ import { Dyno } from "./base";
2
+ import type { DynoVal } from "./value";
3
3
  export declare const transformPos: (position: DynoVal<"vec3">, { scale, scales, rotate, translate, }: {
4
4
  scale?: DynoVal<"float">;
5
5
  scales?: DynoVal<"vec3">;
@@ -1,6 +1,6 @@
1
- import { BinaryOp, UnaryOp } from './base';
2
- import { FloatTypes } from './types';
3
- import { DynoVal } from './value';
1
+ import { BinaryOp, UnaryOp } from "./base";
2
+ import type { FloatTypes } from "./types";
3
+ import type { DynoVal } from "./value";
4
4
  export declare const radians: <A extends FloatTypes>(degrees: DynoVal<A>) => DynoVal<A>;
5
5
  export declare const degrees: <A extends FloatTypes>(radians: DynoVal<A>) => DynoVal<A>;
6
6
  export declare const sin: <A extends FloatTypes>(radians: DynoVal<A>) => DynoVal<A>;
@@ -1,6 +1,6 @@
1
- import { Dyno } from './base';
2
- import { DynoJsType, DynoType } from './types';
3
- import { DynoValue, HasDynoOut } from './value';
1
+ import { Dyno } from "./base";
2
+ import type { DynoJsType, DynoType } from "./types";
3
+ import { type DynoValue, type HasDynoOut } from "./value";
4
4
  export declare const uniform: <V extends DynoJsType<DynoType>>(key: string, type: DynoType, value: V) => DynoUniform<DynoType, string, V>;
5
5
  export declare const dynoBool: (value?: boolean, key?: string) => DynoBool<string>;
6
6
  export declare const dynoUint: (value?: number, key?: string) => DynoUint<string>;
@@ -1,6 +1,6 @@
1
- import { Dyno, DynoBlock } from './base';
2
- import { ValueTypes } from './types';
3
- import { DynoVal, DynoValue, HasDynoOut } from './value';
1
+ import { Dyno, DynoBlock } from "./base";
2
+ import { type ValueTypes } from "./types";
3
+ import { type DynoVal, type DynoValue, type HasDynoOut } from "./value";
4
4
  export declare const remapIndex: (index: DynoVal<"int">, from: DynoVal<"int">, to: DynoVal<"int">) => DynoVal<"int">;
5
5
  export declare const pcgMix: <T extends ValueTypes>(value: DynoVal<T>) => DynoVal<"uint">;
6
6
  export declare const pcgNext: (state: DynoVal<"uint">) => DynoVal<"uint">;
@@ -1,5 +1,5 @@
1
- import { Dyno, IOTypes } from './base';
2
- import { DynoJsType, DynoType, SimpleTypes } from './types';
1
+ import type { Dyno, IOTypes } from "./base";
2
+ import { type DynoJsType, type DynoType, type SimpleTypes } from "./types";
3
3
  export type DynoVal<T extends DynoType> = DynoValue<T> | HasDynoOut<T>;
4
4
  export declare function valType<T extends DynoType>(val: DynoVal<T>): T;
5
5
  export interface HasDynoOut<T extends DynoType> {
@@ -1,6 +1,6 @@
1
- import { BinaryOp, Dyno, TrinaryOp, UnaryOp } from './base';
2
- import { FloatTypes, IntTypes, MatFloatTypes, SquareMatTypes, UintTypes, VectorElementType, VectorTypes } from './types';
3
- import { DynoVal, DynoValue, HasDynoOut } from './value';
1
+ import { BinaryOp, Dyno, TrinaryOp, UnaryOp } from "./base";
2
+ import { type FloatTypes, type IntTypes, type MatFloatTypes, type SquareMatTypes, type UintTypes, type VectorElementType, type VectorTypes } from "./types";
3
+ import { type DynoVal, type DynoValue, type HasDynoOut } from "./value";
4
4
  export declare const length: <A extends "vec2" | "vec3" | "vec4">(a: DynoVal<A>) => DynoVal<"float">;
5
5
  export declare const distance: <A extends "vec2" | "vec3" | "vec4">(a: DynoVal<A>, b: DynoVal<A>) => DynoVal<"float">;
6
6
  export declare const dot: <A extends "vec2" | "vec3" | "vec4">(a: DynoVal<A>, b: DynoVal<A>) => DynoVal<"float">;
@@ -1,16 +1,16 @@
1
- export * from './dyno/types';
2
- export * from './dyno/base';
3
- export * from './dyno/value';
4
- export * from './dyno/output';
5
- export * from './dyno/uniforms';
6
- export * from './dyno/program';
7
- export * from './dyno/math';
8
- export * from './dyno/logic';
9
- export * from './dyno/util';
10
- export * from './dyno/splats';
11
- export * from './dyno/transform';
12
- export * from './dyno/control';
13
- export * from './dyno/convert';
14
- export * from './dyno/texture';
15
- export * from './dyno/trig';
16
- export * from './dyno/vecmat';
1
+ export * from "./dyno/types";
2
+ export * from "./dyno/base";
3
+ export * from "./dyno/value";
4
+ export * from "./dyno/output";
5
+ export * from "./dyno/uniforms";
6
+ export * from "./dyno/program";
7
+ export * from "./dyno/math";
8
+ export * from "./dyno/logic";
9
+ export * from "./dyno/util";
10
+ export * from "./dyno/splats";
11
+ export * from "./dyno/transform";
12
+ export * from "./dyno/control";
13
+ export * from "./dyno/convert";
14
+ export * from "./dyno/texture";
15
+ export * from "./dyno/trig";
16
+ export * from "./dyno/vecmat";
@@ -1,5 +1,5 @@
1
- import { SplatGenerator } from '../SplatGenerator';
2
1
  import * as THREE from "three";
2
+ import { SplatGenerator } from "../SplatGenerator";
3
3
  export declare const DEFAULT_SNOW: {
4
4
  box: THREE.Box3;
5
5
  density: number;
@@ -48,18 +48,18 @@ export declare function snowBox({ box, minY, numSplats, density, anisoScale, min
48
48
  }) => void;
49
49
  }): {
50
50
  snow: SplatGenerator;
51
- min: import('../dyno').DynoVec3<THREE.Vector3, string>;
52
- max: import('../dyno').DynoVec3<THREE.Vector3, string>;
53
- minY: import('../dyno').DynoFloat<string>;
54
- color1: import('../dyno').DynoVec3<THREE.Color, string>;
55
- color2: import('../dyno').DynoVec3<THREE.Color, string>;
56
- opacity: import('../dyno').DynoFloat<string>;
57
- fallVelocity: import('../dyno').DynoFloat<string>;
58
- wanderVariance: import('../dyno').DynoFloat<string>;
59
- wanderScale: import('../dyno').DynoFloat<string>;
60
- fallDirection: import('../dyno').DynoVec3<THREE.Vector3, string>;
61
- minScale: import('../dyno').DynoFloat<string>;
62
- maxScale: import('../dyno').DynoFloat<string>;
63
- anisoScale: import('../dyno').DynoVec3<THREE.Vector3, string>;
51
+ min: import("../dyno").DynoVec3<THREE.Vector3, string>;
52
+ max: import("../dyno").DynoVec3<THREE.Vector3, string>;
53
+ minY: import("../dyno").DynoFloat<string>;
54
+ color1: import("../dyno").DynoVec3<THREE.Color, string>;
55
+ color2: import("../dyno").DynoVec3<THREE.Color, string>;
56
+ opacity: import("../dyno").DynoFloat<string>;
57
+ fallVelocity: import("../dyno").DynoFloat<string>;
58
+ wanderVariance: import("../dyno").DynoFloat<string>;
59
+ wanderScale: import("../dyno").DynoFloat<string>;
60
+ fallDirection: import("../dyno").DynoVec3<THREE.Vector3, string>;
61
+ minScale: import("../dyno").DynoFloat<string>;
62
+ maxScale: import("../dyno").DynoFloat<string>;
63
+ anisoScale: import("../dyno").DynoVec3<THREE.Vector3, string>;
64
64
  };
65
65
  export type SNOW_RESULT_TYPE = ReturnType<typeof snowBox>;
@@ -1,5 +1,5 @@
1
- import { SplatGenerator } from '../SplatGenerator';
2
1
  import * as THREE from "three";
2
+ import { SplatGenerator } from "../SplatGenerator";
3
3
  export declare function staticBox({ box, cells, dotScale, color, opacity, }: {
4
4
  box: THREE.Box3;
5
5
  cells: THREE.Vector3;
@@ -1,2 +1,2 @@
1
- export * from './generators/static';
2
- export * from './generators/snow';
1
+ export * from "./generators/static";
2
+ export * from "./generators/snow";
@@ -1,32 +1,32 @@
1
- import { Object3D, Quaternion, Vector3, WebXRManager } from 'three';
2
- import { SplatMesh } from './SplatMesh';
3
- export declare enum JointEnum {
4
- w = "wrist",
5
- t0 = "thumb-metacarpal",
6
- t1 = "thumb-phalanx-proximal",
7
- t2 = "thumb-phalanx-distal",
8
- t3 = "thumb-tip",
9
- i0 = "index-finger-metacarpal",
10
- i1 = "index-finger-phalanx-proximal",
11
- i2 = "index-finger-phalanx-intermediate",
12
- i3 = "index-finger-phalanx-distal",
13
- i4 = "index-finger-tip",
14
- m0 = "middle-finger-metacarpal",
15
- m1 = "middle-finger-phalanx-proximal",
16
- m2 = "middle-finger-phalanx-intermediate",
17
- m3 = "middle-finger-phalanx-distal",
18
- m4 = "middle-finger-tip",
19
- r0 = "ring-finger-metacarpal",
20
- r1 = "ring-finger-phalanx-proximal",
21
- r2 = "ring-finger-phalanx-intermediate",
22
- r3 = "ring-finger-phalanx-distal",
23
- r4 = "ring-finger-tip",
24
- p0 = "pinky-finger-metacarpal",
25
- p1 = "pinky-finger-phalanx-proximal",
26
- p2 = "pinky-finger-phalanx-intermediate",
27
- p3 = "pinky-finger-phalanx-distal",
28
- p4 = "pinky-finger-tip"
29
- }
1
+ import { type Object3D, Quaternion, Vector3, type WebXRManager } from "three";
2
+ import { SplatMesh } from "./SplatMesh";
3
+ export declare const JointEnum: {
4
+ readonly w: "wrist";
5
+ readonly t0: "thumb-metacarpal";
6
+ readonly t1: "thumb-phalanx-proximal";
7
+ readonly t2: "thumb-phalanx-distal";
8
+ readonly t3: "thumb-tip";
9
+ readonly i0: "index-finger-metacarpal";
10
+ readonly i1: "index-finger-phalanx-proximal";
11
+ readonly i2: "index-finger-phalanx-intermediate";
12
+ readonly i3: "index-finger-phalanx-distal";
13
+ readonly i4: "index-finger-tip";
14
+ readonly m0: "middle-finger-metacarpal";
15
+ readonly m1: "middle-finger-phalanx-proximal";
16
+ readonly m2: "middle-finger-phalanx-intermediate";
17
+ readonly m3: "middle-finger-phalanx-distal";
18
+ readonly m4: "middle-finger-tip";
19
+ readonly r0: "ring-finger-metacarpal";
20
+ readonly r1: "ring-finger-phalanx-proximal";
21
+ readonly r2: "ring-finger-phalanx-intermediate";
22
+ readonly r3: "ring-finger-phalanx-distal";
23
+ readonly r4: "ring-finger-tip";
24
+ readonly p0: "pinky-finger-metacarpal";
25
+ readonly p1: "pinky-finger-phalanx-proximal";
26
+ readonly p2: "pinky-finger-phalanx-intermediate";
27
+ readonly p3: "pinky-finger-phalanx-distal";
28
+ readonly p4: "pinky-finger-tip";
29
+ };
30
30
  export type JointId = keyof typeof JointEnum;
31
31
  export declare const JOINT_IDS: JointId[];
32
32
  export declare const NUM_JOINTS: number;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Called at each hook point with its name and optional context. Return a
3
+ * promise to pause Spark at that point until it settles; return undefined to
4
+ * continue without inserting an await.
5
+ */
6
+ export type SparkHook = (name: string, context?: Record<string, unknown>) => void | Promise<void>;
7
+ /**
8
+ * True only when built with SPARK_ENABLE_HOOKS=1. Gates every hook point.
9
+ * Read as a direct `import.meta.env.<KEY>` so Vite replaces it with a literal
10
+ * at build time and the hook code is compiled out of normal builds.
11
+ */
12
+ export declare const SPARK_ENABLE_HOOKS: boolean;
13
+ export declare function setSparkHook(newHook?: SparkHook): void;
14
+ export declare function sparkHook(name: string, context?: Record<string, unknown>): void | Promise<void> | undefined;
@@ -1,25 +1,25 @@
1
- export { SparkRenderer, type SparkRendererOptions, } from './SparkRenderer';
2
- export { SplatAccumulator, type GeneratorMapping } from './SplatAccumulator';
3
- export * as dyno from './dyno';
4
- export { RgbaArray, readRgbaArray } from './RgbaArray';
5
- export { SplatLoader, getSplatFileType, } from './SplatLoader';
6
- export { transcodeSpz, writeSpz } from './spz';
7
- export { PackedSplats, type PackedSplatsOptions } from './PackedSplats';
8
- export { ExtSplats, type ExtSplatsOptions } from './ExtSplats';
9
- export * from './SplatPager';
10
- export { SplatGenerator, type GsplatGenerator, SplatModifier, type GsplatModifier, SplatTransformer, } from './SplatGenerator';
11
- export { Readback, type Rgba8Readback, type ReadbackBuffer } from './Readback';
12
- export { SplatMesh, type SplatMeshOptions, type SplatMeshContext, } from './SplatMesh';
13
- export { SplatSkinning, type SplatSkinningOptions, SplatSkinningMode, } from './SplatSkinning';
14
- export { SplatEdit, type SplatEditOptions, SplatEditSdf, type SplatEditSdfOptions, SplatEditSdfType, SplatEditRgbaBlendMode, SplatEdits, } from './SplatEdit';
15
- export { constructGrid, constructAxes, constructSpherePoints, imageSplats, textSplats, } from './splatConstructors';
16
- export * as generators from './generators';
17
- export * as modifiers from './modifiers';
18
- export * from './SparkXr';
19
- export { type JointId, JointEnum, JOINT_IDS, NUM_JOINTS, JOINT_INDEX, JOINT_RADIUS, JOINT_SEGMENTS, JOINT_SEGMENT_STEPS, JOINT_TIPS, FINGER_TIPS, Hand, HANDS, type Joint, type HandJoints, type HandsJoints, XrHands, HandMovement, } from './hands';
20
- export { SparkControls, FpsMovement, PointerControls } from './controls';
21
- export { isMobile, isAndroid, isOculus, isQuest2, isIos, isVisionPro, flipPixels, pixelsToPngUrl, toHalf, fromHalf, floatToUint8, floatToSint8, Uint8ToFloat, Sint8ToFloat, setPackedSplat, unpackSplat, } from './utils';
22
- export * as utils from './utils';
23
- export { LN_SCALE_MIN, LN_SCALE_MAX, SplatFileType } from './defines';
24
- export * as defines from './defines';
25
- export { SparkPortals, type SparkPortalsOptions, type PortalPair, DISK_PORTAL_FRAGMENT_SHADER, } from './SparkPortals';
1
+ export { SparkRenderer, type SparkRendererOptions, } from "./SparkRenderer";
2
+ export { SplatAccumulator, type GeneratorMapping } from "./SplatAccumulator";
3
+ export * as dyno from "./dyno";
4
+ export { RgbaArray, readRgbaArray } from "./RgbaArray";
5
+ export { SplatLoader, getSplatFileType, } from "./SplatLoader";
6
+ export { transcodeSpz, writeSpz, type SpzWriteVersion, type WriteSpzOptions, type TranscodeSpzFileInput, type TranscodeSpzInput, } from "./spz";
7
+ export { PackedSplats, type PackedSplatsOptions } from "./PackedSplats";
8
+ export { ExtSplats, type ExtSplatsOptions } from "./ExtSplats";
9
+ export * from "./SplatPager";
10
+ export { SplatGenerator, type GsplatGenerator, SplatModifier, type GsplatModifier, SplatTransformer, } from "./SplatGenerator";
11
+ export { Readback, type Rgba8Readback, type ReadbackBuffer } from "./Readback";
12
+ export { SplatMesh, type SplatMeshOptions, type SplatMeshContext, } from "./SplatMesh";
13
+ export { SplatSkinning, type SplatSkinningOptions, SplatSkinningMode, } from "./SplatSkinning";
14
+ export { SplatEdit, type SplatEditOptions, SplatEditSdf, type SplatEditSdfOptions, SplatEditSdfType, SplatEditRgbaBlendMode, SplatEdits, } from "./SplatEdit";
15
+ export { constructGrid, constructAxes, constructSpherePoints, imageSplats, textSplats, } from "./splatConstructors";
16
+ export * as generators from "./generators";
17
+ export * as modifiers from "./modifiers";
18
+ export * from "./SparkXr";
19
+ export { type JointId, JointEnum, JOINT_IDS, NUM_JOINTS, JOINT_INDEX, JOINT_RADIUS, JOINT_SEGMENTS, JOINT_SEGMENT_STEPS, JOINT_TIPS, FINGER_TIPS, Hand, HANDS, type Joint, type HandJoints, type HandsJoints, XrHands, HandMovement, } from "./hands";
20
+ export { SparkControls, FpsMovement, PointerControls } from "./controls";
21
+ export { isMobile, isAndroid, isOculus, isQuest2, isIos, isVisionPro, flipPixels, pixelsToPngUrl, toHalf, fromHalf, floatToUint8, floatToSint8, Uint8ToFloat, Sint8ToFloat, setPackedSplat, unpackSplat, } from "./utils";
22
+ export * as utils from "./utils";
23
+ export { LN_SCALE_MIN, LN_SCALE_MAX, SplatFileType } from "./defines";
24
+ export * as defines from "./defines";
25
+ export { SparkPortals, type SparkPortalsOptions, type PortalPair, DISK_PORTAL_FRAGMENT_SHADER, } from "./SparkPortals";
@@ -1,7 +1,7 @@
1
- import { SplatTransformer } from '../SplatGenerator';
2
- import { SplatMesh } from '../SplatMesh';
3
- import { DynoVal } from '../dyno';
4
- export declare function makeDepthColorModifier(splatToView: SplatTransformer, minDepth: DynoVal<"float">, maxDepth: DynoVal<"float">, reverse: DynoVal<"bool">): import('../dyno').DynoBlock<{
1
+ import type { SplatTransformer } from "../SplatGenerator";
2
+ import type { SplatMesh } from "../SplatMesh";
3
+ import { type DynoVal } from "../dyno";
4
+ export declare function makeDepthColorModifier(splatToView: SplatTransformer, minDepth: DynoVal<"float">, maxDepth: DynoVal<"float">, reverse: DynoVal<"bool">): import("../dyno").DynoBlock<{
5
5
  gsplat: {
6
6
  type: "Gsplat";
7
7
  };
@@ -11,7 +11,7 @@ export declare function makeDepthColorModifier(splatToView: SplatTransformer, mi
11
11
  };
12
12
  }>;
13
13
  export declare function setDepthColor(splats: SplatMesh, minDepth: number, maxDepth: number, reverse?: boolean): {
14
- minDepth: import('../dyno').DynoConst<"float">;
15
- maxDepth: import('../dyno').DynoConst<"float">;
16
- reverse: import('../dyno').DynoConst<"bool">;
14
+ minDepth: import("../dyno").DynoConst<"float">;
15
+ maxDepth: import("../dyno").DynoConst<"float">;
16
+ reverse: import("../dyno").DynoConst<"bool">;
17
17
  };
@@ -1,6 +1,6 @@
1
- import { SplatTransformer } from '../SplatGenerator';
2
- import { SplatMesh } from '../SplatMesh';
3
- export declare function makeNormalColorModifier(splatToView: SplatTransformer): import('../dyno').DynoBlock<{
1
+ import type { SplatTransformer } from "../SplatGenerator";
2
+ import type { SplatMesh } from "../SplatMesh";
3
+ export declare function makeNormalColorModifier(splatToView: SplatTransformer): import("../dyno").DynoBlock<{
4
4
  gsplat: {
5
5
  type: "Gsplat";
6
6
  };
@@ -1,2 +1,2 @@
1
- export * from './modifiers/normalColor';
2
- export * from './modifiers/depthColor';
1
+ export * from "./modifiers/normalColor";
2
+ export * from "./modifiers/depthColor";
@@ -1,6 +1,6 @@
1
- import { PackedSplats } from './PackedSplats';
2
- import { SplatMesh } from './SplatMesh';
3
1
  import * as THREE from "three";
2
+ import { PackedSplats } from "./PackedSplats";
3
+ import { SplatMesh } from "./SplatMesh";
4
4
  export declare function constructGrid({ splats, extents, stepSize, pointRadius, pointShadowScale, opacity, color, }: {
5
5
  splats: PackedSplats;
6
6
  extents: THREE.Box3;
@@ -1,9 +1,40 @@
1
- import { PackedSplats } from './PackedSplats';
2
- import { TranscodeSpzInput } from './SplatLoader';
1
+ import { ExtSplats } from "./ExtSplats";
2
+ import { PackedSplats } from "./PackedSplats";
3
+ import type { SplatFileType } from "./defines";
4
+ export type SpzWriteVersion = 2 | 3;
5
+ export type TranscodeSpzFileInput = {
6
+ fileBytes: Uint8Array;
7
+ fileType?: SplatFileType;
8
+ pathOrUrl?: string;
9
+ transform?: {
10
+ translate?: number[];
11
+ quaternion?: number[];
12
+ scale?: number;
13
+ };
14
+ };
15
+ export type TranscodeSpzInput = {
16
+ inputs: TranscodeSpzFileInput[];
17
+ maxSh?: number;
18
+ clipXyz?: {
19
+ min: number[];
20
+ max: number[];
21
+ };
22
+ fractionalBits?: number;
23
+ opacityThreshold?: number;
24
+ version?: SpzWriteVersion;
25
+ };
3
26
  export declare function transcodeSpz(input: TranscodeSpzInput): Promise<{
4
27
  fileBytes: any;
5
28
  clippedCount: number;
6
29
  }>;
7
- export declare function writeSpz(packedSplats: PackedSplats, maxSh?: number, fractionalBits?: number): {
8
- fileBytes: Uint8Array<ArrayBufferLike>;
30
+ export type WriteSpzOptions = {
31
+ maxSh?: number;
32
+ fractionalBits?: number;
33
+ version?: SpzWriteVersion;
9
34
  };
35
+ export declare function writeSpz(splats: PackedSplats | ExtSplats, maxSh?: number, fractionalBits?: number): Promise<{
36
+ fileBytes: Uint8Array;
37
+ }>;
38
+ export declare function writeSpz(splats: PackedSplats | ExtSplats, options?: WriteSpzOptions): Promise<{
39
+ fileBytes: Uint8Array;
40
+ }>;