Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/actions/install-unreal-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ runs:
7z x -mmt=8 "D:/Program Files/Epic Games/UE.zip" "-oD:/Program Files/Epic Games/"
del "D:/Program Files/Epic Games/UE.zip"
- name: Install Unreal Engine (older versions)
if: ${{ inputs.unreal-program-name != 'UE_5.6' }}
if: ${{ inputs.unreal-program-name == 'UE_5.4' || inputs.unreal-program-name == 'UE_5.5' }}
shell: pwsh
run: |
Start-Process "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Extras/Redist/en-us/UEPrereqSetup_x64.exe" -Args "-q" -Wait
- name: Install Unreal Engine (5.6+)
if: ${{ inputs.unreal-program-name == 'UE_5.6' }}
if: ${{ inputs.unreal-program-name != 'UE_5.4' && inputs.unreal-program-name != 'UE_5.5' }}
shell: pwsh
run: |
Start-Process "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Extras/Redist/en-us/vc_redist.x64.exe" -Args "-q" -Wait
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,121 @@ jobs:
test-package-base-name: "CesiumForUnreal-56"
visual-studio-version: "2022"
visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621"
Windows57:
uses: ./.github/workflows/buildWindows.yml
secrets: inherit
with:
runner-label: "windows-2022"
unreal-engine-version: "5.7.0"
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
unreal-program-name: "UE_5.7"
upload-package-base-name: "CesiumForUnreal-57-windows"
# These are specified in the Unreal Engine release notes under "IDE Version the Build farm compiles against"
# and using them ensures we're compiling our plugin in the exact same way that Unreal Engine itself is compiled.
cmake-generator: "Visual Studio 17 2022"
cmake-toolchain: "version=14.44"
cmake-platform: "x64,version=10.0.22621.0"
visual-studio-version: "2022"
visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621"
TestWindows57:
needs: [Windows57]
uses: ./.github/workflows/testWindows.yml
secrets: inherit
with:
runner-label: windows-2022
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
unreal-program-name: "UE_5.7"
test-package-base-name: "CesiumForUnreal-57-windows"
Android57:
uses: ./.github/workflows/buildAndroid.yml
secrets: inherit
with:
runner-label: windows-2022
unreal-engine-version: "5.7.0"
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
unreal-program-name: "UE_5.7"
upload-package-base-name: "CesiumForUnreal-57-android"
android-ndk-version: "r27c"
Linux57:
uses: ./.github/workflows/buildLinux.yml
secrets: inherit
with:
runner-label: ubuntu-22.04
unreal-engine-version: "5.7.0"
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/Linux_Unreal_Engine_5.7.0.zip"
unreal-program-name: "UE_5.7"
upload-package-base-name: "CesiumForUnreal-57-linux"
clang-version: "v26_clang-20.1.8-rockylinux8"
Apple57:
uses: ./.github/workflows/buildApple.yml
secrets: inherit
with:
runner-label: macos-14
unreal-engine-version: "5.7.0"
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_57-mac.zip"
unreal-program-name: "UE_5.7"
upload-package-base-name: "CesiumForUnreal-57-apple"
xcode-version: "16.1"
Combine57:
runs-on: ubuntu-latest
needs: [Windows57, Android57, Linux57, Apple57]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-57-${CESIUM_UNREAL_VERSION}"
export BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME="CesiumForUnreal-57-SourceOnly-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME" >> $GITHUB_ENV
- name: Download Apple build
uses: actions/download-artifact@v4
with:
name: CesiumForUnreal-57-apple-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Android build
uses: actions/download-artifact@v4
with:
name: CesiumForUnreal-57-android-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Linux build
uses: actions/download-artifact@v4
with:
name: CesiumForUnreal-57-linux-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Windows build
uses: actions/download-artifact@v4
with:
name: CesiumForUnreal-57-windows-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Publish combined package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: combine
- name: Publish combined package artifact for the Unreal Marketplace
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_CESIUM_UNREAL_SOURCE_ONLY_PACKAGE_NAME}}
path: |
combine
# These are built by Epic, and including them seems to confuse their process.
!combine/CesiumForUnreal/Binaries/**/*
!combine/CesiumForUnreal/Intermediate/**/*
TestPackage57:
needs: [Combine57]
uses: ./.github/workflows/testPackageOnWindows.yml
secrets: inherit
with:
runner-label: windows-2022
unreal-engine-zip: "s3://cesium-unreal-engine/5.7.0/UE_5.7.zip"
unreal-program-name: "UE_5.7"
unreal-engine-association: "5.7"
test-package-base-name: "CesiumForUnreal-57"
visual-studio-version: "2022"
visual-studio-components: "Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64,Microsoft.VisualStudio.Component.Windows11SDK.22621"
4 changes: 3 additions & 1 deletion Documentation/Source/dev.Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ public class devTarget : TargetRules
public devTarget( TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
#if UE_5_4_OR_LATER
#if UE_5_7_OR_LATER
DefaultBuildSettings = BuildSettingsVersion.V6;
#elif UE_5_4_OR_LATER
DefaultBuildSettings = BuildSettingsVersion.V4;
#else
DefaultBuildSettings = BuildSettingsVersion.V2;
Expand Down
4 changes: 3 additions & 1 deletion Documentation/Source/devEditor.Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ public class devEditorTarget : TargetRules
public devEditorTarget( TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
#if UE_5_4_OR_LATER
#if UE_5_7_OR_LATER
DefaultBuildSettings = BuildSettingsVersion.V6;
#elif UE_5_4_OR_LATER
DefaultBuildSettings = BuildSettingsVersion.V4;
#else
DefaultBuildSettings = BuildSettingsVersion.V2;
Expand Down
4 changes: 4 additions & 0 deletions Source/CesiumEditor/CesiumEditor.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ public CesiumEditor(ReadOnlyTargetRules Target) : base(Target)
}
);

