From 8bcb716df171fd7ad3848d57abe9f1902b8addde Mon Sep 17 00:00:00 2001 From: keyboardspecialist Date: Thu, 16 Oct 2025 15:16:34 -0500 Subject: [PATCH] Fixes issue where multiple GS primitives ended up sharing the same scratch matrix as their draw command model matrix The draw command doesn't take ownership of the underlying matrix, so whichever tileset went last won causing tilesets to shift incorrectly draw command owner was also incorrectly set as "this" instead of primitive. --- packages/engine/Source/Scene/GaussianSplatPrimitive.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/engine/Source/Scene/GaussianSplatPrimitive.js b/packages/engine/Source/Scene/GaussianSplatPrimitive.js index 1990c9c0c9b3..e0a5ac827621 100644 --- a/packages/engine/Source/Scene/GaussianSplatPrimitive.js +++ b/packages/engine/Source/Scene/GaussianSplatPrimitive.js @@ -766,7 +766,7 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function ( const modelMatrix = Matrix4.multiply( tileset.modelMatrix, Matrix4.fromArray(tileset.root.transform), - scratchMatrix4B, + new Matrix4(), ); const vertexArrayCache = primitive._vertexArray; @@ -780,7 +780,7 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function ( cull: renderStateOptions.cull.enabled, pass: Pass.GAUSSIAN_SPLATS, count: renderResources.count, - owner: this, + owner: primitive, instanceCount: renderResources.instanceCount, primitiveType: PrimitiveType.TRIANGLE_STRIP, debugShowBoundingVolume: tileset.debugShowBoundingVolume,