Bump dist build

This commit is contained in:
sparkjsdev[bot]
2025-07-15 21:48:24 +00:00
parent c25dc354bc
commit 67acaad618
15 changed files with 4706 additions and 4552 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+74 -74
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+4466 -4466
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+81
View File
@@ -4,20 +4,101 @@ import { SplatAccumulator } from './SplatAccumulator';
import { SplatGenerator } from './SplatGenerator';
import * as THREE from "three";
export type SparkRendererOptions = {
/**
* Pass in your THREE.WebGLRenderer instance so Spark can perform work
* outside the usual render loop. Should be created with antialias: false
* (default setting) as WebGL anti-aliasing doesn't improve Gaussian Splatting
* rendering and significantly reduces performance.
*/
renderer: THREE.WebGLRenderer;
/**
* Pass in a THREE.Clock to synchronize time-based effects across different
* systems. Alternatively, you can set the SparkRenderer properties time and
* deltaTime directly. (default: new THREE.Clock)
*/
clock?: THREE.Clock;
/**
* Controls whether to check and automatically update Gsplat collection after
* each frame render.
* @default true
*/
autoUpdate?: boolean;
/**
* Controls whether to update the Gsplats before or after rendering. For WebXR
* this must be false in order to complete rendering as soon as possible.
* @default false
*/
preUpdate?: boolean;
/**
* Distance threshold for SparkRenderer movement triggering a Gsplat update at
* the new origin.
* @default 1.0
*/
originDistance?: number;
/**
* Maximum standard deviations from the center to render Gaussians. Values
* Math.sqrt(5)..Math.sqrt(8) produce good results and can be tweaked for
* performance.
* @default Math.sqrt(8)
*/
maxStdDev?: number;
/**
* Enable 2D Gaussian splatting rendering ability. When this mode is enabled,
* any scale x/y/z component that is exactly 0 (minimum quantized value) results
* in the other two non-0 axis being interpreted as an oriented 2D Gaussian Splat,
* rather instead of the usual projected 3DGS Z-slice. When reading PLY files,
* scale values less than e^-30 will be interpreted as 0.
* @default false
*/
enable2DGS?: boolean;
/**
* Scalar value to add to 2D splat covariance diagonal, effectively blurring +
* enlarging splats. In scenes trained without the Gsplat anti-aliasing tweak
* this value was typically 0.3, but with anti-aliasing it is 0.0
* @default 0.0
*/
preBlurAmount?: number;
/**
* Scalar value to add to 2D splat covarianve diagonal, with opacity adjustment
* to correctly account for "blurring" when anti-aliasing. Typically 0.3
* (equivalent to approx 0.5 pixel radius) in scenes trained with anti-aliasing.
*/
blurAmount?: number;
/**
* Depth-of-field distance to focal plane
*/
focalDistance?: number;
/**
* Full-width angle of aperture opening (in radians), 0.0 to disable
* @default 0.0
*/
apertureAngle?: number;
/**
* Modulate Gaussian kernel falloff. 0 means "no falloff, flat shading",
* while 1 is the normal Gaussian kernel.
* @default 1.0
*/
falloff?: number;
/**
* X/Y clipping boundary factor for Gsplat centers against view frustum.
* 1.0 clips any centers that are exactly out of bounds, while 1.4 clips
* centers that are 40% beyond the bounds.
* @default 1.4
*/
clipXY?: number;
/**
* Parameter to adjust projected splat scale calculation to match other renderers,
* similar to the same parameter in the MKellogg 3DGS renderer. Higher values will
* tend to sharpen the splats. A value 2.0 can be used to match the behavior of
* the PlayCanvas renderer.
* @default 1.0
*/
focalAdjustment?: number;
/**
* Configures the SparkViewpointOptions for the default SparkViewpoint
* associated with this SparkRenderer. Notable option: sortRadial (sort by
* radial distance or Z-depth)
*/
view?: SparkViewpointOptions;
};
export declare class SparkRenderer extends THREE.Mesh {
+73
View File
@@ -3,20 +3,93 @@ import { SplatAccumulator } from './SplatAccumulator';
import { SplatGeometry } from './SplatGeometry';
import * as THREE from "three";
export type SparkViewpointOptions = {
/**
* Controls whether to auto-update its sort order whenever the SparkRenderer
* updates the Gsplats. If you expect to render/display from this viewpoint
* most frames, set this to true.
* @default false
*/
autoUpdate?: boolean;
/**
* Set a THREE.Camera for this viewpoint to follow.
* @default undefined
*/
camera?: THREE.Camera;
/**
* Set an explicit view-to-world transformation matrix for this viewpoint (equivalent
* to camera.matrixWorld), overrides any camera setting.
* @default undefined
*/
viewToWorld?: THREE.Matrix4;
/**
* Configure viewpoint with an off-screen render target.
* @default undefined
*/
target?: {
/**
* Width of the render target in pixels.
*/
width: number;
/**
* Height of the render target in pixels.
*/
height: number;
/**
* If you want to be able to render a scene that depends on this target's
* output (for example, a recursive viewport), set this to true to enable
* double buffering.
* @default false
*/
doubleBuffer?: boolean;
/**
* Super-sampling factor for the render target. Values 1-4 are supported.
* Note that re-sampling back down to .width x .height is done on the CPU
* with simple averaging only when calling readTarget().
* @default 1
*/
superXY?: number;
};
/**
* Callback function that is called when the render target texture is updated.
* Receives the texture as a parameter. Use this to update a viewport with
* the latest viewpoint render each frame.
* @default undefined
*/
onTextureUpdated?: (texture: THREE.Texture) => void;
/**
* Whether to sort splats radially (geometric distance) from the viewpoint (true)
* or by Z-depth (false). Most scenes are trained with the Z-depth sort metric
* and will render more accurately at certain viewpoints. However, radial sorting
* is more stable under viewpoint rotations.
* @default true
*/
sortRadial?: boolean;
/**
* Distance threshold for re-sorting splats. If the viewpoint moves more than
* this distance, splats will be re-sorted.
* @default 0.01 units
*/
sortDistance?: number;
/**
* View direction dot product threshold for re-sorting splats. For
* sortRadial: true we use 0.99 while sortRadial: false uses 0.999 because it is
* more sensitive to view direction.
* @default 0.99 if sortRadial else 0.999
*/
sortCoorient?: boolean;
/**
* Constant added to Z-depth to bias values into the positive range for
* sortRadial: false, but also used for culling Gsplats "well behind"
* the viewpoint origin
* @default 1.0
*/
depthBias?: number;
/**
* Set this to true if rendering a 360 to disable "behind the viewpoint"
* culling during sorting. This is set automatically when rendering 360 envMaps
* using the SparkRenderer.renderEnvMap() utility function.
* @default false
*/
sort360?: boolean;
};
export declare class SparkViewpoint {
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@sparkjsdev/spark",
"version": "0.1.5",
"version": "0.1.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@sparkjsdev/spark",
"version": "0.1.5",
"version": "0.1.6",
"license": "MIT",
"dependencies": {
"fflate": "^0.8.2"