#if UE_5_7_OR_LATER
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_7;
#else
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2;
#endif
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
CppStandard = CppStandardVersion.Cpp20;
}
Expand Down
10 changes: 8 additions & 2 deletions Source/CesiumRuntime/CesiumRuntime.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
"Json",
"JsonUtilities",
"Slate",
"SlateCore"
"SlateCore",
"ChaosCore"
}
);

Expand Down Expand Up @@ -156,8 +157,13 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
}
);

ShadowVariableWarningLevel = WarningLevel.Off;
#if UE_5_7_OR_LATER
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_7;
CppCompileWarningSettings.ShadowVariableWarningLevel = WarningLevel.Off;
#else
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
ShadowVariableWarningLevel = WarningLevel.Off;
#endif
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

CppStandard = CppStandardVersion.Cpp20;
Expand Down
29 changes: 29 additions & 0 deletions Source/CesiumRuntime/Private/CesiumCompat.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "CesiumCompat.h"
#include "CesiumCommon.h"

FSceneInterfaceWrapper::FSceneInterfaceWrapper(
FSceneInterface* InSceneInterface) {
#if ENGINE_VERSION_5_7_OR_HIGHER
this->ShaderPlatform = InSceneInterface->GetShaderPlatform();
#endif
this->RHIFeatureLevelType = InSceneInterface->GetFeatureLevel();
}

FMaterialRelevance FSceneInterfaceWrapper::GetMaterialRelevance(
UMeshComponent* InMeshComponent) const {
#if ENGINE_VERSION_5_7_OR_HIGHER
return InMeshComponent->GetMaterialRelevance(this->ShaderPlatform);
#else
return InMeshComponent->GetMaterialRelevance(this->RHIFeatureLevelType);
#endif
}

void ALevelInstance_SetDesiredRuntimeBehavior(
ALevelInstance* Instance,
ELevelInstanceRuntimeBehavior RuntimeBehavior) {
#if WITH_EDITORONLY_DATA && ENGINE_VERSION_5_7_OR_HIGHER
Instance->SetDesiredRuntimeBehavior(RuntimeBehavior);
#elif WITH_EDITORONLY_DATA
Instance->DesiredRuntimeBehavior = RuntimeBehavior;
#endif
}
36 changes: 36 additions & 0 deletions Source/CesiumRuntime/Private/CesiumCompat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2020 - 2025 CesiumGS, Inc.and Contributors

