Skip to content

Commit

Permalink
Merge branch 'main' of github.com:CesiumGS/cesium-unreal into url-tem…
Browse files Browse the repository at this point in the history
…plate-overlay
  • Loading branch information
azrogers committed Jan 9, 2025
2 parents 391d676 + 31c9dce commit d9feb18
Show file tree
Hide file tree
Showing 20 changed files with 333 additions and 71 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: prod
on:
push:
branches:
- 'cesium.com'
- 'cesium.com-staging'
jobs:
deploy-docs:
runs-on: ubuntu-22.04
env:
AWS_ACCESS_KEY_ID: ${{ secrets.NATIVE_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.NATIVE_SECRET_KEY }}
AWS_REGION: us-east-1
steps:
- name: Install Doxygen
run: |
cd ~
wget https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.linux.bin.tar.gz
tar xzf doxygen-1.12.0.linux.bin.tar.gz
export PATH=$PWD/doxygen-1.12.0/bin:$PATH
echo "PATH=$PATH" >> "$GITHUB_ENV"
doxygen --version
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Mark documentation official
if: ${{ github.ref_name == 'cesium.com' }}
run: |
sed -i 's/PRE-RELEASE/ /g' Documentation/Doxyfile
- name: Generate Documentation
run: |
npm install
npm run doxygen
- name: Deploy to cesium.com
if: ${{ github.ref_name == 'cesium.com' }}
run: |
aws s3 sync Documentation/Reference/html/ s3://cesium-website/cesium-unreal/ref-doc/ --cache-control "public, max-age=1800" --delete
- name: Deploy to cesium.com staging
if: ${{ github.ref_name == 'cesium.com-staging' }}
run: |
aws s3 sync Documentation/Reference/html/ s3://cesium-website/cesium-unreal/ref-doc-staging/ --cache-control "public, max-age=1800" --delete
14 changes: 13 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
# Change Log

### ? - ?
### v2.12.0 - 2025-01-02

##### Breaking Changes :mega:

- Removed support for Unreal Engine 5.2. Unreal Engine 5.3 or later is now required.
- Renamed `FCesiumFeatureIdAttribute::GetFeatureIDForVertex` to `FCesiumFeatureIdAttribute::GetFeatureID`.
- Renamed `FCesiumFeatureIdAttribute::GetVertexCount` to `FCesiumFeatureIdAttribute::GetCount`.

##### Additions :tada:

- Added support for metadata querying and styling on instanced models.

##### Fixes :wrench:

- Fixed a bug in `CesiumSubLevelSwitcherComponent` that could prevent all sub-levels from loading if a single sub-level failed to load.

This release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.42.0 to v0.43.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.

### v2.11.0 - 2024-12-02

Expand Down
4 changes: 2 additions & 2 deletions CesiumForUnreal.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 66,
"VersionName": "2.11.0",
"Version": 67,
"VersionName": "2.12.0",
"FriendlyName": "Cesium for Unreal",
"Description": "Unlock the 3D geospatial ecosystem in Unreal Engine with real-world 3D content and a high accuracy full-scale WGS84 globe.",
"Category": "Geospatial",
Expand Down
6 changes: 5 additions & 1 deletion Config/Engine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,8 @@ AspectRatioAxisConstraint=AspectRatio_MaintainXFOV
+PropertyRedirects=(OldName="CesiumWebMapTileServiceRasterOverlay.South", NewName="CesiumWebMapTileServiceRasterOverlay.RectangleSouth")
+PropertyRedirects=(OldName="CesiumWebMapTileServiceRasterOverlay.East", NewName="CesiumWebMapTileServiceRasterOverlay.RectangleEast")
+PropertyRedirects=(OldName="CesiumWebMapTileServiceRasterOverlay.North", NewName="CesiumWebMapTileServiceRasterOverlay.RectangleNorth")
+PropertyRedirects=(OldName="CesiumWebMapTileServiceRasterOverlay.UseWebMercatorProjection", NewName="CesiumWebMapTileServiceRasterOverlay.UseWebMercatorProjection_DEPRECATED")
+PropertyRedirects=(OldName="CesiumWebMapTileServiceRasterOverlay.UseWebMercatorProjection", NewName="CesiumWebMapTileServiceRasterOverlay.UseWebMercatorProjection_DEPRECATED")

