Skip to content

Commit 857aab8

Browse files
committed
Merge branch 'main' into tile-sse
2 parents ba7e242 + 56840e6 commit 857aab8

File tree

20 files changed

+695
-114
lines changed

20 files changed

+695
-114
lines changed

CHANGES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change Log
22

3+
### v0.58.0 - 2026-03-02
4+
5+
##### Fixes :wrench:
6+
7+
- Raster tiles are now included in the progress percentage for `Cesium3DTilesSelection::Tileset`. This allows apps that rely on this progress percentage to continue updating their views until all raster tiles have been properly loaded.
8+
- Fixed various bugs with `CesiumRasterOverlays::GeoJsonDocumentRasterOverlay`:
9+
- Line width is now factored in to calculations of what geometry is visible in any given tile, reducing the possibility that certain geometry (like perfectly vertical or horizontal lines) would be incorrectly ignored.
10+
- Geometry near the antimeridian, such as lines that need to wrap around the entire globe, will now render correctly without gaps.
11+
- Geometry contained in other objects, such as polygons within feature collections, will no longer cause the geometry to be incorrectly rendered multiple times.
12+
- Updated the `KHR_gaussian_splatting` autogenerated classes to the Release Candidate version of the extension.
13+
314
### v0.57.0 - 2026-02-02
415

516
##### Additions :tada:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ endif()
194194
include("cmake/defaults.cmake")
195195

196196
project(cesium-native
197-
VERSION 0.57.0
197+
VERSION 0.58.0
198198
LANGUAGES CXX C
199199
)
200200

