Skip to content
Open
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 @@ -88,6 +88,7 @@
- Added an overload of `Math::equalsEpsilon` for glm matrices.
- A tile's bounding volume and content bounding volume are now included in `TileLoadResult` for use in `prepareInLoadThread`.
- Added `convertAccessorTypeToPropertyType` and `convertPropertyTypeToAccessorType` to `CesiumGltf::PropertyType`.
- Added `Cesium3DTilesSelection::Tile::setRenderEngineReadiness(bool)`: pass false to delay the point at which the tile can be shown, while waiting for some asynchronous post-processing to finish for example.

##### Fixes :wrench:

Expand Down
12 changes: 12 additions & 0 deletions Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,17 @@ class CESIUM3DTILESSELECTION_API Tile final {
*/
bool isRenderable() const noexcept;

/**
* @brief Set by the render engine to notify when a tile needs post-load
* processing before being actually renderable, that will have to happen
* over one or more several main thread loop cycles.
* By default, tiles are assumed immediately renderable when they reach
* TileLoadState::Done status. Render engine can toggle readiness off to
* signify that the tile should not be considered renderable until the flag
* is turned on again.
*/
void setRenderEngineReadiness(bool const renderEngineReady) noexcept;

/**
* @brief Determines if this tile has mesh content.
*/
Expand Down Expand Up @@ -687,6 +698,7 @@ class CESIUM3DTILESSELECTION_API Tile final {
TilesetContentLoader* _pLoader;
TileLoadState _loadState;
bool _mightHaveLatentChildren;
bool _renderEngineReadiness = true; ///< Relevant only when _loadState is Done

// mapped raster overlay
std::vector<RasterMappedTo3DTile> _rasterTiles;
Expand Down
6 changes: 6 additions & 0 deletions Cesium3DTilesSelection/src/Tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ bool Tile::isRenderable() const noexcept {
}

if (getState() == TileLoadState::Done) {
if (!_renderEngineReadiness)
return false;
// An unconditionally-refined tile is never renderable... UNLESS it has no
// children, in which case waiting longer will be futile.
if (!getUnconditionallyRefine() || this->_children.empty()) {
Expand All @@ -235,6 +237,10 @@ bool Tile::isRenderable() const noexcept {
return false;
}

void Tile::setRenderEngineReadiness(bool const renderEngineReady) noexcept {
_renderEngineReadiness = renderEngineReady;
}

bool Tile::isRenderContent() const noexcept {
return this->_content.isRenderContent();
}
Expand Down