+FunctionRedirects=(OldName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureIDForVertex", NewName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureID")
+PropertyRedirects=(OldName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureIDForVertex.VertexIndex", NewName="CesiumFeatureIdAttributeBlueprintLibrary.GetFeatureID.Index")
+FunctionRedirects=(OldName="CesiumFeatureIdAttributeBlueprintLibrary.GetVertexCount", NewName="CesiumFeatureIdAttributeBlueprintLibrary.GetCount")
Binary file modified Content/Materials/M_CesiumBaseMaterial.uasset
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions Documentation/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ PROJECT_NUMBER = $(npm_package_version)
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF =
PROJECT_BRIEF = PRE-RELEASE

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down Expand Up @@ -947,7 +947,7 @@ INPUT = ./README.md \
./ \
./Documentation \
./Documentation/Pages \
./Source/CesiumRuntime/Public
./Source/CesiumRuntime/Public

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
5 changes: 4 additions & 1 deletion Source/CesiumRuntime/CesiumRuntime.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
"GLM_FORCE_SIZE_T_LENGTH",
"TIDY_STATIC",
"URI_STATIC_BUILD",
"SWL_VARIANT_NO_CONSTEXPR_EMPLACE"
"SWL_VARIANT_NO_CONSTEXPR_EMPLACE",
// Define to record the state of every tile, every frame, to a SQLite database.
// The database will be found in [Project Dir]/Saved/CesiumDebugTileStateDatabase.
// "CESIUM_DEBUG_TILE_STATES",
}
);

Expand Down
38 changes: 37 additions & 1 deletion Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
#include <memory>
#include <spdlog/spdlog.h>

#ifdef CESIUM_DEBUG_TILE_STATES
#include "HAL/PlatformFileManager.h"
#include <Cesium3DTilesSelection/DebugTileStateDatabase.h>
#endif

FCesium3DTilesetLoadFailure OnCesium3DTilesetLoadFailure{};

#if WITH_EDITOR
Expand All @@ -77,6 +82,10 @@ ACesium3DTileset::ACesium3DTileset()

_pTileset(nullptr),

#ifdef CESIUM_DEBUG_TILE_STATES
_pStateDebug(nullptr),
#endif

_lastTilesRendered(0),
_lastWorkerThreadTileLoadQueueLength(0),
_lastMainThreadTileLoadQueueLength(0),
Expand Down Expand Up @@ -1326,6 +1335,23 @@ void ACesium3DTileset::LoadTileset() {
break;
}

#ifdef CESIUM_DEBUG_TILE_STATES
FString dbDirectory = FPaths::Combine(
FPaths::ProjectSavedDir(),
TEXT("CesiumDebugTileStateDatabase"));

IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
if (!PlatformFile.DirectoryExists(*dbDirectory)) {
PlatformFile.CreateDirectory(*dbDirectory);
}

FString dbFile =
FPaths::Combine(dbDirectory, this->GetName() + TEXT(".sqlite"));
this->_pStateDebug =
MakeUnique<Cesium3DTilesSelection::DebugTileStateDatabase>(
TCHAR_TO_UTF8(*dbFile));
#endif

for (UCesiumRasterOverlay* pOverlay : rasterOverlays) {
if (pOverlay->IsActive()) {
pOverlay->AddToTileset();
Expand Down Expand Up @@ -2007,6 +2033,14 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
}
}

#ifdef CESIUM_DEBUG_TILE_STATES
if (this->_pStateDebug && GetWorld()->IsPlayInEditor()) {
this->_pStateDebug->recordAllTileStates(
result.frameNumber,
*this->_pTileset);
}
#endif

