Skip to content

Commit 4e2791b

Browse files
committed
Merge branch 'main' into linux
2 parents 45be63f + 04478f8 commit 4e2791b

37 files changed

Lines changed: 962 additions & 264 deletions

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ jobs:
6464
vcpkg-windows-${{ hashFiles('native~/vcpkg/ports/**/vcpkg.json', 'native~/vcpkg/triplets/**/*', 'native~/extern/*toolchain.cmake') }}-
6565
- name: Install latest ninja and cmake
6666
uses: lukka/get-cmake@latest
67-
with:
68-
cmakeVersion: "3.31.6"
6967
- name: Install nasm
7068
uses: ilammy/setup-nasm@v1.5.1
7169
- name: Install wget

CHANGES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Change Log {#changes}
22

3-
## ? - ?
3+
## v1.24.0 - 2026-07-01
4+
5+
##### Additions :tada:
6+
7+
- Added support for rendering glTFs with line primitives.
8+
9+
In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.61.0 to v0.62.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
10+
11+
## v1.23.3 - 2026-06-01
412

513
##### Additions :tada:
614

@@ -10,6 +18,8 @@
1018

1119
- The native Android library (`libCesiumForUnityNative.so`) is now built with 16 KB ELF segment alignment, enabling compatibility with Android 15+ devices that use 16 KB memory pages.
1220

21+
In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.60.0 to v0.61.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
22+
1323
## v1.23.2 - 2026-05-01
1424

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

Documentation~/release-guide.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ If the uploaded package is later found to have problems during testing, this ste
4646

4747
1. Clone a fresh copy of [cesium-unity-samples](https://github.com/CesiumGS/cesium-unity-samples) to a new directory.
4848
2. Before opening the project, go to the Packages folder and open `Packages/manifest.json` in a text editor. Find the `com.cesium.unity` dependency under the `"dependencies"` object and change the version to the version number of the in-progress release.
49-
3. Create a new Cesium ion token for this release under the "CesiumJS" account:
49+
3. Open `ProjectSettings/ProjectSettings.asset` and find the `bundleVersion` key (under `PlayerSettings`). Set this to the version number of the in-progress release.
50+
4. Create a new Cesium ion token for this release under the "CesiumJS" account:
5051
- Visit https://ion.cesium.com.
5152
- Log in using your own `@cesium.com` email address.
5253
- Click your name in the top-right corner and choose "Switch to CesiumJS". If you don't see this option, ask someone on the ion team to add you to the CesiumJS account.
@@ -56,8 +57,8 @@ If the uploaded package is later found to have problems during testing, this ste
5657
- Set the other properties as follows (these should be the defaults):
5758
- `Allow URLs`: "All Urls"
5859
- `Resources`: "All assets"
59-
4. Open `Assets/CesiumSettings/Resources/CesiumIonServers/ion.cesium.com.asset` in a text editor and change the `defaultIonAccessToken` property to the new token you created above.
60-
5. Commit the above changes but do _not_ push it yet. If you do, anyone trying to use cesium-unity-samples will be broken until the new version is published.
60+
5. Open `Assets/CesiumSettings/Resources/CesiumIonServers/ion.cesium.com.asset` in a text editor and change the `defaultIonAccessToken` property to the new token you created above.
61+
6. Commit the above changes but do _not_ push it yet. If you do, anyone trying to use cesium-unity-samples will be broken until the new version is published.
6162

6263
## Test the release candidate
6364

native~/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ target_link_libraries(
189189
Cesium3DTilesSelection
190190
CesiumAsync
191191
CesiumIonClient
192+
CesiumVectorOverlays
192193
PRIVATE
193194
tidy-static
194195
enum-flags

native~/extern/cesium-native

Submodule cesium-native updated 282 files

native~/src/Runtime/Cesium3DTilesetImpl.cpp

Lines changed: 64 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <Cesium3DTilesSelection/EllipsoidTilesetLoader.h>
1111
#include <Cesium3DTilesSelection/Tileset.h>
1212
#include <CesiumGeospatial/GlobeTransforms.h>
13+
#include <CesiumImage/Ktx2TranscodeTargets.h>
1314
#include <CesiumIonClient/Connection.h>
1415
#include <CesiumRasterOverlays/IonRasterOverlay.h>
1516

@@ -580,54 +581,10 @@ void Cesium3DTilesetImpl::DestroyTileset(
580581
this->_destroyTilesetOnNextUpdate = false;
581582
}
582583

583-
void Cesium3DTilesetImpl::LoadTileset(
584-
const DotNet::CesiumForUnity::Cesium3DTileset& tileset) {
585-
TilesetOptions options{};
586-
options.rendererOptions = std::make_any<CreateModelOptions>(tileset);
587-
options.maximumScreenSpaceError = tileset.maximumScreenSpaceError();
588-
options.preloadAncestors = tileset.preloadAncestors();
589-
options.preloadSiblings = tileset.preloadSiblings();
590-
options.forbidHoles = tileset.forbidHoles();
591-
options.maximumSimultaneousTileLoads = tileset.maximumSimultaneousTileLoads();
592-
options.maximumCachedBytes = tileset.maximumCachedBytes();
593-
options.loadingDescendantLimit = tileset.loadingDescendantLimit();
594-
options.enableFrustumCulling = tileset.enableFrustumCulling();
595-
options.enableFogCulling = tileset.enableFogCulling();
596-
options.enforceCulledScreenSpaceError =
597-
tileset.enforceCulledScreenSpaceError();
598-
options.culledScreenSpaceError = tileset.culledScreenSpaceError();
599-
// options.enableLodTransitionPeriod = tileset.useLodTransitions();
600-
// options.lodTransitionLength = tileset.lodTransitionLength();
601-
options.showCreditsOnScreen = tileset.showCreditsOnScreen();
602-
options.loadErrorCallback =
603-
[tileset](const TilesetLoadFailureDetails& details) {
604-
int typeValue = (int)details.type;
605-
CesiumForUnity::Cesium3DTilesetLoadFailureDetails unityDetails(
606-
tileset,
607-
CesiumForUnity::Cesium3DTilesetLoadType(typeValue),
608-
details.statusCode,
609-
System::String(details.message));
610-
611-
CesiumForUnity::Cesium3DTileset::BroadcastCesium3DTilesetLoadFailure(
612-
unityDetails);
613-
};
614-
615-
// Generous per-frame time limits for loading / unloading on main thread.
616-
options.mainThreadLoadingTimeLimit = 5.0;
617-
options.tileCacheUnloadTimeLimit = 5.0;
618-
619-
DotNet::CesiumForUnity::CesiumGeoreference georeferenceComponent =
620-
tileset.gameObject()
621-
.GetComponentInParent<DotNet::CesiumForUnity::CesiumGeoreference>();
622-
if (georeferenceComponent != nullptr) {
623-
options.ellipsoid =
624-
georeferenceComponent.ellipsoid().NativeImplementation().GetEllipsoid();
625-
}
626-
627-
TilesetContentOptions contentOptions{};
628-
contentOptions.generateMissingNormalsSmooth = tileset.generateSmoothNormals();
629-
630-
CesiumGltf::SupportedGpuCompressedPixelFormats supportedFormats;
584+
namespace {
585+
CesiumImage::SupportedGpuCompressedPixelFormats
586+
getSupportedGpuCompressedPixelFormats() {
587+
CesiumImage::SupportedGpuCompressedPixelFormats supportedFormats;
631588
supportedFormats.ETC2_RGBA = UnityEngine::SystemInfo::IsFormatSupported(
632589
DotNet::UnityEngine::Experimental::Rendering::GraphicsFormat::
633590
RGBA_ETC2_SRGB,
@@ -681,12 +638,69 @@ void Cesium3DTilesetImpl::LoadTileset(
681638
DotNet::UnityEngine::Experimental::Rendering::GraphicsFormat::
682639
RG_EAC_UNorm,
683640
DotNet::UnityEngine::Experimental::Rendering::FormatUsage::Sample);
641+
return supportedFormats;
642+
}
643+
} // namespace
644+
645+
void Cesium3DTilesetImpl::LoadTileset(
646+
const DotNet::CesiumForUnity::Cesium3DTileset& tileset) {
647+
TilesetOptions options{};
648+
options.rendererOptions = std::make_any<CreateModelOptions>(tileset);
649+
options.maximumScreenSpaceError = tileset.maximumScreenSpaceError();
650+
options.preloadAncestors = tileset.preloadAncestors();
651+
options.preloadSiblings = tileset.preloadSiblings();
652+
options.forbidHoles = tileset.forbidHoles();
653+
options.maximumSimultaneousTileLoads = tileset.maximumSimultaneousTileLoads();
654+
options.maximumCachedBytes = tileset.maximumCachedBytes();
655+
options.loadingDescendantLimit = tileset.loadingDescendantLimit();
656+
options.enableFrustumCulling = tileset.enableFrustumCulling();
657+
options.enableFogCulling = tileset.enableFogCulling();
658+
options.enforceCulledScreenSpaceError =
659+
tileset.enforceCulledScreenSpaceError();
660+
options.culledScreenSpaceError = tileset.culledScreenSpaceError();
661+
// options.enableLodTransitionPeriod = tileset.useLodTransitions();
662+
// options.lodTransitionLength = tileset.lodTransitionLength();
663+
options.showCreditsOnScreen = tileset.showCreditsOnScreen();
664+
options.loadErrorCallback =
665+
[tileset](const TilesetLoadFailureDetails& details) {
666+
int typeValue = (int)details.type;
667+
CesiumForUnity::Cesium3DTilesetLoadFailureDetails unityDetails(
668+
tileset,
669+
CesiumForUnity::Cesium3DTilesetLoadType(typeValue),
670+
details.statusCode,
671+
System::String(details.message));
672+
673+
CesiumForUnity::Cesium3DTileset::BroadcastCesium3DTilesetLoadFailure(
674+
unityDetails);
675+
};
676+
677+
// Generous per-frame time limits for loading / unloading on main thread.
678+
options.mainThreadLoadingTimeLimit = 5.0;
679+
options.tileCacheUnloadTimeLimit = 5.0;
684680

685-
contentOptions.ktx2TranscodeTargets =
686-
CesiumGltf::Ktx2TranscodeTargets(supportedFormats, false);
681+
DotNet::CesiumForUnity::CesiumGeoreference georeferenceComponent =
682+
tileset.gameObject()
683+
.GetComponentInParent<DotNet::CesiumForUnity::CesiumGeoreference>();
684+
if (georeferenceComponent != nullptr) {
685+
options.ellipsoid =
686+
georeferenceComponent.ellipsoid().NativeImplementation().GetEllipsoid();
687+
}
687688

689+
TilesetContentOptions contentOptions{};
690+
contentOptions.generateMissingNormalsSmooth = tileset.generateSmoothNormals();
691+
contentOptions.ktx2TranscodeTargets = CesiumImage::Ktx2TranscodeTargets(
692+
getSupportedGpuCompressedPixelFormats(),
693+
false);
688694
contentOptions.applyTextureTransform = false;
689695

696+
// Although Unity provides MeshTopology.LineStrip, it crashes when given an
697+
// index buffer with a primitive restart constant. Therefore, ensure all
698+
// primitive modes are converted before they are processed by Unity.
699+
contentOptions.primitiveModeOptions.convertLineLoop = true;
700+
contentOptions.primitiveModeOptions.convertLineStrip = true;
701+
contentOptions.primitiveModeOptions.convertTriangleFan = true;
702+
contentOptions.primitiveModeOptions.convertTriangleStrip = true;
703+
690704
options.contentOptions = contentOptions;
691705

692706
CesiumForUnity::CesiumCameraManager cameraManager =

native~/src/Runtime/CesiumFeatureIdTextureImpl.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ std::int64_t CesiumFeatureIdTextureImpl::GetFeatureIdFromRaycastHit(
9191
return -1;
9292
}
9393

94-
if (this->_positionAccessor.status() !=
94+
if (std::visit(CesiumGltf::StatusFromAccessor{}, this->_positionAccessor) !=
9595
CesiumGltf::AccessorViewStatus::Valid) {
9696
return -1;
9797
}
@@ -107,7 +107,7 @@ std::int64_t CesiumFeatureIdTextureImpl::GetFeatureIdFromRaycastHit(
107107
this->_indexAccessor);
108108

109109
std::array<glm::dvec2, 3> uvs;
110-
std::array<glm::vec3, 3> positions;
110+
std::array<glm::dvec3, 3> positions;
111111

112112
for (size_t i = 0; i < positions.size(); i++) {
113113
int64_t index = vertexIndices[i];
@@ -123,10 +123,13 @@ std::int64_t CesiumFeatureIdTextureImpl::GetFeatureIdFromRaycastHit(
123123
}
124124
uvs[i] = *maybeTexCoord;
125125

126-
CesiumGltf::AccessorTypes::VEC3<float> position =
127-
this->_positionAccessor[index];
128-
positions[i] =
129-
glm::vec3(position.value[0], position.value[1], position.value[2]);
126+
std::optional<glm::dvec3> maybePosition = std::visit(
127+
CesiumGltf::PositionFromAccessor{index},
128+
this->_positionAccessor);
129+
if (!maybePosition) {
130+
return -1;
131+
}
132+
positions[i] = *maybePosition;
130133
}
131134

132135
// The barycentric coordinates in RaycastHit don't align with the positions
@@ -140,9 +143,9 @@ std::int64_t CesiumFeatureIdTextureImpl::GetFeatureIdFromRaycastHit(
140143
glm::dvec3 barycentricCoordinates;
141144
bool foundIntersection = CesiumGeometry::IntersectionTests::pointInTriangle(
142145
glm::dvec3(localPosition.x, localPosition.y, localPosition.z),
143-
glm::dvec3(positions[0]),
144-
glm::dvec3(positions[1]),
145-
glm::dvec3(positions[2]),
146+
positions[0],
147+
positions[1],
148+
positions[2],
146149
barycentricCoordinates);
147150
if (!foundIntersection) {
148151
return -1;

native~/src/Runtime/CesiumGeoJsonDocumentRasterOverlayImpl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#include "UnityExternals.h"
88

99
#include <Cesium3DTilesSelection/Tileset.h>
10-
#include <CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h>
1110
#include <CesiumUtility/Color.h>
1211
#include <CesiumVectorData/GeoJsonDocument.h>
1312
#include <CesiumVectorData/VectorStyle.h>
13+
#include <CesiumVectorOverlays/GeoJsonDocumentRasterOverlay.h>
1414

1515
#include <DotNet/CesiumForUnity/Cesium3DTileset.h>
1616
#include <DotNet/CesiumForUnity/CesiumGeoJsonDocument.h>
@@ -22,6 +22,7 @@
2222
#include <spdlog/spdlog.h>
2323

2424
using namespace Cesium3DTilesSelection;
25+
using namespace CesiumVectorOverlays;
2526
using namespace CesiumRasterOverlays;
2627
using namespace CesiumVectorData;
2728
using namespace DotNet;

native~/src/Runtime/CesiumGeoJsonDocumentRasterOverlayImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Cesium3DTileset;
99
class CesiumGeoJsonDocumentRasterOverlay;
1010
} // namespace DotNet::CesiumForUnity
1111

12-
namespace CesiumRasterOverlays {
12+
namespace CesiumVectorOverlays {
1313
class GeoJsonDocumentRasterOverlay;
1414
}
1515

@@ -34,7 +34,7 @@ class CesiumGeoJsonDocumentRasterOverlayImpl
3434

3535
private:
3636
CesiumUtility::IntrusivePointer<
37-
CesiumRasterOverlays::GeoJsonDocumentRasterOverlay>
37+
CesiumVectorOverlays::GeoJsonDocumentRasterOverlay>
3838
_pOverlay;
3939
};
4040

native~/src/Runtime/TextureLoader.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
#include <cstring>
1616

1717
using namespace CesiumGltf;
18+
using namespace CesiumImage;
1819
using namespace DotNet;
1920

2021
namespace CesiumForUnityNative {
2122

2223
namespace {
2324
UnityEngine::TextureFormat
24-
getCompressedPixelFormat(const CesiumGltf::ImageAsset& image) {
25+
getCompressedPixelFormat(const CesiumImage::ImageAsset& image) {
2526
switch (image.compressedPixelFormat) {
2627
case GpuCompressedPixelFormat::ETC1_RGB:
2728
return UnityEngine::TextureFormat::ETC_RGB4;
@@ -55,7 +56,7 @@ getCompressedPixelFormat(const CesiumGltf::ImageAsset& image) {
5556
}
5657

5758
UnityEngine::TextureFormat
58-
getUncompressedPixelFormat(const CesiumGltf::ImageAsset& image) {
59+
getUncompressedPixelFormat(const CesiumImage::ImageAsset& image) {
5960
switch (image.channels) {
6061
case 1:
6162
return UnityEngine::TextureFormat::R8;
@@ -72,7 +73,7 @@ getUncompressedPixelFormat(const CesiumGltf::ImageAsset& image) {
7273
} // namespace
7374

7475
UnityEngine::Texture
75-
TextureLoader::loadTexture(const CesiumGltf::ImageAsset& image, bool sRGB) {
76+
TextureLoader::loadTexture(const CesiumImage::ImageAsset& image, bool sRGB) {
7677
CESIUM_TRACE("TextureLoader::loadTexture");
7778
std::int32_t mipCount =
7879
image.mipPositions.empty() ? 1 : std::int32_t(image.mipPositions.size());

0 commit comments

Comments
 (0)