Creates a new GSplatContainer instance.
The graphics device.
Maximum number of splats this container can hold.
The format descriptor with streams and read code. Use GSplatFormat.createDefaultFormat for the built-in format, or create a custom GSplatFormat.
Gets the bounding box of the splats, in the local space of the container.
Sets the bounding box of the splats, in the local space of the container. Set it to the bounds of the splats written to the container, as it is used to cull them.
Gets whether the splats were trained with anti-aliasing.
Sets whether the splats were trained with anti-aliasing (a screen-space filter with opacity
compensation, as in Mip-Splatting), which they need to be rendered with to look right. Loaded
resources set this from the file, when it records the training mode: the antialiased 1 or
SplatRenderMode: mip PLY header comment, the model field of a SOG file, or the
anti-aliased flag of an SPZ file. Set it for files that do not record the training mode.
Used when GSplatParams#antiAlias is undefined, its default. Defaults to false.
CPU-side splat center positions (xyz per splat), or null when not built for this resource.
CPU-side xyz per splat. Allocated lazily on first read; GPU-only rendering can omit touching this property to avoid the extra buffer.
Application-defined data stored with the splat file, as in glTF's extras: the extras
value of a SOG's meta.json. The engine attaches no meaning to it. Undefined when the file
has none, and for formats that cannot carry it.
Gets the format descriptor for this resource. The format defines texture streams and shader code for reading splat data. Use this to add extra streams.
Maximum number of splats this container can hold.
Gets the number of splats to render.
Gets the texture dimensions (width and height) used by this resource's data textures.
Protected_Protected
Actually destroys this resource and releases all GPU resources. Derived classes should override this method instead of destroy().
Destroys this resource. If the resource is still in use by the sorter, destruction is automatically deferred until it's safe.
Gets a texture by name.
The name of the texture.
The texture, or null if not found.
Updates the container after modifying texture data and centers. Call this after filling data to signal that the container contents have changed.
OptionalnumSplats: number = ...
Number of splats to render. Defaults to current value. Must be between 0 and maxSplats.
OptionalcentersUpdated: boolean = true
Whether the centers array was modified. Set to false when only numSplats changes but center positions remain the same, to avoid the cost of re-cloning centers in the sorter (can be significant for large containers).
A container for procedural Gaussian Splat data. This class allows you to create splat data programmatically using either a built-in format or a custom format with your own texture streams and read code.
A default format is provided via GSplatFormat.createDefaultFormat which uses float textures for easy CPU population.
Example
Example