Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Improved performance and reduced memory usage of `Event` class. [#12896](https://github.com/CesiumGS/cesium/pull/12896)
- Fixes vertical misalignment of glyphs in labels with small fonts [#8474](https://github.com/CesiumGS/cesium/issues/8474)
- Prevent runtime errors for certain forms of invalid PNTS files [#12872](https://github.com/CesiumGS/cesium/issues/12872)
- Improved tile selection check for Gaussian splats. Allows proper LoD rendering.

#### Additions :tada:

Expand Down
22 changes: 18 additions & 4 deletions packages/engine/Source/Scene/GaussianSplatPrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,24 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
return;
}

if (
tileset._selectedTiles.length !== 0 &&
tileset._selectedTiles.length !== this.selectedTileLength
) {
const selectionChanged = () => {
const currentSelection = tileset._selectedTiles;
if (this._previousSelectionLength !== currentSelection.length) {
this._previousSelectionLength = currentSelection.length;
return true;
}
for (let i = 0; i < currentSelection.length; i++) {
if (!currentSelection[i]._wasSelectedLastFrame) {
this._previousSelectionLength = currentSelection.length;
return true;
}
}

this._previousSelectionLength = currentSelection.length;
return false;
};

if (selectionChanged()) {
this._numSplats = 0;
this._positions = undefined;
this._rotations = undefined;
Expand Down