Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ellipsoid tileset loader #467

Merged
merged 12 commits into from
Nov 6, 2024
8 changes: 7 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## Not Released Yet

##### Additions :tada:

- Added a "From Ellipsoid" option to `Cesium3DTileset` to generate a tileset by tesselating the surface of the ellipsoid, producing a simple globe tileset without terrain features.

## v1.13.1 - 2024-11-01

##### Fixes :wrench:
Expand Down Expand Up @@ -116,7 +122,7 @@ In addition to the above, this release updates [cesium-native](https://github.co
- Added `CesiumMetadataValue`, which can hold a metadata value from `EXT_structural_metadata` while abstracting away its type.
- Added a `distance` property to `CesiumOriginShift`, which specifies the maximum allowed distance from the current origin before it is shifted.
- Added support for the `KHR_texture_transform` glTF extension - including rotation - in `baseColorTexture`, `metallicRoughnessTexture`, `emissiveTexture`, `normalTexture`, and `occlusionTexture`. The transformation is now applied on the GPU via nodes in the Material, rather than on the CPU by directly modifying texture coordinates.
- Added `materialKey` to `CesiumRasterOverlay`, which matches the overlay to its corresponding parameters in the tileset's material. This allows for explicit ordering of raster overlays and overlay-specific effects.
- Added `materialKey` to `CesiumRasterOverlay`, which matches the overlay to its corresponding parameters in the tileset's material. This allows for explicit ordering of raster overlays and overlay-specific effects.
- `CesiumCameraController` can now accept custom input actions that override the default inputs.

##### Fixes :wrench:
Expand Down
7 changes: 6 additions & 1 deletion Runtime/Cesium3DTileset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ public enum CesiumDataSource
/// <summary>
/// The dataset is from a regular web URL.
/// </summary>
FromUrl
FromUrl,

/// <summary>
/// The dataset is generated from the georeference ellipsoid.
/// </summary>
FromEllipsoid
}

/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions native~/Runtime/src/Cesium3DTilesetImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "UnityTileExcluderAdaptor.h"
#include "UnityTilesetExternals.h"

#include <Cesium3DTilesSelection/EllipsoidTilesetLoader.h>
#include <Cesium3DTilesSelection/Tileset.h>
#include <CesiumGeospatial/GlobeTransforms.h>
#include <CesiumIonClient/Connection.h>
Expand Down Expand Up @@ -694,6 +695,12 @@ void Cesium3DTilesetImpl::LoadTileset(
// Resolve the API URL if it's not already in progress.
resolveCesiumIonApiUrl(tileset.ionServer());
}
} else if (
tileset.tilesetSource() ==
CesiumForUnity::CesiumDataSource::FromEllipsoid) {
this->_pTileset = EllipsoidTilesetLoader::createTileset(
createTilesetExternals(tileset),
options);
} else {
this->_pTileset = std::make_unique<Tileset>(
createTilesetExternals(tileset),
Expand Down