Cesium3DTilesSelection/src/TilesetViewGroup.cpp

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,10 @@ void TilesetViewGroup::finishFrame(
158158
updateResult.tilesKicked +
159159
this->_tilesAlreadyLoadingOrUnloading;
160160

161-
if (tilesLoading == 0) {
162-
this->_loadProgressPercentage = 100.0f;
163-
} else {
164-
this->_loadProgressPercentage =
165-
100.0f * float(totalTiles - tilesLoading) / float(totalTiles);
166-
}
167-
168161
// aggregate all the credits needed from this tileset for the current frame
169162
const std::shared_ptr<CreditSystem>& pCreditSystem =
170163
tileset.getExternals().pCreditSystem;
164+
171165
if (pCreditSystem) {
172166
this->_currentFrameCredits.setCreditSystem(pCreditSystem);
173167

@@ -190,36 +184,51 @@ void TilesetViewGroup::finishFrame(
190184

191185
pActivated->getTileProvider()->addCredits(this->_currentFrameCredits);
192186
}
187+
}
193188

194-
// Add per-tile credits for tiles selected this frame.
195-
for (const Tile::ConstPointer& pTile :
196-
updateResult.tilesToRenderThisFrame) {
197-
const std::vector<RasterMappedTo3DTile>& mappedRasterTiles =
198-
pTile->getMappedRasterTiles();
199-
// raster overlay tile credits
200-
for (const RasterMappedTo3DTile& mappedRasterTile : mappedRasterTiles) {
201-
const RasterOverlayTile* pRasterOverlayTile =
202-
mappedRasterTile.getReadyTile();
203-
if (pRasterOverlayTile != nullptr) {
204-
for (const Credit& credit : pRasterOverlayTile->getCredits()) {
205-
this->_currentFrameCredits.addCreditReference(credit);
206-
}
207-
}
189+
for (const Tile::ConstPointer& pTile : updateResult.tilesToRenderThisFrame) {
190+
// add tile render content credits like gltf copyrights
191+
const TileRenderContent* pRenderContent =
192+
pTile->getContent().getRenderContent();
193+
if (pCreditSystem && pRenderContent) {
194+
for (const Credit& credit : pRenderContent->getCredits()) {
195+
this->_currentFrameCredits.addCreditReference(credit);
208196
}
197+
}
209198

210-
// content credits like gltf copyrights
211-
const TileRenderContent* pRenderContent =
212-
pTile->getContent().getRenderContent();
213-
if (pRenderContent) {
214-
for (const Credit& credit : pRenderContent->getCredits()) {
199+
// add mapped raster tile credits and tile progress percentage
200+
const std::vector<RasterMappedTo3DTile>& mappedRasterTiles =
201+
pTile->getMappedRasterTiles();
202+
for (const RasterMappedTo3DTile& mappedRasterTile : mappedRasterTiles) {
203+
// add mapped raster tile credits for tiles selected this frame.
204+
const RasterOverlayTile* pRasterOverlayTile =
205+
mappedRasterTile.getReadyTile();
206+
if (pCreditSystem && pRasterOverlayTile != nullptr) {
207+
for (const Credit& credit : pRasterOverlayTile->getCredits()) {
215208
this->_currentFrameCredits.addCreditReference(credit);
216209
}
217210
}
211+
212+
// add the mapped raster tile in the progress percentage.
213+
++totalTiles;
214+
if (mappedRasterTile.getState() !=
215+
RasterMappedTo3DTile::AttachmentState::Attached)
216+
++tilesLoading;
218217
}
218+
}
219219

220+
if (pCreditSystem) {
220221
this->_previousFrameCredits.releaseAllReferences();
221222
std::swap(this->_previousFrameCredits, this->_currentFrameCredits);
222223
}
224+
225+
// update progress percentage
226+
if (tilesLoading == 0) {
227+
this->_loadProgressPercentage = 100.0f;
228+
} else {
229+
this->_loadProgressPercentage =
230+
100.0f * float(totalTiles - tilesLoading) / float(totalTiles);
231+
}
223232
}
224233

225234
float TilesetViewGroup::getPreviousLoadProgressPercentage() const {

CesiumGeospatial/src/GlobeRectangle.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,19 @@ GlobeRectangle::computeUnion(const GlobeRectangle& other) const noexcept {
131131
rectangleWest += CesiumUtility::Math::TwoPi;
132132
}
133133

134-
const double west = CesiumUtility::Math::convertLongitudeRange(
135-
glm::min(rectangleWest, otherRectangleWest));
136-
const double east = CesiumUtility::Math::convertLongitudeRange(
137-
glm::max(rectangleEast, otherRectangleEast));
134+
double west = glm::min(rectangleWest, otherRectangleWest);
135+
double east = glm::max(rectangleEast, otherRectangleEast);
136+
137+
// convertLongitudeRange will wrap values that are greater *or equal* to PI,
138+
// which means a rectangle from [-PI, PI] would be wrapped to [-PI, -PI] - a
139+
// completely different result. This is not what we want.
140+
if (west != CesiumUtility::Math::OnePi) {
141+
west = CesiumUtility::Math::convertLongitudeRange(west);
142+
}
143+
144+
if (east != CesiumUtility::Math::OnePi) {
145+
east = CesiumUtility::Math::convertLongitudeRange(east);
146+
}
138147

139148
return GlobeRectangle(
140149
west,

CesiumGltfWriter/generated/src/ModelJsonWriter.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,17 +1198,11 @@ void writeJson(
11981198
jsonWriter.Key("colorSpace");
11991199
writeJson(obj.colorSpace, jsonWriter, context);
12001200

1201-
if (obj.projection !=
1202-
CesiumGltf::ExtensionKhrGaussianSplatting::Projection::perspective) {
1203-
jsonWriter.Key("projection");
1204-
writeJson(obj.projection, jsonWriter, context);
1205-
}
1201+
jsonWriter.Key("projection");
1202+
writeJson(obj.projection, jsonWriter, context);
12061203

1207-
if (obj.sortingMethod != CesiumGltf::ExtensionKhrGaussianSplatting::
1208-
SortingMethod::cameraDistance) {
1209-
jsonWriter.Key("sortingMethod");
1210-
writeJson(obj.sortingMethod, jsonWriter, context);
1211-
}
1204+
jsonWriter.Key("sortingMethod");
1205+
writeJson(obj.sortingMethod, jsonWriter, context);
12121206

12131207
writeExtensibleObject(obj, jsonWriter, context);
12141208

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include <filesystem>
4+
5+
namespace CesiumNativeTests {
6+
/**
7+
* @brief Tests that the contents of `fileA` are equal to the contents of
8+
* `fileB`.
9+
*/
10+
void checkFilesEqual(
11+
const std::filesystem::path& fileA,
12+
const std::filesystem::path& fileB);
13+
} // namespace CesiumNativeTests
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <CesiumNativeTests/checkFilesEqual.h>
2+
#include <CesiumNativeTests/readFile.h>
3+
4+
#include <doctest/doctest.h>
5+
6+
#include <cstddef>
7+
#include <filesystem>
8+
#include <vector>
9+
10+
namespace CesiumNativeTests {
11+
void checkFilesEqual(
12+
const std::filesystem::path& fileA,
13+
const std::filesystem::path& fileB) {
14+
const std::vector<std::byte>& bytes = readFile(fileA);
15+
const std::vector<std::byte>& bytes2 = readFile(fileB);
16+
17+
REQUIRE(bytes == bytes2);
18+
}
19+
} // namespace CesiumNativeTests

CesiumRasterOverlays/include/CesiumRasterOverlays/UrlTemplateRasterOverlay.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ class CESIUMRASTEROVERLAYS_API UrlTemplateRasterOverlay final
8484
*
8585
* The following template parameters are supported in `url`:
8686
* - `{x}` - The tile X coordinate in the tiling scheme, where 0 is the westernmost tile.
87-
* - `{y}` - The tile Y coordinate in the tiling scheme, where 0 is the nothernmost tile.
87+
* - `{y}` - The tile Y coordinate in the tiling scheme, where 0 is the southernmost tile.
8888
* - `{z}` - The level of the tile in the tiling scheme, where 0 is the root of the quadtree pyramid.
8989
* - `{reverseX}` - The tile X coordinate in the tiling scheme, where 0 is the easternmost tile.
90-
* - `{reverseY}` - The tile Y coordinate in the tiling scheme, where 0 is the southernmost tile.
90+
* - `{reverseY}` - The tile Y coordinate in the tiling scheme, where 0 is the northernmost tile.
9191
* - `{reverseZ}` - The tile Z coordinate in the tiling scheme, where 0 is equivalent to `urlTemplateOptions.maximumLevel`.
9292
* - `{westDegrees}` - The western edge of the tile in geodetic degrees.
9393
* - `{southDegrees}` - The southern edge of the tile in geodetic degrees.

0 commit comments

Comments
 (0)