#pragma once

#include "CesiumCommon.h"
#include "Components/MeshComponent.h"
#include "LevelInstance/LevelInstanceActor.h"
#include "RHIFeatureLevel.h"
#include "RHIShaderPlatform.h"
#include "SceneInterface.h"

/**
* Wrapper around FSceneInterface to deal with the switch to EShaderPlatform in
* Unreal 5.7.
*/
struct FSceneInterfaceWrapper {
FSceneInterfaceWrapper(FSceneInterface* SceneInterface);

FMaterialRelevance
GetMaterialRelevance(UMeshComponent* InMeshComponent) const;

ERHIFeatureLevel::Type RHIFeatureLevelType;

#if ENGINE_VERSION_5_7_OR_HIGHER
private:
EShaderPlatform ShaderPlatform;
#endif
};

/**
* Compatibility fix for the DesiredRuntimeBehavior -> SetDesiredRuntimeBehavior
* change in Unreal 5.7.
*/
void ALevelInstance_SetDesiredRuntimeBehavior(
ALevelInstance* Instance,
ELevelInstanceRuntimeBehavior RuntimeBehavior);
6 changes: 4 additions & 2 deletions Source/CesiumRuntime/Private/CesiumGeoreference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "Cesium3DTileset.h"
#include "CesiumActors.h"
#include "CesiumCommon.h"
#include "CesiumCompat.h"
#include "CesiumCustomVersion.h"
#include "CesiumGeospatial/Cartographic.h"
#include "CesiumGlobeAnchorComponent.h"
Expand Down Expand Up @@ -781,8 +782,9 @@ void ACesiumGeoreference::_createSubLevelsFromWorldComposition() {
FRotator::ZeroRotator,
spawnParameters);
pLevelInstance->SetIsSpatiallyLoaded(false);
pLevelInstance->DesiredRuntimeBehavior =
ELevelInstanceRuntimeBehavior::LevelStreaming;
ALevelInstance_SetDesiredRuntimeBehavior(
pLevelInstance,
ELevelInstanceRuntimeBehavior::LevelStreaming);
pLevelInstance->SetActorLabel(pFound->LevelName);

FString levelPath = level.PackageName.ToString() + "." +
Expand Down
5 changes: 3 additions & 2 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "CesiumTransforms.h"
#include "Chaos/AABBTree.h"
#include "Chaos/CollisionConvexMesh.h"
#include "Chaos/Core.h"
#include "Chaos/TriangleMeshImplicitObject.h"
#include "CreateGltfOptions.h"
#include "EncodedFeaturesMetadata.h"
Expand Down Expand Up @@ -3259,7 +3260,7 @@ static void loadPrimitiveGameThreadPart(
NAME_None,
RF_Transactional);
pBaseAsMaterialInstance->AddAssetUserData(pCesiumData);
pCesiumData->PostEditChangeOwner();
pCesiumData->UpdateLayerNames();
}
}
#endif
Expand Down Expand Up @@ -3853,7 +3854,7 @@ static Chaos::FTriangleMeshImplicitObjectPtr BuildChaosTriangleMeshes(
Chaos::TParticles<Chaos::FRealSingle, 3> vertices;
vertices.AddParticles(vertexCount);
for (uint32 i = 0; i < vertexCount; ++i) {
vertices.X(int32(i)) = positionBuffer.VertexPosition(i);
vertices.SetX(int32(i), positionBuffer.VertexPosition(i));
}

int32 triangleCount = indices.Num() / 3;
Expand Down
4 changes: 3 additions & 1 deletion Source/CesiumRuntime/Private/CesiumGltfLinesComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ FPrimitiveSceneProxy* UCesiumGltfLinesComponent::CreateSceneProxy() {
return nullptr;
}

return new FCesiumGltfLinesSceneProxy(this, GetScene()->GetFeatureLevel());
return new FCesiumGltfLinesSceneProxy(
this,
FSceneInterfaceWrapper(GetScene()));
}
5 changes: 3 additions & 2 deletions Source/CesiumRuntime/Private/CesiumGltfLinesSceneProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ SIZE_T FCesiumGltfLinesSceneProxy::GetTypeHash() const {

FCesiumGltfLinesSceneProxy::FCesiumGltfLinesSceneProxy(
UCesiumGltfLinesComponent* InComponent,
ERHIFeatureLevel::Type InFeatureLevel)
FSceneInterfaceWrapper InSceneInterfaceParams)
: FPrimitiveSceneProxy(InComponent),
RenderData(InComponent->GetStaticMesh()->GetRenderData()),
NumLines(RenderData->LODResources[0].IndexBuffer.GetNumIndices() / 2),
Material(InComponent->GetMaterial(0)),
MaterialRelevance(InComponent->GetMaterialRelevance(InFeatureLevel)) {}
MaterialRelevance(
InSceneInterfaceParams.GetMaterialRelevance(InComponent)) {}

