Skip to content

Commit 0ec4bac

Browse files
committed
Merge remote-tracking branch 'origin/main' into jdesreumaux/glTF_modifier-raster_overlays
2 parents 8d63d68 + 56840e6 commit 0ec4bac

28 files changed

Lines changed: 2224 additions & 543 deletions

File tree

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
@@ -157,16 +157,10 @@ void TilesetViewGroup::finishFrame(
157157
updateResult.tilesKicked +
158158
this->_tilesAlreadyLoadingOrUnloading;
159159

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

@@ -189,36 +183,51 @@ void TilesetViewGroup::finishFrame(
189183

190184
pActivated->getTileProvider()->addCredits(this->_currentFrameCredits);
191185
}
186+
}
192187

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

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

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

224233
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,

CesiumGltf/generated/include/CesiumGltf/ExtensionKhrGaussianSplatting.h

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final
2121
* key in the `extensions` object. */
2222
static constexpr const char* ExtensionName = "KHR_gaussian_splatting";
2323

24+
/**
25+
* @brief Known values for Property specifying parameters regarding the kernel
26+
* used to generate the Gaussians.
27+
*/
28+
struct Kernel {
29+
/** @brief `ellipse` */
30+
inline static const std::string ellipse = "ellipse";
31+
};
32+
33+
/**
34+
* @brief Known values for Property specifying the color space of the
35+
* spherical harmonics.
36+
*/
37+
struct ColorSpace {
38+
/** @brief `srgb_rec709_display` */
39+
inline static const std::string srgb_rec709_display = "srgb_rec709_display";
40+
41+
/** @brief `lin_rec709_display` */
42+
inline static const std::string lin_rec709_display = "lin_rec709_display";
43+
};
44+
2445
/**
2546
* @brief Known values for Optional property specifying how to project the
2647
* Gaussians to achieve a perspective correct value. This property defaults to
@@ -29,9 +50,6 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final
2950
struct Projection {
3051
/** @brief `perspective` */
3152
inline static const std::string perspective = "perspective";
32-
33-
/** @brief `orthographic` */
34-
inline static const std::string orthographic = "orthographic";
3553
};
3654

3755
/**
@@ -41,40 +59,24 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final
4159
struct SortingMethod {
4260
/** @brief `cameraDistance` */
4361
inline static const std::string cameraDistance = "cameraDistance";
44-
45-
/** @brief `zDepth` */
46-
inline static const std::string zDepth = "zDepth";
4762
};
4863

4964
/**
50-
* @brief Known values for Optional property specifying the color space of the
51-
* spherical harmonics. This property defaults to BT.709.
65+
* @brief Property specifying parameters regarding the kernel used to generate
66+
* the Gaussians.
67+
*
68+
* Known values are defined in {@link Kernel}.
69+
*
5270
*/
53-
struct ColorSpace {
54-
/** @brief `BT.709` */
55-
inline static const std::string BT_709 = "BT.709";
56-
57-
/** @brief `BT.2020-ITU` */
58-
inline static const std::string BT_2020_ITU = "BT.2020-ITU";
59-
60-
/** @brief `BT.2020-HLG` */
61-
inline static const std::string BT_2020_HLG = "BT.2020-HLG";
62-
63-
/** @brief `BT.2020-PQ` */
64-
inline static const std::string BT_2020_PQ = "BT.2020-PQ";
65-
66-
/** @brief `Display-P3` */
67-
inline static const std::string Display_P3 = "Display-P3";
68-
69-
/** @brief `linear` */
70-
inline static const std::string linear = "linear";
71-
};
71+
std::string kernel = Kernel::ellipse;
7272

7373
/**
74-
* @brief Optional property specifying parameters regarding the kernel used to
75-
* generate the Gaussians. This property defaults to ellipse.
74+
* @brief Property specifying the color space of the spherical harmonics.
75+
*
76+
* Known values are defined in {@link ColorSpace}.
77+
*
7678
*/
77-
std::string kernel = "ellipse";
79+
std::string colorSpace = ColorSpace::srgb_rec709_display;
7880

7981
/**
8082
* @brief Optional property specifying how to project the Gaussians to achieve
@@ -94,15 +96,6 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final
9496
*/
9597
std::string sortingMethod = SortingMethod::cameraDistance;
9698

