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

    Class GSplatFormat

    Gsplat resources store per-splat data (positions, colors, rotations, scales, spherical harmonics) in GPU textures. This class describes those texture streams and generates the shader code needed to access them.

    Each stream defines a texture with a name and pixel format. The class automatically generates shader declarations (uniforms/samplers) and load functions (e.g. loadColor()) for each stream. A read shader can be provided to define how splat attributes are extracted from these textures.

    Users can add extra streams via addExtraStreams for custom per-splat data. These can be per-resource (shared across instances) or per-instance (unique to each gsplat component).

    For loaded gsplat resources, base streams are automatically configured based on the loaded data format. For GSplatContainer, users define both base and extra streams to specify the complete data layout.

    Index

    Constructors

    • Creates a new GSplatFormat instance.

      Parameters

      • device: GraphicsDevice

        The graphics device.

      • streams: GSplatStreamDescriptor[]

        Array of stream descriptors.

      • options: { readGLSL?: string; readWGSL?: string }

        Format options.

        • OptionalreadGLSL?: string

          GLSL code defining getCenter(), getColor(), getRotation(), getScale() functions. Can include additional declarations at module scope. Required for WebGL.

        • OptionalreadWGSL?: string

          WGSL code defining getCenter(), getColor(), getRotation(), getScale() functions. Can include additional declarations at module scope. Required for WebGPU.

      Returns GSplatFormat

    Properties

    Array of stream descriptors.

    Accessors

    Methods

    • Adds additional texture streams for custom gsplat data. Each stream defines a texture that can store extra information, accessible in shaders via generated load functions. Streams with storage: GSPLAT_STREAM_INSTANCE are created per gsplat component instance, while others are shared across all instances of the same resource.

      Note: Streams cannot be removed once added currently.

      Parameters

      Returns void