@@ -78,62 +78,101 @@ THREE.Scene.prototype.onBeforeRender = function (
7878} ;
7979
8080export type SparkRendererOptions = {
81- // Pass in your THREE.WebGLRenderer instance so Spark can perform work
82- // outside the usual render loop. Should be created with antialias: false
83- // (default setting) as WebGL anti-aliasing doesn't improve Gaussian Splatting
84- // rendering and significantly reduces performance.
81+ /**
82+ * Pass in your THREE.WebGLRenderer instance so Spark can perform work
83+ * outside the usual render loop. Should be created with antialias: false
84+ * (default setting) as WebGL anti-aliasing doesn't improve Gaussian Splatting
85+ * rendering and significantly reduces performance.
86+ */
8587 renderer : THREE . WebGLRenderer ;
86- // Pass in a THREE.Clock to synchronize time-based effects across different
87- // systems. Alternatively, you can set the SparkRenderer properties time and
88- // deltaTime directly. (default: new THREE.Clock)
88+ /**
89+ * Pass in a THREE.Clock to synchronize time-based effects across different
90+ * systems. Alternatively, you can set the SparkRenderer properties time and
91+ * deltaTime directly. (default: new THREE.Clock)
92+ */
8993 clock ?: THREE . Clock ;
90- // Controls whether to check and automatically update Gsplat collection after
91- // each frame render. (default: true)
94+ /**
95+ * Controls whether to check and automatically update Gsplat collection after
96+ * each frame render.
97+ * @default true
98+ */
9299 autoUpdate ?: boolean ;
93- // Controls whether to update the Gsplats before or after rendering. For WebXR
94- // this must be false in order to complete rendering as soon as possible.
95- // (default: false)
100+ /**
101+ * Controls whether to update the Gsplats before or after rendering. For WebXR
102+ * this must be false in order to complete rendering as soon as possible.
103+ * @default false
104+ */
96105 preUpdate ?: boolean ;
97- // Distance threshold for SparkRenderer movement triggering a Gsplat update at
98- // the new origin. (default: 1.0)
106+ /**
107+ * Distance threshold for SparkRenderer movement triggering a Gsplat update at
108+ * the new origin.
109+ * @default 1.0
110+ */
99111 originDistance ?: number ;
100- // Maximum standard deviations from the center to render Gaussians. Values
101- // Math.sqrt(5)..Math.sqrt(8) produce good results and can be tweaked for
102- // performance. (default: Math.sqrt(8))
112+ /**
113+ * Maximum standard deviations from the center to render Gaussians. Values
114+ * Math.sqrt(5)..Math.sqrt(8) produce good results and can be tweaked for
115+ * performance.
116+ * @default Math.sqrt(8)
117+ */
103118 maxStdDev ?: number ;
104- // Enable 2D Gaussian splatting rendering ability. When this mode is enabled,
105- // any scale x/y/z component that is exactly 0 (minimum quantized value) results
106- // in the other two non-0 axis being interpreted as an oriented 2D Gaussian Splat,
107- // rather instead of the usual projected 3DGS Z-slice. When reading PLY files,
108- // scale values less than e^-30 will be interpreted as 0. (default: false)
119+ /**
120+ * Enable 2D Gaussian splatting rendering ability. When this mode is enabled,
121+ * any scale x/y/z component that is exactly 0 (minimum quantized value) results
122+ * in the other two non-0 axis being interpreted as an oriented 2D Gaussian Splat,
123+ * rather instead of the usual projected 3DGS Z-slice. When reading PLY files,
124+ * scale values less than e^-30 will be interpreted as 0.
125+ * @default false
126+ */
109127 enable2DGS ?: boolean ;
110- // Scalar value to add to 2D splat covariance diagonal, effectively blurring +
111- // enlarging splats. In scenes trained without the Gsplat anti-aliasing tweak
112- // this value was typically 0.3, but with anti-aliasing it is 0.0 (default: 0.0)
128+ /**
129+ * Scalar value to add to 2D splat covariance diagonal, effectively blurring +
130+ * enlarging splats. In scenes trained without the Gsplat anti-aliasing tweak
131+ * this value was typically 0.3, but with anti-aliasing it is 0.0
132+ * @default 0.0
133+ */
113134 preBlurAmount ?: number ;
114- // Scalar value to add to 2D splat covarianve diagonal, with opacity adjustment
115- // to correctly account for "blurring" when anti-aliasing. Typically 0.3
116- // (equivalent to approx 0.5 pixel radius) in scenes trained with anti-aliasing.
135+ /**
136+ * Scalar value to add to 2D splat covarianve diagonal, with opacity adjustment
137+ * to correctly account for "blurring" when anti-aliasing. Typically 0.3
138+ * (equivalent to approx 0.5 pixel radius) in scenes trained with anti-aliasing.
139+ */
117140 blurAmount ?: number ;
118- // Depth-of-field distance to focal plane
141+ /**
142+ * Depth-of-field distance to focal plane
143+ */
119144 focalDistance ?: number ;
120- // Full-width angle of aperture opening (in radians), default 0.0 to disable
145+ /**
146+ * Full-width angle of aperture opening (in radians), 0.0 to disable
147+ * @default 0.0
148+ */
121149 apertureAngle ?: number ;
122- // Modulate Gaussian kernel falloff. 0 means "no falloff, flat shading",
123- // while 1 is the normal Gaussian kernel. (default: 1.0)
150+ /**
151+ * Modulate Gaussian kernel falloff. 0 means "no falloff, flat shading",
152+ * while 1 is the normal Gaussian kernel.
153+ * @default 1.0
154+ */
124155 falloff ?: number ;
125- // X/Y clipping boundary factor for Gsplat centers against view frustum.
126- // 1.0 clips any centers that are exactly out of bounds, while 1.4 clips
127- // centers that are 40% beyond the bounds. (default: 1.4)
156+ /**
157+ * X/Y clipping boundary factor for Gsplat centers against view frustum.
158+ * 1.0 clips any centers that are exactly out of bounds, while 1.4 clips
159+ * centers that are 40% beyond the bounds.
160+ * @default 1.4
161+ */
128162 clipXY ?: number ;
129- // Parameter to adjust projected splat scale calculation to match other renderers,
130- // similar to the same parameter in the MKellogg 3DGS renderer. Higher values will
131- // tend to sharpen the splats. A value 2.0 can be used to match the behavior of
132- // the PlayCanvas renderer. (default: 1.0)
163+ /**
164+ * Parameter to adjust projected splat scale calculation to match other renderers,
165+ * similar to the same parameter in the MKellogg 3DGS renderer. Higher values will
166+ * tend to sharpen the splats. A value 2.0 can be used to match the behavior of
167+ * the PlayCanvas renderer.
168+ * @default 1.0
169+ */
133170 focalAdjustment ?: number ;
134- // Configures the SparkViewpointOptions for the default SparkViewpoint
135- // associated with this SparkRenderer. Notable option: sortRadial (sort by
136- // radial distance or Z-depth)
171+ /**
172+ * Configures the SparkViewpointOptions for the default SparkViewpoint
173+ * associated with this SparkRenderer. Notable option: sortRadial (sort by
174+ * radial distance or Z-depth)
175+ */
137176 view ?: SparkViewpointOptions ;
138177} ;
139178
0 commit comments