@sparkjsdev/spark 0.1.2 → 0.1.4
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/README.md +3 -3
- package/dist/assets/{worker-Do1mGyaZ.js.map → worker-BaDUjW4F.js.map} +1 -1
- package/dist/assets/{worker-DN5J0FWb.js.map → worker-aRks6Nva.js.map} +1 -1
- package/dist/spark.cjs.js +114 -14
- package/dist/spark.cjs.js.map +1 -1
- package/dist/spark.cjs.min.js +68 -55
- package/dist/spark.cjs.min.js.map +1 -1
- package/dist/spark.module.js +114 -14
- package/dist/spark.module.js.map +1 -1
- package/dist/spark.module.min.js +2366 -2277
- package/dist/spark.module.min.js.map +1 -1
- package/dist/types/SparkRenderer.d.ts +10 -0
- package/dist/types/controls.d.ts +3 -1
- package/dist/types/dyno/util.d.ts +15 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modifiers/depthColor.d.ts +17 -0
- package/dist/types/modifiers/normalColor.d.ts +12 -0
- package/dist/types/modifiers.d.ts +2 -0
- package/package.json +4 -3
|
@@ -13,6 +13,8 @@ export type SparkRendererOptions = {
|
|
|
13
13
|
enable2DGS?: boolean;
|
|
14
14
|
preBlurAmount?: number;
|
|
15
15
|
blurAmount?: number;
|
|
16
|
+
focalDistance?: number;
|
|
17
|
+
apertureAngle?: number;
|
|
16
18
|
falloff?: number;
|
|
17
19
|
clipXY?: number;
|
|
18
20
|
view?: SparkViewpointOptions;
|
|
@@ -28,6 +30,8 @@ export declare class SparkRenderer extends THREE.Mesh {
|
|
|
28
30
|
enable2DGS: boolean;
|
|
29
31
|
preBlurAmount: number;
|
|
30
32
|
blurAmount: number;
|
|
33
|
+
focalDistance: number;
|
|
34
|
+
apertureAngle: number;
|
|
31
35
|
falloff: number;
|
|
32
36
|
clipXY: number;
|
|
33
37
|
time?: number;
|
|
@@ -75,6 +79,12 @@ export declare class SparkRenderer extends THREE.Mesh {
|
|
|
75
79
|
blurAmount: {
|
|
76
80
|
value: number;
|
|
77
81
|
};
|
|
82
|
+
focalDistance: {
|
|
83
|
+
value: number;
|
|
84
|
+
};
|
|
85
|
+
apertureAngle: {
|
|
86
|
+
value: number;
|
|
87
|
+
};
|
|
78
88
|
falloff: {
|
|
79
89
|
value: number;
|
|
80
90
|
};
|
package/dist/types/controls.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export declare class PointerControls {
|
|
|
74
74
|
reverseScroll: boolean;
|
|
75
75
|
moveInertia: number;
|
|
76
76
|
rotateInertia: number;
|
|
77
|
+
pointerRollScale: number;
|
|
77
78
|
enable: boolean;
|
|
78
79
|
doublePress: ({ position, intervalMs, }: {
|
|
79
80
|
position: THREE.Vector2;
|
|
@@ -91,7 +92,7 @@ export declare class PointerControls {
|
|
|
91
92
|
scroll: THREE.Vector3;
|
|
92
93
|
rotateVelocity: THREE.Vector3;
|
|
93
94
|
moveVelocity: THREE.Vector3;
|
|
94
|
-
constructor({ canvas, rotateSpeed, slideSpeed, scrollSpeed, swapRotateSlide, reverseRotate, reverseSlide, reverseSwipe, reverseScroll, moveInertia, rotateInertia, doublePress, }: {
|
|
95
|
+
constructor({ canvas, rotateSpeed, slideSpeed, scrollSpeed, swapRotateSlide, reverseRotate, reverseSlide, reverseSwipe, reverseScroll, moveInertia, rotateInertia, pointerRollScale, doublePress, }: {
|
|
95
96
|
canvas: HTMLCanvasElement;
|
|
96
97
|
rotateSpeed?: number;
|
|
97
98
|
slideSpeed?: number;
|
|
@@ -103,6 +104,7 @@ export declare class PointerControls {
|
|
|
103
104
|
reverseScroll?: boolean;
|
|
104
105
|
moveInertia?: number;
|
|
105
106
|
rotateInertia?: number;
|
|
107
|
+
pointerRollScale?: number;
|
|
106
108
|
doublePress?: ({ position, intervalMs, }: {
|
|
107
109
|
position: THREE.Vector2;
|
|
108
110
|
intervalMs: number;
|
|
@@ -13,6 +13,7 @@ export declare const hashFloat: <T extends ValueTypes>(value: DynoVal<T>) => Dyn
|
|
|
13
13
|
export declare const hashVec2: <T extends ValueTypes>(value: DynoVal<T>) => DynoVal<"vec2">;
|
|
14
14
|
export declare const hashVec3: <T extends ValueTypes>(value: DynoVal<T>) => DynoVal<"vec3">;
|
|
15
15
|
export declare const hashVec4: <T extends ValueTypes>(value: DynoVal<T>) => DynoVal<"vec4">;
|
|
16
|
+
export declare const normalizedDepth: (z: DynoVal<"float">, zNear: DynoVal<"float">, zFar: DynoVal<"float">) => DynoVal<"float">;
|
|
16
17
|
export declare class DynoRemapIndex extends Dyno<{
|
|
17
18
|
from: "int";
|
|
18
19
|
to: "int";
|
|
@@ -137,3 +138,17 @@ export declare class HashVec4<T extends ValueTypes> extends DynoBlock<{
|
|
|
137
138
|
});
|
|
138
139
|
dynoOut(): DynoValue<"vec4">;
|
|
139
140
|
}
|
|
141
|
+
export declare class NormalizedDepth extends Dyno<{
|
|
142
|
+
z: "float";
|
|
143
|
+
zNear: "float";
|
|
144
|
+
zFar: "float";
|
|
145
|
+
}, {
|
|
146
|
+
depth: "float";
|
|
147
|
+
}> implements HasDynoOut<"float"> {
|
|
148
|
+
constructor({ z, zNear, zFar, }: {
|
|
149
|
+
z: DynoVal<"float">;
|
|
150
|
+
zNear: DynoVal<"float">;
|
|
151
|
+
zFar: DynoVal<"float">;
|
|
152
|
+
});
|
|
153
|
+
dynoOut(): DynoValue<"float">;
|
|
154
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { SplatSkinning, type SplatSkinningOptions } from './SplatSkinning';
|
|
|
13
13
|
export { SplatEdit, type SplatEditOptions, SplatEditSdf, type SplatEditSdfOptions, SplatEditSdfType, SplatEditRgbaBlendMode, SplatEdits, } from './SplatEdit';
|
|
14
14
|
export { constructGrid, constructAxes, constructSpherePoints, imageSplats, textSplats, } from './splatConstructors';
|
|
15
15
|
export * as generators from './generators';
|
|
16
|
+
export * as modifiers from './modifiers';
|
|
16
17
|
export { VRButton } from './vrButton';
|
|
17
18
|
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';
|
|
18
19
|
export { SparkControls, FpsMovement, PointerControls } from './controls';
|
|
@@ -0,0 +1,17 @@
|
|
|
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<{
|
|
5
|
+
gsplat: {
|
|
6
|
+
type: "Gsplat";
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
gsplat: {
|
|
10
|
+
type: "Gsplat";
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
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">;
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SplatTransformer } from '../SplatGenerator';
|
|
2
|
+
import { SplatMesh } from '../SplatMesh';
|
|
3
|
+
export declare function makeNormalColorModifier(splatToView: SplatTransformer): import('../dyno').DynoBlock<{
|
|
4
|
+
gsplat: {
|
|
5
|
+
type: "Gsplat";
|
|
6
|
+
};
|
|
7
|
+
}, {
|
|
8
|
+
gsplat: {
|
|
9
|
+
type: "Gsplat";
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare function setWorldNormalColor(splats: SplatMesh): void;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sparkjsdev/spark",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "An advanced 3D Gaussian Splatting renderer for THREE.js",
|
|
5
5
|
"homepage": "https://sparkjs.dev/",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/spark.cjs.js",
|
|
8
8
|
"module": "./dist/spark.module.js",
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"types": "./dist/types/index.d.ts",
|
|
@@ -31,9 +32,9 @@
|
|
|
31
32
|
"lint:fix": "biome check . --fix",
|
|
32
33
|
"lint:summary": "biome check --reporter=summary",
|
|
33
34
|
"prepare": "npm run build:wasm && lefthook install",
|
|
34
|
-
"site:build": "npm run build && npm run site:clean && node scripts/copy-site-files.js && mkdocs build",
|
|
35
|
+
"site:build": "npm run build && npm run site:clean && node scripts/copy-site-files.js && mkdocs build && node scripts/rename-assets-to-static.js",
|
|
35
36
|
"site:clean": "node scripts/clean-site-files.js && node scripts/clean-site.js",
|
|
36
|
-
"site:deploy": "node scripts/deploy-site.js",
|
|
37
|
+
"site:deploy": "npm run site:build && node scripts/deploy-site.js",
|
|
37
38
|
"site:serve": "node scripts/serve-site.js site",
|
|
38
39
|
"start": "npm run dev",
|
|
39
40
|
"test": "node --no-warnings --loader ts-node/esm --test test/**/*.test.ts"
|