if (!this->LogSelectionStats && !this->LogSharedAssetStats) {
return;
}
Expand Down Expand Up @@ -2042,11 +2076,13 @@ void ACesium3DTileset::updateLastViewUpdateResultState(
LogCesium,
Display,
TEXT(
"%s: %d ms, Visited %d, Culled Visited %d, Rendered %d, Culled %d, Occluded %d, Waiting For Occlusion Results %d, Max Depth Visited: %d, Loading-Worker %d, Loading-Main %d, Loaded tiles %g%%"),
"%s: %d ms, Unreal Frame #%d, Tileset Frame: #%d, Visited %d, Culled Visited %d, Rendered %d, Culled %d, Occluded %d, Waiting For Occlusion Results %d, Max Depth Visited: %d, Loading-Worker %d, Loading-Main %d, Loaded tiles %g%%"),
*this->GetName(),
(std::chrono::high_resolution_clock::now() - this->_startTime)
.count() /
1000000,
GFrameCounter,
result.frameNumber,
result.tilesVisited,
result.culledTilesVisited,
result.tilesToRenderThisFrame.size(),
Expand Down
18 changes: 18 additions & 0 deletions Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ FString getNameForFeatureIDSet(
}
}

if (type == ECesiumFeatureIdSetType::Instance) {
FCesiumFeatureIdAttribute attribute =
UCesiumFeatureIdSetBlueprintLibrary::GetAsFeatureIDAttribute(
featureIDSet);
ECesiumFeatureIdAttributeStatus status =
UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDAttributeStatus(
attribute);
if (status == ECesiumFeatureIdAttributeStatus::Valid) {
std::string generatedName = "_FEATURE_INSTANCE_ID_" +
std::to_string(attribute.getAttributeIndex());
return FString(generatedName.c_str());
}
}

if (type == ECesiumFeatureIdSetType::Texture) {
std::string generatedName =
"_FEATURE_ID_TEXTURE_" + std::to_string(FeatureIdTextureCounter);
Expand All @@ -63,6 +77,10 @@ FString getNameForFeatureIDSet(
return FString("_IMPLICIT_FEATURE_ID");
}

if (type == ECesiumFeatureIdSetType::InstanceImplicit) {
return FString("_IMPLICIT_FEATURE_INSTANCE_ID");
}

// If for some reason an empty / invalid feature ID set was constructed,
// return an empty name.
return FString();
Expand Down
8 changes: 4 additions & 4 deletions Source/CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDAttributeStatus(
return FeatureIDAttribute._status;
}

int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetVertexCount(
int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetCount(
UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute) {
return std::visit(
CesiumGltf::CountFromAccessor{},
FeatureIDAttribute._featureIdAccessor);
}

int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex(
int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureID(
UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute,
int64 VertexIndex) {
int64 Index) {
return std::visit(
CesiumGltf::FeatureIdFromAccessor{VertexIndex},
CesiumGltf::FeatureIdFromAccessor{Index},
FeatureIDAttribute._featureIdAccessor);
}
6 changes: 3 additions & 3 deletions Source/CesiumRuntime/Private/CesiumFeatureIdSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDForVertex(
if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) {
FCesiumFeatureIdAttribute attribute =
std::get<FCesiumFeatureIdAttribute>(FeatureIDSet._featureID);
return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex(
return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureID(
attribute,
VertexIndex);
}
Expand Down Expand Up @@ -189,7 +189,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDForInstance(
}
const auto& featureIdAttribute =
std::get<FCesiumFeatureIdAttribute>(FeatureIDSet._featureID);
return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex(
return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureID(
featureIdAttribute,
InstanceIndex);
}
Expand Down Expand Up @@ -239,7 +239,7 @@ int64 UCesiumFeatureIdSetBlueprintLibrary::GetFeatureIDFromHit(
if (FeatureIDSet._featureIDSetType == ECesiumFeatureIdSetType::Attribute) {
FCesiumFeatureIdAttribute attribute =
std::get<FCesiumFeatureIdAttribute>(FeatureIDSet._featureID);
return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureIDForVertex(
return UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureID(
attribute,
VertexIndex);
}
Expand Down
Loading

0 comments on commit d9feb18

Please sign in to comment.