FCesiumGltfLinesSceneProxy::~FCesiumGltfLinesSceneProxy() {}

Expand Down
3 changes: 2 additions & 1 deletion Source/CesiumRuntime/Private/CesiumGltfLinesSceneProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#pragma once

#include "CesiumCompat.h"
#include "PrimitiveSceneProxy.h"

class UCesiumGltfLinesComponent;
Expand All @@ -17,7 +18,7 @@ class FCesiumGltfLinesSceneProxy final : public FPrimitiveSceneProxy {

FCesiumGltfLinesSceneProxy(
UCesiumGltfLinesComponent* InComponent,
ERHIFeatureLevel::Type InFeatureLevel);
FSceneInterfaceWrapper InSceneInterfaceParams);

virtual ~FCesiumGltfLinesSceneProxy();

Expand Down
3 changes: 2 additions & 1 deletion Source/CesiumRuntime/Private/CesiumGltfPointsComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2020-2024 CesiumGS, Inc. and Contributors

#include "CesiumGltfPointsComponent.h"
#include "CesiumCompat.h"
#include "CesiumGltfPointsSceneProxy.h"
#include "SceneInterface.h"

Expand All @@ -18,7 +19,7 @@ FPrimitiveSceneProxy* UCesiumGltfPointsComponent::CreateSceneProxy() {
}

FCesiumGltfPointsSceneProxy* Proxy =
new FCesiumGltfPointsSceneProxy(this, GetScene()->GetFeatureLevel());
new FCesiumGltfPointsSceneProxy(this, FSceneInterfaceWrapper(GetScene()));

FCesiumGltfPointsSceneProxyTilesetData TilesetData;
TilesetData.UpdateFromComponent(this);
Expand Down
7 changes: 4 additions & 3 deletions Source/CesiumRuntime/Private/CesiumGltfPointsSceneProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,20 @@ SIZE_T FCesiumGltfPointsSceneProxy::GetTypeHash() const {

FCesiumGltfPointsSceneProxy::FCesiumGltfPointsSceneProxy(
UCesiumGltfPointsComponent* InComponent,
ERHIFeatureLevel::Type InFeatureLevel)
FSceneInterfaceWrapper InSceneInterfaceParams)
: FPrimitiveSceneProxy(InComponent),
RenderData(InComponent->GetStaticMesh()->GetRenderData()),
NumPoints(RenderData->LODResources[0].IndexBuffer.GetNumIndices()),
bAttenuationSupported(
RHISupportsManualVertexFetch(GetScene().GetShaderPlatform())),
TilesetData(),
AttenuationVertexFactory(
InFeatureLevel,
InSceneInterfaceParams.RHIFeatureLevelType,
&RenderData->LODResources[0].VertexBuffers.PositionVertexBuffer),
AttenuationIndexBuffer(NumPoints, bAttenuationSupported),
Material(InComponent->GetMaterial(0)),
MaterialRelevance(InComponent->GetMaterialRelevance(InFeatureLevel)) {}
MaterialRelevance(
InSceneInterfaceParams.GetMaterialRelevance(InComponent)) {}

FCesiumGltfPointsSceneProxy::~FCesiumGltfPointsSceneProxy() {}

Expand Down
Loading