Engine API Reference - v2.18.0
    Preparing search index...

    Class GSplatParams

    Parameters for GSplat unified system.

    Index

    Constructors

    Properties

    colorRampIntensity: number = 1

    Intensity multiplier for overdraw visualization mode. Value of 1 uses alpha of 1/32, allowing approximately 32 overdraws to reach full brightness with additive blending. Higher values increase brightness per splat. Defaults to 1.

    colorUpdateAngle: number = 10

    Viewing angle threshold in degrees for triggering spherical harmonics color updates. When the camera translates enough to change the viewing angle to an octree node or splat by this amount, its SH colors are re-evaluated. Distant nodes naturally update less frequently since they require more camera movement to reach the angle threshold. Set to 0 to update every frame where camera moves. Defaults to 10.

    cooldownTicks: number = 100

    Number of update ticks before unloading unused streamed resources. When a streamed resource's reference count reaches zero, it enters a cooldown period before being unloaded. This allows recently used data to remain in memory for quick reuse if needed again soon. Set to 0 to unload immediately when unused. Defaults to 100.

    debugAabbs: boolean = false

    Enables debug rendering of AABBs for GSplat objects. Defaults to false.

    debugNodeAabbs: boolean = false

    Enables debug rendering of AABBs for GSplat octree nodes. Defaults to false.

    lodUpdateAngle: number = 0

    Angle threshold in degrees to trigger LOD updates based on camera rotation. Set to 0 to disable rotation-based updates. Defaults to 0.

    lodUpdateDistance: number = 1

    Distance threshold in world units to trigger LOD updates for camera and gsplat instances. Defaults to 1.

    radialSorting: boolean = false

    Enables radial sorting based on distance from camera (for cubemap rendering). When false, uses directional sorting along camera forward vector. Defaults to false.

    Note: Radial sorting helps reduce sorting artifacts when the camera rotates (looks around), while linear sorting is better at minimizing artifacts when the camera translates (moves).

    useFog: boolean = true

    Whether to apply scene fog to Gaussian splats. When false, splats ignore fog settings even if the scene or camera has fog configured. Defaults to true.

    Accessors

    • get alphaClip(): number

      Gets the alpha clip threshold.

      Returns number

    • set alphaClip(value: number): void

      Sets the alpha threshold below which splats are discarded during shadow, pick, and prepass rendering. Higher values create more aggressive clipping, while lower values preserve more translucent splats. Defaults to 0.3.

      Parameters

      • value: number

      Returns void

    • get antiAlias(): boolean

      Gets whether anti-aliasing compensation is enabled.

      Returns boolean

    • set antiAlias(value: boolean): void

      Enables anti-aliasing compensation for Gaussian splats. Defaults to false.

      This option is intended for splat data that was generated with anti-aliasing enabled during training/export. It improves visual stability and reduces flickering for very small or distant splats.

      If the source splats were generated without anti-aliasing, enabling this option may slightly soften the image or alter opacity.

      Parameters

      • value: boolean

      Returns void

    • get colorRamp(): Texture | null

      Gets the color ramp texture for overdraw visualization.

      Returns Texture | null

    • set colorRamp(value: Texture | null): void

      Gradient texture for elevation-based coloring in overdraw visualization mode. When set, enables overdraw mode with additive blending. When null, uses normal rendering. Texture should be (width x 1) size. World Y coordinate (0-20 range) maps to texture U coordinate. Defaults to null.

      Parameters

      Returns void

    • get currentRenderer(): number

      The current rendering pipeline in effect after platform-based fallback resolution. When renderer is set to a mode requiring WebGPU on a WebGL device, this returns the fallback mode actually being used.

      Returns number

    • get enableIds(): boolean

      Gets the ID storage enabled state.

      Returns boolean

    • set enableIds(value: boolean): void

      Enables or disables per-component ID storage in the work buffer. When enabled, each GSplat component gets a unique ID written to the work buffer. This ID is used by the picking system to identify which component was picked, but is also available to custom shaders for effects like highlighting, animation, or any per-component differentiation.

      Parameters

      • value: boolean

      Returns void

    • get fisheye(): number

      Gets the fisheye projection strength.

      Returns number

    • set fisheye(value: number): void

      Controls the fisheye projection strength for Gaussian splats. The value is in the range [0, 1]:

      • 0: Standard rectilinear (perspective) projection.
      • (0, 1]: Increasing barrel distortion, producing a wider field of view with a "little planet" effect at higher values.

      Enabling fisheye for the first time has a small one-off cost as new shaders are compiled. Subsequent switches between 0 and non-zero are instantaneous.

      Only supported with perspective cameras. Has no effect with orthographic projection.

      Note: This only affects Gaussian splat rendering. Other objects in the scene (meshes, sprites, etc.) continue to use the standard camera projection and are not distorted.

      For best results, enable GSplatParams#radialSorting when using fisheye projection to avoid sorting artifacts caused by the wide field of view.

      Defaults to 0.

      Parameters

      • value: number

      Returns void

    • get format(): GSplatFormat

      Format descriptor for work buffer streams. Describes the textures used by the work buffer for intermediate storage during unified rendering. Users can add extra streams via GSplatFormat#addExtraStreams for custom per-splat data.

      Returns GSplatFormat

      // Add a custom stream to store per-splat component IDs
      app.scene.gsplat.format.addExtraStreams([{
      name: 'splatId',
      format: pc.PIXELFORMAT_R32U
      }]);
    • get lodBehindPenalty(): number

      Gets behind-camera LOD penalty multiplier.

      Returns number

    • set lodBehindPenalty(value: number): void

      Multiplier applied to effective distance for nodes behind the camera when determining LOD. Value 1 means no penalty; higher values drop LOD faster for nodes behind the camera.

      Note: when using a penalty > 1, it often makes sense to set a positive GSplatParams#lodUpdateAngle so LOD is re-evaluated on camera rotation, not just translation.

      Parameters

      • value: number

      Returns void

    • get lodUnderfillLimit(): number

      Gets the maximum allowed underfill LOD range.

      Returns number

    • set lodUnderfillLimit(value: number): void

      Maximum number of LOD levels allowed below the optimal level when the optimal data is not resident in memory. The system may temporarily use a coarser LOD within this limit until the optimal LOD is available. Defaults to 0, which disables fallback (always load optimal). Higher values allow faster loading by using lower-quality data.

      Parameters

      • value: number

      Returns void

    • get material(): ShaderMaterial

      A material template that can be customized by the user. Any defines, parameters, or shader chunks set on this material will be automatically applied to all GSplat components rendered in unified mode. After making changes, call Material#update to for the changes to be applied on the next frame.

      Returns ShaderMaterial

      // Set a custom parameter on all GSplat materials
      app.scene.gsplat.material.setParameter('myCustomParam', 1.0);
      app.scene.gsplat.material.update();
    • get minContribution(): number

      Gets the minimum contribution threshold.

      Returns number

    • set minContribution(value: number): void

      Sets the minimum visual contribution threshold for the GSPLAT_RENDERER_COMPUTE renderer. Splats whose total screen contribution (opacity * projected area) falls below this value are discarded. Higher values cull more aggressively, improving performance at the cost of quality. Set to 0 to disable contribution culling. Defaults to 3.

      Parameters

      • value: number

      Returns void

    • get splatBudget(): number

      Gets the target number of splats across all GSplats in the scene.

      Returns number

    • set splatBudget(value: number): void

      Target number of splats across all GSplats in the scene. When set > 0, the system adjusts LOD levels globally to stay within this budget. Set to 0 to disable budget enforcement and use LOD distances only (default).

      Parameters

      • value: number

      Returns void

    • get twoDimensional(): boolean

      Gets whether 2D Gaussian Splatting mode is enabled.

      Returns boolean

    • set twoDimensional(value: boolean): void

      Enables 2D Gaussian Splatting mode. Defaults to false.

      Renders splats as oriented 2D surface elements instead of volumetric 3D Gaussians. This provides a more surface-accurate appearance but requires splat data that was generated for 2D Gaussian Splatting.

      Enabling this with standard 3D splat data may produce incorrect results.

      Parameters

      • value: boolean

      Returns void