Skip to content

Commit 4357618

Browse files
authored
Merge branch 'main' into supporting-i3dm-poc
2 parents 00d98e4 + 5137c75 commit 4357618

File tree

68 files changed

+1948
-603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1948
-603
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ jobs:
5151
key: vcpkg-windows-${{ hashFiles('native~/vcpkg/ports/**/vcpkg.json', 'native~/vcpkg/triplets/**/*', 'native~/extern/*toolchain.cmake') }}-${{ hashFiles('native~/extern/cesium-native/CMakeLists.txt', 'native~/CMakeLists.txt') }}
5252
restore-keys: |
5353
vcpkg-windows-${{ hashFiles('native~/vcpkg/ports/**/vcpkg.json', 'native~/vcpkg/triplets/**/*', 'native~/extern/*toolchain.cmake') }}-
54-
- name: Install Ninja
55-
run: |
56-
choco install -y ninja
54+
- name: Install latest ninja and cmake
55+
uses: lukka/get-cmake@latest
56+
with:
57+
cmakeVersion: "3.31.6"
5758
- name: Install nasm
5859
uses: ilammy/setup-nasm@v1.5.1
5960
- name: Install wget
@@ -114,6 +115,10 @@ jobs:
114115
run: |
115116
cd d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
116117
dotnet publish Reinterop~ -o .
118+
- name: Print disk space 1
119+
if: success() || failure() # run this step even if previous step failed
120+
run: |
121+
get-psdrive
117122
- name: Build Package
118123
run: |
119124
cd d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
@@ -128,6 +133,10 @@ jobs:
128133
$ENV:EZVCPKG_BASEDIR="D:/.ezvcpkg"
129134
# Run the build
130135
dotnet run --project Build~
136+
- name: Print disk space 2
137+
if: success() || failure() # run this step even if previous step failed
138+
run: |
139+
get-psdrive
131140
- name: Publish Logs
132141
if: success() || failure() # run this step even if previous step failed
133142
uses: actions/upload-artifact@v4

.github/workflows/prod.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: prod
2+
on:
3+
push:
4+
branches:
5+
- 'cesium.com'
6+
- 'cesium.com-staging'
7+
jobs:
8+
deploy-docs:
9+
runs-on: ubuntu-22.04
10+
env:
11+
AWS_ACCESS_KEY_ID: ${{ secrets.NATIVE_ACCESS_KEY }}
12+
AWS_SECRET_ACCESS_KEY: ${{ secrets.NATIVE_SECRET_KEY }}
13+
AWS_REGION: us-east-1
14+
steps:
15+
- name: Install Doxygen
16+
run: |
17+
cd ~
18+
wget https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.linux.bin.tar.gz
19+
tar xzf doxygen-1.12.0.linux.bin.tar.gz
20+
export PATH=$PWD/doxygen-1.12.0/bin:$PATH
21+
echo "PATH=$PATH" >> "$GITHUB_ENV"
22+
doxygen --version
23+
- name: Check out repository code
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
- name: Mark documentation official
28+
if: ${{ github.ref_name == 'cesium.com' }}
29+
run: |
30+
sed -i 's/PRE-RELEASE/ /g' Documentation~/Doxyfile
31+
- name: Generate Documentation
32+
run: |
33+
npm run doxygen
34+
- name: Deploy to cesium.com
35+
if: ${{ github.ref_name == 'cesium.com' }}
36+
run: |
37+
aws s3 sync Documentation~/Reference/html/ s3://cesium-website/cesium-unity/ref-doc/ --cache-control "public, max-age=1800" --delete
38+
- name: Deploy to cesium.com staging
39+
if: ${{ github.ref_name == 'cesium.com-staging' }}
40+
run: |
41+
aws s3 sync Documentation~/Reference/html/ s3://cesium-website/cesium-unity/ref-doc-staging/ --cache-control "public, max-age=1800" --delete

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Plugins.meta
1111
CesiumForUnityNativeBindings/native/
1212
.vs/
1313
*.user
14+
.DS_STORE
15+
.idea
1416
Reinterop.dll
1517
Reinterop.deps.json
1618
Reinterop.deps.json.meta
@@ -22,4 +24,4 @@ libCesiumForUnityNative-*.so
2224
libCesiumForUnityNative-*.so.meta
2325
libCesiumForUnityNative-*.dylib
2426
libCesiumForUnityNative-*.dylib.meta
25-
Documentation~/Reference/
27+
Documentation~/Reference/

