Skip to content

Commit 2723c72

Browse files
authored
Merge pull request #12799 from BlockCnFuture/fix/gaussian-splat-flicker
Fix/gaussian splat flicker
2 parents 6cb7dd5 + 8e0427b commit 2723c72

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#### Fixes :wrench:
88

99
- Materials loaded from type now respect submaterials present in the referenced material type. [#10566](https://github.com/CesiumGS/cesium/issues/10566)
10+
- Fix flickering artifact in Gaussian splat models caused by incorrect sorting results. [#12662](https://github.com/CesiumGS/cesium/issues/12662)
1011

1112
#### Additions :tada:
1213

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
429429
- [Matt Schwartz](https://github.com/mzschwartz5)
430430
- [Easy Mahaffey](https://github.com/easymaahffey)
431431
- [Pamela Augustine](https://github.com/pamelaAugustine)
432+
- [宋时旺](https://github.com/BlockCnFuture)

packages/engine/Source/Scene/GaussianSplatPrimitive.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ GaussianSplatPrimitive.generateSplatTexture = function (primitive, frameState) {
566566
},
567567
});
568568
}
569-
569+
primitive._vertexArray = undefined;
570570
primitive._lastTextureHeight = splatTextureData.height;
571571
primitive._lastTextureWidth = splatTextureData.width;
572572

@@ -652,8 +652,9 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
652652

653653
const uniformMap = renderResources.uniformMap;
654654

655+
const textureCache = primitive.gaussianSplatTexture;
655656
uniformMap.u_splatAttributeTexture = function () {
656-
return primitive.gaussianSplatTexture;
657+
return textureCache;
657658
};
658659

659660
if (primitive._sphericalHarmonicsDegree > 0) {
@@ -768,12 +769,13 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
768769
scratchMatrix4B,
769770
);
770771

772+
const vertexArrayCache = primitive._vertexArray;
771773
const command = new DrawCommand({
772774
boundingVolume: tileset.boundingSphere,
773775
modelMatrix: modelMatrix,
774776
uniformMap: uniformMap,
775777
renderState: renderState,
776-
vertexArray: primitive._vertexArray,
778+
vertexArray: vertexArrayCache,
777779
shaderProgram: shaderProgram,
778780
cull: renderStateOptions.cull.enabled,
779781
pass: Pass.GAUSSIAN_SPLATS,

0 commit comments

Comments
 (0)