97-
/**
98-
* @brief Optional property specifying the color space of the spherical
99-
* harmonics. This property defaults to BT.709.
100-
*
101-
* Known values are defined in {@link ColorSpace}.
102-
*
103-
*/
104-
std::string colorSpace = ColorSpace::BT_709;
105-
10699
/**
107100
* @brief Calculates the size in bytes of this object, including the contents
108101
* of all collections, pointers, and strings. This will NOT include the size
@@ -114,7 +107,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final
114107
accum += int64_t(sizeof(ExtensionKhrGaussianSplatting));
115108
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
116109
int64_t(sizeof(CesiumUtility::ExtensibleObject));
117-
accum += int64_t(this->kernel.capacity() * sizeof(char));
110+
118111
return accum;
119112
}
120113
};

CesiumGltfReader/generated/src/ExtensionKhrGaussianSplattingJsonHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class ExtensionKhrGaussianSplattingJsonHandler
4343
private:
4444
CesiumGltf::ExtensionKhrGaussianSplatting* _pObject = nullptr;
4545
CesiumJsonReader::StringJsonHandler _kernel;
46+
CesiumJsonReader::StringJsonHandler _colorSpace;
4647
CesiumJsonReader::StringJsonHandler _projection;
4748
CesiumJsonReader::StringJsonHandler _sortingMethod;
48-
CesiumJsonReader::StringJsonHandler _colorSpace;
4949
};
5050
} // namespace CesiumGltfReader

CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,9 +3007,9 @@ ExtensionKhrGaussianSplattingJsonHandler::
30073007
const CesiumJsonReader::JsonReaderOptions& options) noexcept
30083008
: CesiumJsonReader::ExtensibleObjectJsonHandler(options),
30093009
_kernel(),
3010+
_colorSpace(),
30103011
_projection(),
3011-
_sortingMethod(),
3012-
_colorSpace() {}
3012+
_sortingMethod() {}
30133013

30143014
void ExtensionKhrGaussianSplattingJsonHandler::reset(
30153015
CesiumJsonReader::IJsonHandler* pParentHandler,
@@ -3051,15 +3051,15 @@ CesiumJsonReader::IJsonHandler* ExtensionKhrGaussianSplattingJsonHandler::
30513051
if ("kernel"s == str) {
30523052
return property("kernel", this->_kernel, o.kernel);
30533053
}
3054+
if ("colorSpace"s == str) {
3055+
return property("colorSpace", this->_colorSpace, o.colorSpace);
3056+
}
30543057
if ("projection"s == str) {
30553058
return property("projection", this->_projection, o.projection);
30563059
}
30573060
if ("sortingMethod"s == str) {
30583061
return property("sortingMethod", this->_sortingMethod, o.sortingMethod);
30593062
}
3060-
if ("colorSpace"s == str) {
3061-
return property("colorSpace", this->_colorSpace, o.colorSpace);
3062-
}
30633063

30643064
return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject);
30653065
}

CesiumGltfWriter/generated/src/ModelJsonWriter.cpp

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,28 +1192,17 @@ void writeJson(
11921192
const CesiumJsonWriter::ExtensionWriterContext& context) {
11931193
jsonWriter.StartObject();
11941194

1195-
if (obj.kernel != "ellipse") {
1196-
jsonWriter.Key("kernel");
1197-
writeJson(obj.kernel, jsonWriter, context);
1198-
}
1195+
jsonWriter.Key("kernel");
1196+
writeJson(obj.kernel, jsonWriter, context);
11991197

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

1206-
if (obj.sortingMethod != CesiumGltf::ExtensionKhrGaussianSplatting::
1207-
SortingMethod::cameraDistance) {
1208-
jsonWriter.Key("sortingMethod");
1209-
writeJson(obj.sortingMethod, jsonWriter, context);
1210-
}
1201+
jsonWriter.Key("projection");
1202+
writeJson(obj.projection, jsonWriter, context);
12111203

1212-
if (obj.colorSpace !=
1213-
CesiumGltf::ExtensionKhrGaussianSplatting::ColorSpace::BT_709) {
1214-
jsonWriter.Key("colorSpace");
1215-
writeJson(obj.colorSpace, jsonWriter, context);
1216-
}
1204+
jsonWriter.Key("sortingMethod");
1205+
writeJson(obj.sortingMethod, jsonWriter, context);
12171206

12181207
writeExtensibleObject(obj, jsonWriter, context);
12191208

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

0 commit comments

Comments
 (0)