Build~/Build~.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace>Build</RootNamespace>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

CHANGES.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,84 @@
11
# Change Log
22

3+
## ? - ?
4+
5+
##### Additions :tada:
6+
7+
- Added option to ignore the `KHR_material_unlit` extension to force default lighting on tilesets.
8+
9+
## v1.17.0 - 2025-08-01
10+
11+
##### Additions :tada:
12+
13+
- Added support for Cesium3DTileset tile selection using orthographic views.
14+
15+
In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.49.0 to v0.50.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
16+
17+
## v1.16.2 - 2025-07-01
18+
19+
##### Fixes :wrench:
20+
21+
- Fixed broken support for `TRIANGLE_FAN` primitives in tile meshes.
22+
- Fixed editor crash when any scale component on `Cesium3DTileset` was set to zero.
23+
- Fixed a bug where CameraFlyToController, after the user interrupted a flight, would jump to the middle of the flight path immediately upon starting the next flight.
24+
25+
In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.48.0 to v0.49.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
26+
27+
## v1.16.1 - 2025-06-02
28+
29+
This release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.47.0 to v0.48.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
30+
31+
## v1.16.0 - 2025-05-01
32+
33+
##### Additions :tada:
34+
35+
- Added `CesiumUrlTemplateRasterOverlay` component, allowing a raster overlay to be added using tiles requested based on a specified URL template.
36+
37+
##### Fixes :wrench:
38+
39+
- Fixed a bug where credits would not display in the Game tab after entering Play Mode.
40+
- Improved stability during AppDomain reloads by catching exceptions thrown while freeing tiles.
41+
42+
In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.46.0 to v0.47.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
43+
44+
## v1.15.5 - 2025-04-01
45+
46+
##### Fixes :wrench:
47+
48+
- Fixed a bug that could cause a crash when reloading a scene or tileset repeatedly.
49+
50+
In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.45.0 to v0.46.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
51+
52+
## v1.15.4 - 2025-03-03
53+
54+
##### Fixes :wrench:
55+
56+
- "External Tilesets" are now unloaded when they are no longer used. This will significantly reduce the growth of memory usage over time when using Google Photorealistic 3D Tiles and similar tilesets.
57+
58+
This release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.44.3 to v0.45.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
59+
60+
## v1.15.3 - 2025-02-12
61+
62+
This release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.44.2 to v0.44.3. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
63+
64+
## v1.15.2 - 2025-02-10
65+
66+
This release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.44.1 to v0.44.2. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
67+
68+
## v1.15.1 - 2025-02-03
69+
70+
This release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.44.0 to v0.44.1. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
71+
72+
## v1.15.0 - 2025-02-03
73+
74+
Cesium for Unity now requires Unity 2022 LTS (2022.3), Unity 6, or later.
75+
76+
##### Fixes :wrench:
77+
78+
- Exceptions in either C# or C++ code are now handled much more reliably.
79+
80+
In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.43.0 to v0.44.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.
81+
382
## v1.14.1 - 2025-01-02
483

584
This is the last release of Cesium for Unity that will support Unity 2021 LTS (2021.3). Future versions will require Unity 2022 LTS (2022.3) or Unity 6.

CHANGES.md.meta

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Documentation~/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ PROJECT_NUMBER = $(npm_package_version)
5454
# for a project that appears at the top of each page and should give viewer a
5555
# quick idea about the purpose of the project. Keep the description short.
5656

57-
PROJECT_BRIEF =
57+
PROJECT_BRIEF = PRE-RELEASE
5858

5959
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
6060
# in the documentation. The maximum height of the logo should not exceed 55

Documentation~/developer-setup.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ This should be repeated if you modify Reinterop, or if you pull new changes that
5353

