Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8da5554
First sketches of vector tiles overlay
azrogers Apr 22, 2026
30bbd16
Basic tile selection that doesn't yet work...
azrogers Apr 29, 2026
5f06efd
It works... I think
azrogers May 1, 2026
4a94e9e
It's rasterizing something!
azrogers May 6, 2026
997680e
Primitive restart support
azrogers May 6, 2026
c22f0b9
Fix mutex, add tick
azrogers May 6, 2026
7be2262
Formatting
azrogers May 8, 2026
b9f956b
Merge branch 'main' of github.com:CesiumGS/cesium-native into vector-…
azrogers May 8, 2026
99da4eb
Remove concurrentqueue
azrogers May 8, 2026
9f152d1
Actual test dataset
azrogers May 8, 2026
2d158c2
Improved (?) tick behavior
azrogers May 8, 2026
537b608
Fix I forgot to commit
azrogers May 8, 2026
224f7a5
Add additional constructor to VectorStyle
azrogers May 8, 2026
0e0d06a
thenInWorkerThread crashes... not sure why
azrogers May 8, 2026
693eecd
Algorithm for finding edge loops for triangulated polygon.
azrogers May 12, 2026
94a0b9e
More efficient edge algorithm, still no match for this many polygons
azrogers May 12, 2026
8e70bfb
Generate EXT_mesh_polygon
azrogers May 12, 2026
2a1446f
Working with EXT_mesh_polygon
azrogers May 12, 2026
f7ac37d
Fix duplicate variable name
azrogers May 13, 2026
03dad83
Use raw pointer instead of intrusive pointer for requestedTiles set
azrogers May 13, 2026
11c4120
Reorganize into new library
azrogers May 14, 2026
1eac54c
Real test data for polygons, ion vector tiles loading, format
azrogers May 15, 2026
01f8d1d
Re-privatize TilesetContentManager, address some review comments
azrogers May 22, 2026
b7b59db
More review comments
azrogers May 22, 2026
2a0e295
Remove unused tick behaviors
azrogers May 22, 2026
6225227
Linting and documentation fixes for CI
azrogers May 22, 2026
b321e08
Merge from main
azrogers May 22, 2026
5491182
Fix incorrectly removing CesiumVectorData from Cesium3DTilesSelection…
azrogers May 22, 2026
ff0b152
Fix CI
azrogers May 22, 2026
b37dba3
Fix CI again
azrogers May 22, 2026
6f71bbf
Linting fixes again...
azrogers May 26, 2026
4a4c6da
Add registerAllTileContentTypes
azrogers May 26, 2026
23757c6
Use parent content if no renderable children
azrogers May 27, 2026
6e0816b
Merge branch 'vector-tiles-overlay' of github.com:CesiumGS/cesium-nat…
azrogers May 27, 2026
4f8b75d
Update from review
azrogers May 28, 2026
7fd368a
Don't override constructor
azrogers May 28, 2026
97d6f37
Merge branch 'main' into vector-tiles-overlay
azrogers May 28, 2026
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
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

### ? - ?

##### Breaking Changes :mega:

- `CesiumRasterOverlays::GeoJsonDocumentRasterOverlay` has been moved to the `CesiumVectorOverlays` library and namespace.

##### Additions :tada:

