import { SparkViewpointOptions } from '@sparkjsdev/spark'; import { Clock } from 'three'; export type SparkRendererProps = { /** * Whether to use premultiplied alpha when accumulating splat RGB * @dial rendering * @dial-cols 2 * @dial-dtype boolean * @dial-label "Premultiplied Alpha" * @dial-default true */ premultipliedAlpha?: boolean; /** * Pass in a THREE.Clock to synchronize time-based effects * @dial-ignore */ clock?: Clock; /** * Controls whether to check and automatically update splat collection after each frame render * @dial rendering * @dial-dtype boolean * @dial-label "Auto Update" * @dial-default true */ autoUpdate?: boolean; /** * Controls whether to update the splats before or after rendering. For WebXR this must be false * @dial rendering * @dial-dtype boolean * @dial-label "Pre Update" * @dial-default false */ preUpdate?: boolean; /** * Maximum standard deviations from the center to render Gaussians. * sqrt(5)≈2.24 to sqrt(9)=3.0 are typical values. Higher = more coverage but slower. * @dial quality * @dial-cols 2 * @dial-dtype number * @dial-label "Max Std Dev" * @dial-min 0.1 * @dial-max 3 * @dial-step 0.1 * @dial-default 2.83 */ maxStdDev?: number; /** * Modulate Gaussian kernel falloff. 0 = flat shading, 1 = normal Gaussian kernel. * @dial quality * @dial-dtype number * @dial-label "Gaussian Falloff" * @dial-min 0 * @dial-max 1 * @dial-step 0.01 * @dial-default 1.0 */ falloff?: number; /** * Parameter to adjust projected splat scale to match other renderers. * Higher values sharpen splats. 2.0 matches PlayCanvas renderer. * @dial quality * @dial-dtype number * @dial-label "Focal Adjustment" * @dial-min 0.5 * @dial-max 3.0 * @dial-step 0.05 * @dial-default 1.0 */ focalAdjustment?: number; /** * Scalar value to add to 2D splat covariance for pre-blur. * For scenes trained without anti-aliasing, typically 0.3. * @dial quality * @dial-dtype number * @dial-label "Pre Blur" * @dial-min 0 * @dial-max 1 * @dial-step 0.05 * @dial-default 0.0 */ preBlurAmount?: number; /** * Scalar value to add to 2D splat covariance with opacity adjustment. * Typically 0.3 (≈0.5 pixel radius) for anti-aliased scenes. * @dial quality * @dial-dtype number * @dial-label "Blur Amount" * @dial-min 0 * @dial-max 1 * @dial-step 0.05 * @dial-default 0.0 */ blurAmount?: number; /** * Enable 2D Gaussian splatting rendering ability. * Only affects scenes trained with 2DGS (scale components of 0). * @dial-ignore */ enable2DGS?: boolean; /** * Depth-of-field distance to focal plane. Set apertureSize > 0 to enable DoF. * @dial depth-of-field * @dial-cols 2 * @dial-dtype number * @dial-label "Focal Plane Dist" * @dial-min 0 * @dial-max 15 * @dial-step 0.1 * @dial-default 0.0 */ focalDistance?: number; /** * Aperture size for depth-of-field effect. 0 disables DoF. * Internally converted to apertureAngle: 2 * atan(0.5 * apertureSize / focalDistance) * @dial depth-of-field * @dial-dtype number * @dial-label "Aperture Size" * @dial-min 0 * @dial-max 1 * @dial-step 0.01 * @dial-default 0.0 */ apertureSize?: number; /** * Minimum pixel radius for splat rendering. Increase to filter tiny splats. * @dial clipping * @dial-cols 2 * @dial-dtype number * @dial-label "Min Pixel Radius" * @dial-min 0 * @dial-max 5 * @dial-step 0.1 * @dial-default 0.0 */ minPixelRadius?: number; /** * Maximum pixel radius for splat rendering. Limits very large splats. * @dial clipping * @dial-dtype number * @dial-label "Max Pixel Radius" * @dial-min 128 * @dial-max 2048 * @dial-step 64 * @dial-default 512.0 */ maxPixelRadius?: number; /** * Minimum alpha value for splat rendering. Higher values cull semi-transparent splats. * @dial clipping * @dial-dtype number * @dial-label "Min Alpha" * @dial-min 0 * @dial-max 0.5 * @dial-step 0.001 * @dial-default 0.002 */ minAlpha?: number; /** * X/Y clipping boundary factor for splat centers against view frustum. * 1.0 clips exactly at bounds, 1.4 clips 40% beyond. * @dial clipping * @dial-dtype number * @dial-label "Clip XY" * @dial-min 1.0 * @dial-max 2.0 * @dial-step 0.1 * @dial-default 1.4 */ clipXY?: number; /** * Distance threshold for SparkRenderer movement triggering a splat update. * Only relevant when SparkRenderer is a child of camera. * @dial rendering * @dial-dtype number * @dial-label "Origin Distance" * @dial-min 0.1 * @dial-max 100 * @dial-step 0.5 * @dial-default 1.0 */ originDistance?: number; /** * Configures the SparkViewpointOptions for the default SparkViewpoint * @dial-ignore */ view?: SparkViewpointOptions; }; /** * SparkRenderer component for configuring the Spark rendering engine. * * Spark automatically creates a SparkRenderer if you don't provide one. * Use this component for advanced control over rendering parameters like * blur, depth-of-field, 2DGS mode, and performance tuning. * * @example * ```tsx * // Basic usage with depth-of-field * * * * * ``` */ export default function SparkRenderer({ premultipliedAlpha, clock, autoUpdate, preUpdate, originDistance, maxStdDev, minPixelRadius, maxPixelRadius, minAlpha, enable2DGS, preBlurAmount, blurAmount, focalDistance, apertureSize, falloff, clipXY, focalAdjustment, view, }: SparkRendererProps): any;