5454
For more details, see the [Reinterop README](../Reinterop~/README.md).
5555

56-
A common mistake is to open Unity before doing this step, which will cause Unity to delete `Reinterop.dll.meta` file because the `Reinterop.dll` file does not yet exist. Then, even after you publish `Reinterop.dll`, the `Reinterop.dll.meta` that Unity creates will be missing important information, and you'll get errors when Unity attemps to compile Cesium for Unity. If this happens to you, executing `git restore Reinterop.dll.meta` should fix it.
56+
> [!IMPORTANT]
57+
> A common mistake is to open Unity before doing this step, which will cause Unity to delete `Reinterop.dll.meta` file because the `Reinterop.dll` file does not yet exist. Then, even after you publish `Reinterop.dll`, the `Reinterop.dll.meta` that Unity creates will be missing important information, and you'll get errors when Unity attemps to compile Cesium for Unity. If this happens to you, executing `git restore Reinterop.dll.meta` should fix it.
5758
5859
## Build for the Editor
5960

@@ -66,7 +67,7 @@ DllNotFoundException: CesiumForUnityNative assembly:<unknown assembly> type:<unk
6667
NotImplementedException: The native implementation is missing so OnValidate cannot be invoked.
6768
```
6869

69-
This is because the C++ code has not yet been compiled. To compile the C++ code for use in the Editor, run:
70+
This is because the C++ code has not yet been compiled. To compile the C++ code for use by the Editor, run:
7071

7172
```
7273
cd cesium-unity-samples/Packages/com.cesium.unity/native~
@@ -86,6 +87,22 @@ cmake --build build -j14 --target install --config RelWithDebInfo
8687

8788
Once this build/install completes, Cesium for Unity should work the next time Unity loads Cesium for Unity. You can get it to do so by either restarting the Editor, or by making a small change to any Cesium for Unity script (.cs) file in `Packages/com.cesium.unity/Runtime`.
8889

90+
> [!NOTE]
91+
> If you receive compilation errors such as,
92+
> ```
93+
> IonTokenTroubleshootingWindowImpl.h:3:10: fatal error: 'DotNet/System/String.h' file not found
94+
> ```
95+
> Verify that Reinterop has generated the required `.cpp` and `.h` source files. These should be located in `com.cesium.unity/native~/Runtime/generated-Editor/` and `com.cesium.unity/native~/Editor/generated-Editor/`.
96+
> If those directories are not present, you may force Reinterop to run by adding a comment or other minor change to `./Runtime/ConfigureReinterop.cs`
97+
and `./Editor/ConfigureReinterop.cs` .
98+
> ```
99+
> cd cesium-unity-samples/Packages/com.cesium.unity
100+
> echo "" >> ./Runtime/ConfigureReinterop.cs
101+
> echo "" >> ./Editor/ConfigureReinterop.cs
102+
> ```
103+
> (Alternatively, one may open both `ConfigureReinterop.cs` files from within Unity or any text editor, make a whitespace or other minor change, and save the files.)
104+
> Once those changes have been saved, go back to the Unity editor. It should detect the file changes and cause Reinterop to generate the required C++ source files.
105+
89106
## Building and Running Games
90107
91108
When you build and run a standalone game (i.e. with File -> Build Settings... or File -> Build and Run in the Unity Editor), Unity will automatically compile Cesium for Unity for the target platform. Then, by hooking into Unity build events, Cesium for Unity will build the corresponding native code for that platform by running CMake on the command-line. This can take a few minutes, and during that time Unity's progress bar will display a message stating the location of the build log file.

Editor/Cesium3DTilesetEditor.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class Cesium3DTilesetEditor : Editor
3131
private SerializedProperty _culledScreenSpaceError;
3232

3333
private SerializedProperty _opaqueMaterial;
34+
private SerializedProperty _ignoreKhrMaterialsUnlit;
3435
//private SerializedProperty _useLodTransitions;
3536
//private SerializedProperty _lodTransitionLength;
3637
private SerializedProperty _generateSmoothNormals;
@@ -83,6 +84,7 @@ private void OnEnable()
8384
// this.serializedObject.FindProperty("_lodTransitionLength");
8485
this._generateSmoothNormals =
8586
this.serializedObject.FindProperty("_generateSmoothNormals");
87+
this._ignoreKhrMaterialsUnlit = this.serializedObject.FindProperty("_ignoreKhrMaterialsUnlit");
8688

