Creates a new GSplatProcessor instance.
The graphics device.
Source configuration specifying where to read from. Can specify resource directly or component (for instance textures).
Destination configuration specifying where to write. Can specify resource directly or component (for instance textures).
Shader options for the processing logic.
OptionalprocessGLSL?: stringGLSL code at module scope. Must define a void process()
function that implements the processing logic. Can include uniform declarations and helper functions.
OptionalprocessWGSL?: stringWGSL code at module scope. Must define a fn process()
function that implements the processing logic. Can include uniform declarations and helper functions.
The blend state to use when processing. Allows accumulation of results (e.g., additive blending for painting). Defaults to no blending.
Removes a shader parameter.
The name of the parameter to remove.
Destroys this processor and releases all resources.
Gets a shader parameter value previously set with setParameter.
The name of the parameter.
The parameter value, or undefined if not set.
Executes the processing, reading from source streams and writing to destination streams.
Sets a shader parameter for this processor. Parameters are applied during processing.
The name of the parameter (uniform name in shader).
The value for the parameter.
GSplatProcessor enables GPU-based processing of Gaussian Splat data using custom shader code. Gaussian Splats store per-splat attributes (position, rotation, scale, color, spherical harmonics) in texture streams. This processor reads from source streams and writes results to destination streams, enabling operations like painting, selection marking, or custom data transforms.
Custom streams can be added to loaded gsplat resources via GSplatFormat#addExtraStreams, or you can create fully procedural splat data using GSplatContainer.
The source and destination can reference the same resource or component, as long as the read and write streams don't overlap (you cannot read and write the same stream in one pass).
By default (when source streams are not specified), the processor provides access to the format's built-in getCenter(), getRotation(), getScale(), and getColor() functions for reading splat data. Note: getCenter() must be called first as it loads shared data used by the other functions.
Custom uniforms can be passed to the shader via setParameter, including scalar values, vectors, and additional textures for effects like brush patterns or lookup tables.
The following built-in uniforms are available in processing shaders:
srcNumSplats(uint) - Number of splats in source resourcedstNumSplats(uint) - Number of splats in destination resourceExample