- Added support for [`EXT_mesh_primitive_edge_visibility`](https://github.com/KhronosGroup/glTF/pull/2479) in `CesiumGltf`, `CesiumGltfReader`, and `CesiumGltfWriter`.
- Added support for [`3DTILES_content_conditional`](https://github.com/CesiumGS/3d-tiles/pull/834) in `Cesium3DTiles`, `Cesium3DTilesReader`, and `Cesium3DTilesWriter`.
- Added `CesiumVectorOverlays::VectorTilesRasterOverlay` supporting vector data loaded from 3D Tiles tilesets.
Comment thread
azrogers marked this conversation as resolved.

### v0.60.0 - 2026-05-01

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ add_subdirectory(CesiumIonClient)
add_subdirectory(CesiumITwinClient)
add_subdirectory(CesiumQuantizedMeshTerrain)
add_subdirectory(CesiumVectorData)
add_subdirectory(CesiumVectorOverlays)

if(NOT CESIUM_DISABLE_CURL)
add_subdirectory(CesiumCurl)
Expand Down
22 changes: 22 additions & 0 deletions Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ class CESIUM3DTILESSELECTION_API Tileset final {
*/
const Tile* getRootTile() const noexcept;

/**
* @brief Gets the root tile of this tileset.
*
* This may be `nullptr` if there is currently no root tile.
*/
Tile* getRootTile() noexcept;

Comment on lines +211 to +214

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a good idea to discourage consumers of cesium-native from using this... would @private work for our documentation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for updateTileContent - I think it's fine to leave it open.

/**
* @brief Returns the {@link RasterOverlayCollection} of this tileset.
*/
Expand Down Expand Up @@ -438,6 +445,21 @@ class CESIUM3DTILESSELECTION_API Tileset final {
*/
void loadTiles();

/**
* @brief Updates the content of the given tile based on its current state.
*
* This may involve steps such as updating tile properties based on content,
* creating tile children, handling tile unloading, and more.
*
* @note This is automatically called as part of the normal tile selection
* process, such as when using \ref updateViewGroup or \ref
* updateViewGroupOffline. This method should only be called manually when
* tile selection is being driven by code external to the `Tileset`.
*
* @param tile The tile to update.
*/
void updateTileContent(Tile& tile);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth marking @Private?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's perfectly reasonable that a cesium-native consumer might want to use loadTiles directly and would need a way to access and modify the tiles and to update the tile content. I think it's fine to leave public with the explanation that it does not normally need to be called.


/**
* @brief Registers a tile load requester with this Tileset. Registered tile
* load requesters get to influence which tiles are loaded when
Expand Down
14 changes: 14 additions & 0 deletions Cesium3DTilesSelection/src/Tileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <CesiumAsync/Promise.h>
#include <CesiumAsync/SharedFuture.h>
#include <CesiumGeospatial/Cartographic.h>
#include <CesiumRasterOverlays/ActivatedRasterOverlay.h>
#include <CesiumRasterOverlays/RasterOverlayTile.h>
#include <CesiumUtility/Assert.h>
#include <CesiumUtility/CreditSystem.h>
Expand Down Expand Up @@ -170,6 +171,10 @@ const Tile* Tileset::getRootTile() const noexcept {
return this->_pTilesetContentManager->getRootTile();
}

Tile* Tileset::getRootTile() noexcept {
return this->_pTilesetContentManager->getRootTile();
}

RasterOverlayCollection& Tileset::getOverlays() noexcept {
return this->_pTilesetContentManager->getRasterOverlayCollection();
}
Expand Down Expand Up @@ -472,6 +477,15 @@ void Tileset::loadTiles() {
this->_pTilesetContentManager->processWorkerThreadLoadRequests(
this->_options);
this->_pTilesetContentManager->processMainThreadLoadRequests(this->_options);
for (const IntrusivePointer<ActivatedRasterOverlay>& pOverlay :
this->_pTilesetContentManager->getRasterOverlayCollection()
.getActivatedOverlays()) {
pOverlay->tick();
}
}

void Tileset::updateTileContent(Tile& tile) {
this->_pTilesetContentManager->updateTileContent(tile, this->_options);
}

void Tileset::registerLoadRequester(TileLoadRequester& requester) {
Expand Down
65 changes: 65 additions & 0 deletions CesiumGltf/generated/include/CesiumGltf/ExtensionExtMeshPolygon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <CesiumGltf/Library.h>
#include <CesiumUtility/ExtensibleObject.h>

#include <cstdint>

namespace CesiumGltf {
/**
* @brief glTF extension adding an encoding of polygon primitive topology
*/
struct CESIUMGLTF_API ExtensionExtMeshPolygon final
: public CesiumUtility::ExtensibleObject {
/**
* @brief The original name of this type.
*/
static constexpr const char* TypeName = "ExtensionExtMeshPolygon";
/** @brief The official name of the extension. This should be the same as its
* key in the `extensions` object. */
static constexpr const char* ExtensionName = "EXT_mesh_polygon";

/**
* @brief Integer number of polygons encoded in the mesh primitive.
*/
int32_t count = -1;

/**
* @brief Index of an accessor containing indices of the polygons' exterior
* and interior loops. The accessor MUST have SCALAR type and an unsigned
* integer component type.
*/
int32_t loopIndices = -1;

/**
* @brief Index of an accessor containing one integer offset per polygon in
* the primitive, indicating the first index of the first linear ring
* associated with that polygon.
*/
int32_t loopIndicesOffsets = -1;

/**
* @brief Index of an accessor containing one integer offset per polygon in
* the primitive, indicating the first index of the first triangle associated
* with that polygon.
*/
int32_t indicesOffsets = -1;

/**
* @brief Calculates the size in bytes of this object, including the contents
* of all collections, pointers, and strings. This will NOT include the size
* of any extensions attached to the object. Calling this method may be slow
* as it requires traversing the object's entire structure.
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += int64_t(sizeof(ExtensionExtMeshPolygon));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
int64_t(sizeof(CesiumUtility::ExtensibleObject));

return accum;
}
};
} // namespace CesiumGltf
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final
static constexpr const char* ExtensionName = "KHR_gaussian_splatting";

/**
* @brief Known values for Property specifying parameters regarding the kernel
* used to generate the Gaussians.
* @brief Known values for The kernel used to generate the Gaussians.
*/
struct Kernel {
/** @brief `ellipse` */
inline static const std::string ellipse = "ellipse";
};

/**
* @brief Known values for Property specifying the color space of the
* spherical harmonics.
* @brief Known values for The color space of the reconstructed color values.
*/
struct ColorSpace {
/** @brief `srgb_rec709_display` */
Expand All @@ -43,53 +41,47 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final
};

/**
* @brief Known values for Optional property specifying how to project the
* Gaussians to achieve a perspective correct value. This property defaults to
* perspective.
* @brief Known values for The projection method for rendering the Gaussians.
*/
struct Projection {
/** @brief `perspective` */
inline static const std::string perspective = "perspective";
};

/**
* @brief Known values for Optional property specifying how to sort the
* Gaussians during rendering. This property defaults to cameraDistance.
* @brief Known values for The sorting method for rendering the Gaussians.
*/
struct SortingMethod {
/** @brief `cameraDistance` */
inline static const std::string cameraDistance = "cameraDistance";
};

/**
* @brief Property specifying parameters regarding the kernel used to generate
* the Gaussians.
* @brief The kernel used to generate the Gaussians.
*
* Known values are defined in {@link Kernel}.
*
*/
std::string kernel = Kernel::ellipse;

/**
* @brief Property specifying the color space of the spherical harmonics.
* @brief The color space of the reconstructed color values.
*
* Known values are defined in {@link ColorSpace}.
*
*/
std::string colorSpace = ColorSpace::srgb_rec709_display;

/**
* @brief Optional property specifying how to project the Gaussians to achieve
* a perspective correct value. This property defaults to perspective.
* @brief The projection method for rendering the Gaussians.
*
* Known values are defined in {@link Projection}.
*
*/
std::string projection = Projection::perspective;

/**
* @brief Optional property specifying how to sort the Gaussians during
* rendering. This property defaults to cameraDistance.
* @brief The sorting method for rendering the Gaussians.
*
* Known values are defined in {@link SortingMethod}.
*
Expand Down
43 changes: 43 additions & 0 deletions CesiumGltf/include/CesiumGltf/AccessorUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,49 @@ typedef std::variant<
IndexAccessorType
getIndexAccessorView(const Model& model, const MeshPrimitive& primitive);

/**
* Retrieves an indices accessor view of the accessor at the given index.
*/
IndexAccessorType getIndexAccessorView(const Model& model, int32_t index);

/**
* Visitor that returns the number of indices contained in an IndexAccessorType
* variant.
*/
struct NumIndicesFromAccessor {
/**
* @brief Attempts to obtain a number of indices from an empty
* IndexAccessorType, resulting in 0.
*/
int64_t operator()(std::monostate) { return 0; }

/**
* @brief Attempts to obtain a number of indices from an \ref AccessorView.
*/
template <typename T> int64_t operator()(const AccessorView<T>& value) {
return value.size();
}
};

/**
* @brief Returns the maximum possible index value for the given
* IndexAccessorType.
*/
struct MaxIndexValueFromAccessor {
/**
* @brief Attempts to obtain a maximum index value from an empty
* IndexAccessorType, resulting in -1.
*/
int64_t operator()(std::monostate) { return -1; }

/**
* @brief Attempts to obtain a maximum index value from an \ref AccessorView.
*/
template <typename T> int64_t operator()(const AccessorView<T>& /*value*/) {
return static_cast<int64_t>(std::numeric_limits<T>::max());
}
};

/**
* Visitor that retrieves the vertex indices from the given accessor type
* corresponding to a given face index. These indices are returned as an array
Expand Down
9 changes: 6 additions & 3 deletions CesiumGltf/src/AccessorUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,15 @@ FeatureIdAccessorType getFeatureIdAccessorView(

IndexAccessorType
getIndexAccessorView(const Model& model, const MeshPrimitive& primitive) {
if (primitive.indices < 0) {
return getIndexAccessorView(model, primitive.indices);
}

IndexAccessorType getIndexAccessorView(const Model& model, int32_t index) {
if (index < 0) {
return IndexAccessorType();
}

const Accessor* pAccessor =
model.getSafe<Accessor>(&model.accessors, primitive.indices);
const Accessor* pAccessor = model.getSafe<Accessor>(&model.accessors, index);
if (!pAccessor || pAccessor->type != Accessor::Type::SCALAR ||
pAccessor->normalized) {
return AccessorView<uint8_t>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <CesiumGltf/ExtensionExtMeshPolygon.h>
#include <CesiumGltfReader/Library.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumJsonReader/JsonReaderOptions.h>

#include <rapidjson/fwd.h>

#include <span>
#include <vector>

namespace CesiumGltf {
struct ExtensionExtMeshPolygon;
} // namespace CesiumGltf

namespace CesiumGltfReader {

/**
* @brief Reads \ref CesiumGltf::ExtensionExtMeshPolygon
* "ExtensionExtMeshPolygon" instances from JSON.
*/
class CESIUMGLTFREADER_API ExtensionExtMeshPolygonReader {
public:
/**
* @brief Constructs a new instance.
*/
ExtensionExtMeshPolygonReader();

/**
* @brief Gets the options controlling how the JSON is read.
*/
CesiumJsonReader::JsonReaderOptions& getOptions();

/**
* @brief Gets the options controlling how the JSON is read.
*/
const CesiumJsonReader::JsonReaderOptions& getOptions() const;

/**
* @brief Reads an instance of ExtensionExtMeshPolygon from a byte buffer.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<CesiumGltf::ExtensionExtMeshPolygon>
readFromJson(const std::span<const std::byte>& data) const;

/**
* @brief Reads an instance of ExtensionExtMeshPolygon from a
* rapidJson::Value.
*
* @param value The value from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<CesiumGltf::ExtensionExtMeshPolygon>
readFromJson(const rapidjson::Value& value) const;

/**
* @brief Reads an array of instances of ExtensionExtMeshPolygon from a
* rapidJson::Value.
*
* @param value The value from which to read the array of instances.
* @return The result of reading the array of instances.
*/
CesiumJsonReader::ReadJsonResult<
std::vector<CesiumGltf::ExtensionExtMeshPolygon>>
readArrayFromJson(const rapidjson::Value& value) const;

private:
CesiumJsonReader::JsonReaderOptions _options;
};

} // namespace CesiumGltfReader
Loading
Loading