8789
this._pointCloudShading = this.serializedObject.FindProperty("_pointCloudShading");
8890

@@ -425,6 +427,19 @@ private void DrawRenderProperties()
425427
"normals requires duplicating vertices. This option allows the glTFs to be " +
426428
"rendered with smooth normals instead when the original glTF is missing normals.");
427429
EditorGUILayout.PropertyField(this._generateSmoothNormals, generateSmoothNormalsContent);
430+
431+
var ignoreKhrMaterialsUnlit = new GUIContent(
432+
"Ignore KHR_materials_unlit",
433+
"Whether to ignore the KHR_materials_unlit extension on the glTF tiles in "+
434+
"this tileset, if it exists, and instead render with standard lighting and "+
435+
"shadows. This property will have no effect if the tileset does not have any "+
436+
"tiles that use this extension. "+
437+
"\n\n"+
438+
"The KHR_materials_unlit extension is often applied to photogrammetry "+
439+
"tilesets because lighting and shadows are already baked into their "+
440+
"textures. "
441+
);
442+
EditorGUILayout.PropertyField(this._ignoreKhrMaterialsUnlit, ignoreKhrMaterialsUnlit);
428443
}
429444

430445
private void DrawPointCloudShadingProperties()
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using UnityEditor;
2+
using UnityEditor.SceneManagement;
3+
using UnityEngine;
4+
using UnityEngine.SceneManagement;
5+
6+
namespace CesiumForUnity
7+
{
8+
[InitializeOnLoad]
9+
public static class CesiumCreditSystemManager
10+
{
11+
static CesiumCreditSystemManager()
12+
{
13+
EditorApplication.playModeStateChanged += HandleEnteringPlayMode;
14+
EditorSceneManager.sceneClosing += HandleClosingScene;
15+
}
16+
17+
/// <summary>
18+
/// This handles the destruction of the default credit system between scene switches in the
19+
/// Unity Editor.
20+
/// Without this, the credit system will live between instances and fail to capture the current
21+
/// scene's credits.
22+
/// </summary>
23+
/// <param name="scene">The scene.</param>
24+
/// <param name="removingScene">Whether the scene is being removed.</param>
25+
private static void HandleClosingScene(Scene scene, bool removingScene)
26+
{
27+
Destroy(CesiumCreditSystem.GetDefaultCreditSystem());
28+
}
29+
30+
/// <summary>
31+
/// This handles the destruction of the default credit system while entering Play Mode.
32+
/// Without this, the persisting credit system's UI will not register with the Play Mode view, leading
33+
/// to missing credits.
34+
/// </summary>
35+
/// <param name="state">The state change between the Edit and Play modes.</param>
36+
private static void HandleEnteringPlayMode(PlayModeStateChange state)
37+
{
38+
if (state == PlayModeStateChange.EnteredPlayMode)
39+
{
40+
Destroy(CesiumCreditSystem.GetDefaultCreditSystem());
41+
}
42+
}
43+
44+
/// <summary>
45+
/// Destroys the input credit system depending on the current Editor context. This is the same as
46+
/// the internal UnityLifetime class (which is currently inaccessible from Editor classes).
47+
/// </summary>
48+
/// <param name="creditSystem">The credit system.</param>
49+
private static void Destroy(CesiumCreditSystem creditSystem)
50+
{
51+
if (creditSystem == null) { return; }
52+
53+
// In the Editor, we must use DestroyImmediate because Destroy won't
54+
// actually destroy the object.
55+
if (!EditorApplication.isPlaying)
56+
{
57+
Object.DestroyImmediate(creditSystem.gameObject);
58+
return;
59+
}
60+
61+
Object.Destroy(creditSystem.gameObject);
62+
}
63+
}
64+
}

0 commit comments

Comments
 (0)