Creates a new GSplatFormat instance.
The graphics device.
Array of stream descriptors.
Format options.
OptionalreadGLSL?: stringGLSL code defining getCenter(), getColor(), getRotation(), getScale() functions. Can include additional declarations at module scope. Required for WebGL.
OptionalreadWGSL?: stringWGSL code defining getCenter(), getColor(), getRotation(), getScale() functions. Can include additional declarations at module scope. Required for WebGPU.
Gets the extra streams array. Streams can only be added via addExtraStreams, not removed. Do not modify the returned array directly.
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.
Array of stream descriptors to add.
StaticcreateCreates a default format using 32F/16F textures, simple to use for CPU data population. This format can be rendered to by GSplatProcessor when supported. Check GraphicsDevice#textureFloatRenderable (for RGBA32F) and GraphicsDevice#textureHalfFloatRenderable (for RGBA16F).
The format stores:
dataColor (RGBA16F): color.rgba as half floatsdataCenter (RGBA32F): center.xyz as floats (w unused)dataScale (RGBA16F): scale.xyz as half floats (w unused)dataRotation (RGBA16F): rotation.xyzw as half floats (w stored directly, not derived)The graphics device.
The default format.
StaticcreateCreates a simple format with uniform-scale splats and no rotation. Streams:
dataCenter (RGBA32F): center.xyz + uniform size in wdataColor (RGBA16F): color.rgba as half floatsThe graphics device.
The simple format.
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.