Skip to content

GaussianSplat: public method to update splat buffers after construction #34527

Description

@pallen-anim

Description

Title: GaussianSplat: public method to update splat buffers after construction

Description of the feature
GaussianSplat (r186) copies its geometry into private storage buffers in the
constructor, so there is no public way to change splat centers or colors after
creation. A method like updateBuffers() / setCenters() that re-uploads the
buffers and invalidates the sort would enable animated splats.

Use case
Generating "depth splats" from video: one splat per pixel from an RGB frame +
depth map, rewritten every frame. Writing _buffers.centerRead.value.array,
setting needsUpdate, and clearing _sortInitialized works (a ~300k-splat
scene holds 60 fps with ~4 ms CPU per frame on the rewrite), but relies on
private fields.

Three.js version: r186

Solution

A public method on GaussianSplat that re-uploads splat data from the geometry
attributes (or from passed arrays) and invalidates the sort, e.g.:

splat.updateBuffers(); // re-read position/covariance/color from splatGeometry
// or
splat.setCenters( centers ); // Float32Array, count * 3
splat.setColors( colors ); // Uint8Array, count * 4

Either shape works for my use case. The important parts are: no reconstruction
of the GaussianSplat, no re-creation of the storage buffers, and the next
onBeforeRender sorts again regardless of camera movement.

Alternatives

Rebuilding the GaussianSplat each frame (reallocates GPU storage), or writing the private _buffers fields directly, which works today but depends on internals.

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions