Skip to content

Commit 8bcb716

Browse files
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.
1 parent bb28a74 commit 8bcb716

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/engine/Source/Scene/GaussianSplatPrimitive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
766766
const modelMatrix = Matrix4.multiply(
767767
tileset.modelMatrix,
768768
Matrix4.fromArray(tileset.root.transform),
769-
scratchMatrix4B,
769+
new Matrix4(),
770770
);
771771

772772
const vertexArrayCache = primitive._vertexArray;
@@ -780,7 +780,7 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
780780
cull: renderStateOptions.cull.enabled,
781781
pass: Pass.GAUSSIAN_SPLATS,
782782
count: renderResources.count,
783-
owner: this,
783+
owner: primitive,
784784
instanceCount: renderResources.instanceCount,
785785
primitiveType: PrimitiveType.TRIANGLE_STRIP,
786786
debugShowBoundingVolume: tileset.debugShowBoundingVolume,

0 commit comments

Comments
 (0)