From c4949de28f06b1f5fc19b2023e83e4dfcba87ac6 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 11 Apr 2024 10:20:21 +0200 Subject: [PATCH] Add new Static Flag `Shadow` for cached shadow maps --- Flax.flaxproj | 2 +- Source/Engine/Level/Actor.cpp | 7 +++++-- Source/Engine/Level/Types.h | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Flax.flaxproj b/Flax.flaxproj index 383d9e14e..46f3f93e4 100644 --- a/Flax.flaxproj +++ b/Flax.flaxproj @@ -4,7 +4,7 @@ "Major": 1, "Minor": 9, "Revision": 0, - "Build": 6600 + "Build": 6601 }, "Company": "Flax", "Copyright": "Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.", diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp index 2615f09fa..2e1870a57 100644 --- a/Source/Engine/Level/Actor.cpp +++ b/Source/Engine/Level/Actor.cpp @@ -1062,9 +1062,12 @@ void Actor::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) // StaticFlags update - added StaticFlags::Navigation // [Deprecated on 17.05.2020, expires on 17.05.2021] if (modifier->EngineBuild < 6178 && (int32)_staticFlags == (1 + 2 + 4)) - { _staticFlags |= StaticFlags::Navigation; - } + + // StaticFlags update - added StaticFlags::Shadow + // [Deprecated on 17.05.2020, expires on 17.05.2021] + if (modifier->EngineBuild < 6601 && (int32)_staticFlags == (1 + 2 + 4 + 8)) + _staticFlags |= StaticFlags::Shadow; const auto tag = stream.FindMember("Tag"); if (tag != stream.MemberEnd()) diff --git a/Source/Engine/Level/Types.h b/Source/Engine/Level/Types.h index 920cf65ca..b6ca23526 100644 --- a/Source/Engine/Level/Types.h +++ b/Source/Engine/Level/Types.h @@ -97,10 +97,15 @@ API_ENUM(Attributes="Flags") enum class StaticFlags /// Navigation = 1 << 3, + /// + /// Object is considered to have static shadowing (casting and receiving). + /// + Shadow = 1 << 4, + /// /// Object is fully static in the scene. /// - FullyStatic = Transform | ReflectionProbe | Lightmap | Navigation, + FullyStatic = ReflectionProbe | Lightmap | Transform | Navigation | Shadow, /// /// Maximum value of the enum (force to int).