From 735b573705d3b62ca6816ced327f19157cc5cedd Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 7 Oct 2024 18:03:55 +0200 Subject: [PATCH 01/14] Bump up build number --- Flax.flaxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flax.flaxproj b/Flax.flaxproj index ca1a1aff8..33dc6e45b 100644 --- a/Flax.flaxproj +++ b/Flax.flaxproj @@ -4,7 +4,7 @@ "Major": 1, "Minor": 9, "Revision": 0, - "Build": 6604 + "Build": 6605 }, "Company": "Flax", "Copyright": "Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.", From 9694446fcaf3befc4e104e28e17bb1010933fb1e Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 8 Oct 2024 12:15:01 +0200 Subject: [PATCH 02/14] Optimize `Color32` to use packed bits for quick comparisons --- Source/Engine/Core/Math/Color32.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Core/Math/Color32.h b/Source/Engine/Core/Math/Color32.h index 48910131f..17d5d65d1 100644 --- a/Source/Engine/Core/Math/Color32.h +++ b/Source/Engine/Core/Math/Color32.h @@ -80,12 +80,12 @@ public: public: bool operator==(const Color32& other) const { - return R == other.R && G == other.G && B == other.B && A == other.A; + return Raw == other.Raw; } bool operator!=(const Color32& other) const { - return R != other.R || G != other.G || B != other.B || A != other.A; + return Raw != other.Raw; } Color32 operator+(const Color32& b) const @@ -138,7 +138,7 @@ public: // Returns true if color is fully transparent (all components are equal zero). bool IsTransparent() const { - return R + G + B + A == 0; + return Raw == 0; } // Returns true if color has opacity channel in use (different from 255). @@ -222,7 +222,7 @@ namespace Math { FORCE_INLINE static bool NearEqual(const Color32& a, const Color32& b) { - return a == b; + return a.Raw == b.Raw; } } From 600ac568a9f7e4f2e55fcf3963f19a355e7115b3 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 9 Oct 2024 12:14:53 +0200 Subject: [PATCH 03/14] Change default shadows update rate at far plane to be 1 to prevent artifacts Users can tweak this down manually when optimizing game (dynamic games might stay at 1) --- Source/Engine/Level/Actors/Light.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Level/Actors/Light.h b/Source/Engine/Level/Actors/Light.h index 3138d996f..e43520df5 100644 --- a/Source/Engine/Level/Actors/Light.h +++ b/Source/Engine/Level/Actors/Light.h @@ -174,7 +174,7 @@ public: /// Frequency of shadow updates at the maximum distance from the view at which shadows are still rendered. This value is multiplied by ShadowsUpdateRate and allows scaling the update rate in-between the shadow range. For example, if light is near view, it will get normal shadow updates but will reduce this rate when far from view. See ShadowsUpdateRate to learn more. /// API_FIELD(Attributes="EditorOrder(105), EditorDisplay(\"Shadow\", \"Update Rate At Distance\"), Limit(0.0f, 1.0f)") - float ShadowsUpdateRateAtDistance = 0.5f; + float ShadowsUpdateRateAtDistance = 1.0f; /// /// Defines the resolution of the shadow map texture used to draw objects projection from light-point-of-view. Higher values increase shadow quality at cost of performance. From 73842d97932de6d41e9829f2c0921531d3b93c5e Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 9 Oct 2024 12:17:39 +0200 Subject: [PATCH 04/14] Fix properties order in Light shadows section --- Source/Engine/Level/Actors/Light.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Level/Actors/Light.h b/Source/Engine/Level/Actors/Light.h index e43520df5..bcb914740 100644 --- a/Source/Engine/Level/Actors/Light.h +++ b/Source/Engine/Level/Actors/Light.h @@ -173,7 +173,7 @@ public: /// /// Frequency of shadow updates at the maximum distance from the view at which shadows are still rendered. This value is multiplied by ShadowsUpdateRate and allows scaling the update rate in-between the shadow range. For example, if light is near view, it will get normal shadow updates but will reduce this rate when far from view. See ShadowsUpdateRate to learn more. /// - API_FIELD(Attributes="EditorOrder(105), EditorDisplay(\"Shadow\", \"Update Rate At Distance\"), Limit(0.0f, 1.0f)") + API_FIELD(Attributes="EditorOrder(101), EditorDisplay(\"Shadow\", \"Update Rate At Distance\"), Limit(0.0f, 1.0f)") float ShadowsUpdateRateAtDistance = 1.0f; /// From 79471af0c186441005294a1562264c7d95abc8f5 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 11:19:06 +0200 Subject: [PATCH 05/14] Fix bug in new shadows rendering when there are too many lights --- Source/Engine/Renderer/ShadowsPass.cpp | 38 ++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/Source/Engine/Renderer/ShadowsPass.cpp b/Source/Engine/Renderer/ShadowsPass.cpp index b30005b51..0487d7ce2 100644 --- a/Source/Engine/Renderer/ShadowsPass.cpp +++ b/Source/Engine/Renderer/ShadowsPass.cpp @@ -330,6 +330,7 @@ public: for (auto it = Lights.Begin(); it.IsNotEnd(); ++it) { auto& atlasLight = it->Value; + atlasLight.StaticState = ShadowAtlasLight::Unused; atlasLight.Cache.StaticValid = false; for (int32 i = 0; i < atlasLight.TilesCount; i++) atlasLight.Tiles[i].ClearDynamic(); @@ -370,7 +371,8 @@ public: for (auto& e : Lights) { auto& atlasLight = e.Value; - if (atlasLight.StaticState == ShadowAtlasLight::CopyStaticShadow && atlasLight.Bounds.Intersects(bounds)) + if ((atlasLight.StaticState == ShadowAtlasLight::CopyStaticShadow || atlasLight.StaticState == ShadowAtlasLight::NoStaticGeometry) + && atlasLight.Bounds.Intersects(bounds)) { // Invalidate static shadow atlasLight.Cache.StaticValid = false; @@ -719,8 +721,14 @@ bool ShadowsPass::SetupLight(ShadowsCustomBuffer& shadows, RenderContext& render } switch (atlasLight.StaticState) { - case ShadowAtlasLight::CopyStaticShadow: case ShadowAtlasLight::NoStaticGeometry: + // Light was modified so attempt to find the static shadow again + if (!atlasLight.Cache.StaticValid && atlasLight.HasStaticShadowContext) + { + atlasLight.StaticState = ShadowAtlasLight::WaitForGeometryCheck; + break; + } + case ShadowAtlasLight::CopyStaticShadow: case ShadowAtlasLight::FailedToInsertTiles: // Skip collecting static draws atlasLight.HasStaticShadowContext = false; @@ -728,7 +736,7 @@ bool ShadowsPass::SetupLight(ShadowsCustomBuffer& shadows, RenderContext& render } if (atlasLight.HasStaticShadowContext) { - // If rendering finds any static draws then it's set to true + // If rendering finds any static draws then it will be set to true for (auto& tile : atlasLight.Tiles) tile.HasStaticGeometry = false; } @@ -1367,7 +1375,7 @@ void ShadowsPass::RenderShadowMaps(RenderContextBatch& renderContextBatch) const ShadowsCustomBuffer* shadowsPtr = renderContext.Buffers->FindCustomBuffer(TEXT("Shadows"), false); if (shadowsPtr == nullptr || shadowsPtr->Lights.IsEmpty() || shadowsPtr->LastFrameUsed != Engine::FrameCount) return; - PROFILE_GPU_CPU("ShadowMaps"); + PROFILE_GPU_CPU("Shadow Maps"); const ShadowsCustomBuffer& shadows = *shadowsPtr; GPUContext* context = GPUDevice::Instance->GetMainContext(); context->ResetSR(); @@ -1384,9 +1392,29 @@ void ShadowsPass::RenderShadowMaps(RenderContextBatch& renderContextBatch) for (auto& e : shadows.Lights) { ShadowAtlasLight& atlasLight = e.Value; - if (atlasLight.StaticState != ShadowAtlasLight::UpdateStaticShadow || !atlasLight.HasStaticShadowContext || atlasLight.ContextCount == 0) + if (!atlasLight.HasStaticShadowContext || atlasLight.ContextCount == 0) continue; int32 contextIndex = 0; + + if (atlasLight.StaticState == ShadowAtlasLight::WaitForGeometryCheck) + { + // Check for any static geometry to use in static shadow map + for (int32 tileIndex = 0; tileIndex < atlasLight.TilesCount; tileIndex++) + { + ShadowAtlasLightTile& tile = atlasLight.Tiles[tileIndex]; + contextIndex++; // Skip dynamic context + auto& shadowContextStatic = renderContextBatch.Contexts[atlasLight.ContextIndex + contextIndex++]; + if (!shadowContextStatic.List->DrawCallsLists[(int32)DrawCallsListType::Depth].IsEmpty() || !shadowContextStatic.List->ShadowDepthDrawCallsList.IsEmpty()) + { + tile.HasStaticGeometry = true; + } + } + } + + if (atlasLight.StaticState != ShadowAtlasLight::UpdateStaticShadow) + continue; + + contextIndex = 0; for (int32 tileIndex = 0; tileIndex < atlasLight.TilesCount; tileIndex++) { ShadowAtlasLightTile& tile = atlasLight.Tiles[tileIndex]; From 0fcd6a194a9f4af5706a83b9b90ca337088a1f49 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 18:08:32 +0200 Subject: [PATCH 06/14] Update Assimp lib for Linux --- Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a | 3 --- Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a | 4 ++-- Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a | 3 --- Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a | 3 --- Source/ThirdParty/assimp/assimp.Build.cs | 1 - Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs | 2 -- 6 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a delete mode 100644 Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a delete mode 100644 Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a deleted file mode 100644 index 92c1baf0b..000000000 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4eb25101716011a5b4c872c5cd303c3292a61e5f661e9296d95502b5705e2e53 -size 181458 diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a index 4dccc7f4b..8680fe1af 100644 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a +++ b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cbd73a154e270cc03d3da292b2c3cc73ee473b221f43722d060dc114916d6d5 -size 7996212 +oid sha256:fc6f4d94de6fccc854c5ec2cfc98b6516391448f92e9a1ecab6b24709e0c6f87 +size 10378226 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a deleted file mode 100644 index 6bcd58a96..000000000 --- a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6aa0849de08ac7f7332c63941b6ed028c329971b7d0ce9de44580e46b7560f2d -size 519048 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a b/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a deleted file mode 100644 index 792b3daf5..000000000 --- a/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b67f00759cb59c91e5fe3fcf8bc107c6ac5f54c1929cea246892298ec40f6ec -size 543624 diff --git a/Source/ThirdParty/assimp/assimp.Build.cs b/Source/ThirdParty/assimp/assimp.Build.cs index dc0f0f06c..2276ca2e2 100644 --- a/Source/ThirdParty/assimp/assimp.Build.cs +++ b/Source/ThirdParty/assimp/assimp.Build.cs @@ -37,7 +37,6 @@ public class assimp : DepsModule case TargetPlatform.Linux: case TargetPlatform.Mac: options.OutputFiles.Add(Path.Combine(depsRoot, "libassimp.a")); - options.OutputFiles.Add(Path.Combine(depsRoot, "libIrrXML.a")); break; default: throw new InvalidPlatformException(options.Platform.Target); } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs index 3cc1bacf0..8712839eb 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs @@ -128,7 +128,6 @@ namespace Flax.Deps.Dependencies configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h"); var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); - Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); break; } case TargetPlatform.Mac: @@ -141,7 +140,6 @@ namespace Flax.Deps.Dependencies configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h"); var depsFolder = GetThirdPartyFolder(options, platform, architecture); Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); - Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); } break; } From 2d6257a3902252c0492c41a3477241e8b843f6d4 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 20:32:44 +0200 Subject: [PATCH 07/14] Revert "Update Assimp lib for Linux" This reverts commit 0fcd6a194a9f4af5706a83b9b90ca337088a1f49. --- Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a | 3 +++ Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a | 4 ++-- Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a | 3 +++ Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a | 3 +++ Source/ThirdParty/assimp/assimp.Build.cs | 1 + Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs | 2 ++ 6 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a create mode 100644 Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a create mode 100644 Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a new file mode 100644 index 000000000..92c1baf0b --- /dev/null +++ b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4eb25101716011a5b4c872c5cd303c3292a61e5f661e9296d95502b5705e2e53 +size 181458 diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a index 8680fe1af..4dccc7f4b 100644 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a +++ b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fc6f4d94de6fccc854c5ec2cfc98b6516391448f92e9a1ecab6b24709e0c6f87 -size 10378226 +oid sha256:8cbd73a154e270cc03d3da292b2c3cc73ee473b221f43722d060dc114916d6d5 +size 7996212 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a new file mode 100644 index 000000000..6bcd58a96 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6aa0849de08ac7f7332c63941b6ed028c329971b7d0ce9de44580e46b7560f2d +size 519048 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a b/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a new file mode 100644 index 000000000..792b3daf5 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b67f00759cb59c91e5fe3fcf8bc107c6ac5f54c1929cea246892298ec40f6ec +size 543624 diff --git a/Source/ThirdParty/assimp/assimp.Build.cs b/Source/ThirdParty/assimp/assimp.Build.cs index 2276ca2e2..dc0f0f06c 100644 --- a/Source/ThirdParty/assimp/assimp.Build.cs +++ b/Source/ThirdParty/assimp/assimp.Build.cs @@ -37,6 +37,7 @@ public class assimp : DepsModule case TargetPlatform.Linux: case TargetPlatform.Mac: options.OutputFiles.Add(Path.Combine(depsRoot, "libassimp.a")); + options.OutputFiles.Add(Path.Combine(depsRoot, "libIrrXML.a")); break; default: throw new InvalidPlatformException(options.Platform.Target); } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs index 8712839eb..3cc1bacf0 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs @@ -128,6 +128,7 @@ namespace Flax.Deps.Dependencies configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h"); var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); + Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); break; } case TargetPlatform.Mac: @@ -140,6 +141,7 @@ namespace Flax.Deps.Dependencies configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h"); var depsFolder = GetThirdPartyFolder(options, platform, architecture); Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); + Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); } break; } From cc8afbc220ab301385275ba948b08584ffd5d05b Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 21:28:30 +0200 Subject: [PATCH 08/14] Update Assimp for Mac --- Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a | 3 --- Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a | 4 ++-- Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a | 3 --- Source/Platforms/Mac/Binaries/ThirdParty/x64/libassimp.a | 2 +- Source/ThirdParty/assimp/assimp.Build.cs | 1 - Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs | 2 +- 6 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a delete mode 100644 Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a deleted file mode 100644 index 6bcd58a96..000000000 --- a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6aa0849de08ac7f7332c63941b6ed028c329971b7d0ce9de44580e46b7560f2d -size 519048 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a index 622b54e48..0aeab8ca5 100644 --- a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:05ed7fbba9701903c4d488eebda74ff71316af984bda5b125ff4822e53c05f3a -size 66547240 +oid sha256:512690a2639b29649b19531e8f24f0e50600c5c225c674568d28e168b5078838 +size 7427096 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a b/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a deleted file mode 100644 index 792b3daf5..000000000 --- a/Source/Platforms/Mac/Binaries/ThirdParty/x64/libIrrXML.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b67f00759cb59c91e5fe3fcf8bc107c6ac5f54c1929cea246892298ec40f6ec -size 543624 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/x64/libassimp.a b/Source/Platforms/Mac/Binaries/ThirdParty/x64/libassimp.a index da1ab7c0b..ae7e0edd9 100644 --- a/Source/Platforms/Mac/Binaries/ThirdParty/x64/libassimp.a +++ b/Source/Platforms/Mac/Binaries/ThirdParty/x64/libassimp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ead9834575a8b7dcab9f8539b59342a850d72d968ab4bdf6e1775510c7a38659 +oid sha256:1fc8320db7b98865e00e750277dec9aff82a3842454cb784d944c44b4aacfcbc size 7830128 diff --git a/Source/ThirdParty/assimp/assimp.Build.cs b/Source/ThirdParty/assimp/assimp.Build.cs index dc0f0f06c..2276ca2e2 100644 --- a/Source/ThirdParty/assimp/assimp.Build.cs +++ b/Source/ThirdParty/assimp/assimp.Build.cs @@ -37,7 +37,6 @@ public class assimp : DepsModule case TargetPlatform.Linux: case TargetPlatform.Mac: options.OutputFiles.Add(Path.Combine(depsRoot, "libassimp.a")); - options.OutputFiles.Add(Path.Combine(depsRoot, "libIrrXML.a")); break; default: throw new InvalidPlatformException(options.Platform.Target); } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs index 3cc1bacf0..f5bb8298c 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs @@ -136,12 +136,12 @@ namespace Flax.Deps.Dependencies // Build for Mac foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 }) { + Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError); RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig); Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h"); var depsFolder = GetThirdPartyFolder(options, platform, architecture); Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); - Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); } break; } From 9e04f0b05483fdcd80204f68ae87b2bf353a8a42 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 22:09:03 +0200 Subject: [PATCH 09/14] Update Assimp for Linux (use clang 7) --- .../Linux/Binaries/ThirdParty/x64/libIrrXML.a | 3 --- .../Linux/Binaries/ThirdParty/x64/libassimp.a | 4 ++-- .../Tools/Flax.Build/Deps/Dependencies/Assimp.cs | 15 ++++++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a deleted file mode 100644 index 92c1baf0b..000000000 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4eb25101716011a5b4c872c5cd303c3292a61e5f661e9296d95502b5705e2e53 -size 181458 diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a index 4dccc7f4b..8680fe1af 100644 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a +++ b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cbd73a154e270cc03d3da292b2c3cc73ee473b221f43722d060dc114916d6d5 -size 7996212 +oid sha256:fc6f4d94de6fccc854c5ec2cfc98b6516391448f92e9a1ecab6b24709e0c6f87 +size 10378226 diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs index f5bb8298c..307f0e309 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs @@ -1,6 +1,6 @@ // Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. -using System; +using System.Collections.Generic; using System.IO; using Flax.Build; @@ -122,13 +122,18 @@ namespace Flax.Deps.Dependencies } case TargetPlatform.Linux: { + var envVars = new Dictionary + { + { "CC", "clang-7" }, + { "CC_FOR_BUILD", "clang-7" } + }; + // Build for Linux - RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig); - Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); + RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars); + Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars); configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h"); var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); - Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); break; } case TargetPlatform.Mac: @@ -136,12 +141,12 @@ namespace Flax.Deps.Dependencies // Build for Mac foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 }) { - Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError); RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig); Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h"); var depsFolder = GetThirdPartyFolder(options, platform, architecture); Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); + Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError); } break; } From b37ba9279ee71c5565d291d7b80692ef248042e9 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 22:51:59 +0200 Subject: [PATCH 10/14] Update Assimp for Linux (use clang 13) Migrate to Ubuntu 24 for CI/CD builds CLang 7 used before is no longer avaliable on latest Ubuntu distro --- .github/workflows/build_linux.yml | 4 ++-- .github/workflows/cd.yml | 4 ++-- .github/workflows/tests.yml | 2 +- Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a | 4 ++-- Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs | 5 +++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index b3348c288..d65662673 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -10,7 +10,7 @@ jobs: # Editor editor-linux: name: Editor (Linux, Development x64) - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" steps: - name: Checkout repo uses: actions/checkout@v3 @@ -41,7 +41,7 @@ jobs: # Game game-linux: name: Game (Linux, Release x64) - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d83b40363..bb9fe3e6a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -76,7 +76,7 @@ jobs: # Linux package-linux-editor: name: Editor (Linux) - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" steps: - name: Checkout repo uses: actions/checkout@v3 @@ -110,7 +110,7 @@ jobs: path: Output/FlaxEditorLinux.zip package-linux-game: name: Game (Linux) - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e36642cdf..2242a546c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: # Tests on Linux tests-linux: name: Tests (Linux) - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a index 8680fe1af..92b3c5545 100644 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a +++ b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fc6f4d94de6fccc854c5ec2cfc98b6516391448f92e9a1ecab6b24709e0c6f87 -size 10378226 +oid sha256:b3510d6c5585f08fc9fcbf2044bb0dc0238e2501c1914e3b98aef36bc8cd2711 +size 10303430 diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs index 307f0e309..652bbccb9 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs @@ -124,8 +124,9 @@ namespace Flax.Deps.Dependencies { var envVars = new Dictionary { - { "CC", "clang-7" }, - { "CC_FOR_BUILD", "clang-7" } + { "CC", "clang-13" }, + { "CC_FOR_BUILD", "clang-13" }, + { "CXX", "clang++-13" }, }; // Build for Linux From 5c0110769aa71780e93698e4f53c9d38d1756a08 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 22:57:44 +0200 Subject: [PATCH 11/14] Remove custom source for Linux CI/CD --- .github/workflows/build_linux.yml | 2 -- .github/workflows/build_linux_sources.list | 4 ---- .github/workflows/cd.yml | 4 ---- .github/workflows/tests.yml | 2 -- 4 files changed, 12 deletions(-) delete mode 100644 .github/workflows/build_linux_sources.list diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index d65662673..4b2aa4510 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -16,8 +16,6 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan diff --git a/.github/workflows/build_linux_sources.list b/.github/workflows/build_linux_sources.list deleted file mode 100644 index 4d8f94f35..000000000 --- a/.github/workflows/build_linux_sources.list +++ /dev/null @@ -1,4 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index bb9fe3e6a..30ac942f2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -86,8 +86,6 @@ jobs: git lfs pull - name: Install dependencies run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan @@ -120,8 +118,6 @@ jobs: git lfs pull - name: Install dependencies run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2242a546c..9a77fb5c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,8 +28,6 @@ jobs: git lfs pull - name: Install dependencies run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Build From 56ebbecd3b09e55c3e70107254c55b59d28022b3 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 23:24:07 +0200 Subject: [PATCH 12/14] Remove apt update on Linux CI/CD --- .github/workflows/build_linux.yml | 1 - .github/workflows/cd.yml | 2 -- .github/workflows/tests.yml | 1 - 3 files changed, 4 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 4b2aa4510..6290ff525 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -16,7 +16,6 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies run: | - sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 30ac942f2..4b4f9a827 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -86,7 +86,6 @@ jobs: git lfs pull - name: Install dependencies run: | - sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan @@ -118,7 +117,6 @@ jobs: git lfs pull - name: Install dependencies run: | - sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Setup Vulkan uses: ./.github/actions/vulkan diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a77fb5c6..b828974a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,6 @@ jobs: git lfs pull - name: Install dependencies run: | - sudo apt-get update sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev - name: Build run: | From b45f6c13216502c53568d210ac4350d42ad80b20 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 23:27:01 +0200 Subject: [PATCH 13/14] Disable editor screenshot when running without graphics --- Source/Editor/Modules/WindowsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Modules/WindowsModule.cs b/Source/Editor/Modules/WindowsModule.cs index 02dd6d151..b9f3e246b 100644 --- a/Source/Editor/Modules/WindowsModule.cs +++ b/Source/Editor/Modules/WindowsModule.cs @@ -950,7 +950,7 @@ namespace FlaxEditor.Modules MainWindow = null; // Capture project icon screenshot (not in play mode and if editor was used for some time) - if (!Editor.StateMachine.IsPlayMode && Time.TimeSinceStartup >= 5.0f) + if (!Editor.StateMachine.IsPlayMode && Time.TimeSinceStartup >= 5.0f && GPUDevice.Instance?.RendererType != RendererType.Null) { Editor.Log("Capture project icon screenshot"); _projectIconScreenshotTimeout = Time.TimeSinceStartup + 0.8f; // wait 800ms for a screenshot task From 425382f7d20c793cf9046f828357614cc283c447 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 17 Oct 2024 15:03:59 +0200 Subject: [PATCH 14/14] Fix iOS game dotnet lib incorrect name --- Source/Editor/Cooker/Steps/DeployDataStep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Cooker/Steps/DeployDataStep.cpp b/Source/Editor/Cooker/Steps/DeployDataStep.cpp index 84a36e5c6..ff22247ef 100644 --- a/Source/Editor/Cooker/Steps/DeployDataStep.cpp +++ b/Source/Editor/Cooker/Steps/DeployDataStep.cpp @@ -275,7 +275,7 @@ bool DeployDataStep::Perform(CookingData& data) DEPLOY_NATIVE_FILE("libmonosgen-2.0.dylib"); DEPLOY_NATIVE_FILE("libSystem.IO.Compression.Native.dylib"); DEPLOY_NATIVE_FILE("libSystem.Native.dylib"); - DEPLOY_NATIVE_FILE("libSystem.NET.Security.Native.dylib"); + DEPLOY_NATIVE_FILE("libSystem.Net.Security.Native.dylib"); DEPLOY_NATIVE_FILE("libSystem.Security.Cryptography.Native.Apple.dylib"); break; #undef DEPLOY_NATIVE_FILE