diff --git a/Content/Materials/SimpleMapMaterial.flax b/Content/Materials/SimpleMapMaterial.flax index 452729e..57527c3 100644 Binary files a/Content/Materials/SimpleMapMaterial.flax and b/Content/Materials/SimpleMapMaterial.flax differ diff --git a/Content/Materials/SkyMaterial.flax b/Content/Materials/SkyMaterial.flax index 868d390..074c073 100644 Binary files a/Content/Materials/SkyMaterial.flax and b/Content/Materials/SkyMaterial.flax differ diff --git a/Content/Materials/ViewModelMaterial.flax b/Content/Materials/ViewModelMaterial.flax index 98b309c..41d18a4 100644 Binary files a/Content/Materials/ViewModelMaterial.flax and b/Content/Materials/ViewModelMaterial.flax differ diff --git a/Content/Materials/WeaponMaterial.flax b/Content/Materials/WeaponMaterial.flax index 2bfa793..127b3a7 100644 Binary files a/Content/Materials/WeaponMaterial.flax and b/Content/Materials/WeaponMaterial.flax differ diff --git a/Content/Materials/interface/crosshairs/cross.flax b/Content/Materials/interface/crosshairs/cross.flax index 93ace54..08708d0 100644 Binary files a/Content/Materials/interface/crosshairs/cross.flax and b/Content/Materials/interface/crosshairs/cross.flax differ diff --git a/Content/Materials/interface/testguimat.flax b/Content/Materials/interface/testguimat.flax index 3762f4f..ed04e6b 100644 Binary files a/Content/Materials/interface/testguimat.flax and b/Content/Materials/interface/testguimat.flax differ diff --git a/Content/Materials/missing.flax b/Content/Materials/missing.flax index 864439a..e6075db 100644 Binary files a/Content/Materials/missing.flax and b/Content/Materials/missing.flax differ diff --git a/Content/Materials/testo.flax b/Content/Materials/testo.flax index 53bd68a..6d2deea 100644 Binary files a/Content/Materials/testo.flax and b/Content/Materials/testo.flax differ diff --git a/Content/Scenes/MainScene.scene b/Content/Scenes/MainScene.scene index b384623..ed01883 100644 --- a/Content/Scenes/MainScene.scene +++ b/Content/Scenes/MainScene.scene @@ -1,7 +1,7 @@ { "ID": "194e05f445ece24ec5448d886e1334df", "TypeName": "FlaxEngine.SceneAsset", - "EngineBuild": 65046, + "EngineBuild": 6601, "Data": [ { "ID": "194e05f445ece24ec5448d886e1334df", @@ -51,7 +51,7 @@ } }, "Data": { - "Text": "0 tris\n 0 drawcalls\n15fps2\n15fps" + "Text": "0 tris\n 0 drawcalls\r\n262fps2\r\n285fps" } }, { @@ -68,13 +68,6 @@ "TypeName": "FlaxEngine.UIControl", "ParentID": "ff6b6db54b5aa08e7286ef86246149ef", "Name": "CrosshairWidget", - "Transform": { - "Translation": { - "X": 0.0, - "Y": 1.0, - "Z": 0.0 - } - }, "Control": "FlaxEngine.GUI.Image", "Data": { "Brush": { @@ -119,8 +112,8 @@ "Offsets": { "Left": 0.0, "Right": 0.0, - "Top": 1.0, - "Bottom": -1.0 + "Top": 0.0, + "Bottom": 0.0 }, "Scale": { "X": 1.0, diff --git a/Content/Scenes/MultiSceneA.scene b/Content/Scenes/MultiSceneA.scene deleted file mode 100644 index a1cdc97..0000000 --- a/Content/Scenes/MultiSceneA.scene +++ /dev/null @@ -1,107 +0,0 @@ -{ - "ID": "a916228c48fe3a0e89ff0985d4ad2fca", - "TypeName": "FlaxEngine.SceneAsset", - "EngineBuild": 65045, - "Data": [ - { - "ID": "a916228c48fe3a0e89ff0985d4ad2fca", - "TypeName": "FlaxEngine.Scene", - "LightmapSettings": { - "IndirectLightingIntensity": 1.0, - "GlobalObjectsScale": 1.0, - "ChartsPadding": 3, - "AtlasSize": 1024, - "BounceCount": 1, - "CompressLightmaps": true, - "UseGeometryWithNoMaterials": true, - "Quality": 10 - } - }, - { - "ID": "6ee4b1e34ce62731b943e586b9864ae2", - "TypeName": "FlaxEngine.StaticModel", - "ParentID": "a916228c48fe3a0e89ff0985d4ad2fca", - "Name": "CubeFloor", - "Transform": { - "Translation": { - "X": 0.0, - "Y": 10.555465698242188, - "Z": 0.0 - }, - "Scale": { - "X": 3.7614870071411135, - "Y": 0.26607516407966616, - "Z": 3.4711759090423586 - } - }, - "Model": "b43f0f8f4aaba3f3156896a5a22ba493", - "Buffer": { - "Entries": [ - { - "Material": "00000000000000000000000000000000", - "ShadowsMode": 3, - "Visible": true, - "ReceiveDecals": true - } - ] - } - }, - { - "ID": "88b1ed59418cb010695115991acaa790", - "TypeName": "FlaxEngine.BoxCollider", - "ParentID": "6ee4b1e34ce62731b943e586b9864ae2", - "Name": "BoxCollider" - }, - { - "ID": "5aee089144314eac43865588f949cbe2", - "TypeName": "FlaxEngine.RigidBody", - "ParentID": "a916228c48fe3a0e89ff0985d4ad2fca", - "Name": "RigidBody", - "Transform": { - "Translation": { - "X": 0.0, - "Y": 92.45675659179688, - "Z": -42.916717529296878 - } - }, - "Mass": 27.00000762939453 - }, - { - "ID": "9a4e12084b6613849096a9b285b72c53", - "TypeName": "FlaxEngine.BoxCollider", - "ParentID": "5aee089144314eac43865588f949cbe2", - "Name": "BoxCollider", - "Transform": { - "Scale": { - "X": 0.30000001192092898, - "Y": 0.30000001192092898, - "Z": 0.30000001192092898 - } - } - }, - { - "ID": "6212e97240b1373f995b779a65a8a5f3", - "TypeName": "FlaxEngine.StaticModel", - "ParentID": "5aee089144314eac43865588f949cbe2", - "Name": "Cube", - "Transform": { - "Scale": { - "X": 0.30000001192092898, - "Y": 0.30000001192092898, - "Z": 0.30000001192092898 - } - }, - "Model": "b43f0f8f4aaba3f3156896a5a22ba493", - "Buffer": { - "Entries": [ - { - "Material": "00000000000000000000000000000000", - "ShadowsMode": 3, - "Visible": true, - "ReceiveDecals": true - } - ] - } - } - ] -} \ No newline at end of file diff --git a/Content/Scenes/MultiSceneBb.scene b/Content/Scenes/MultiSceneBb.scene deleted file mode 100644 index 10f6c2c..0000000 --- a/Content/Scenes/MultiSceneBb.scene +++ /dev/null @@ -1,107 +0,0 @@ -{ - "ID": "f749e5d141e1384c05e49abe92a4fb90", - "TypeName": "FlaxEngine.SceneAsset", - "EngineBuild": 65045, - "Data": [ - { - "ID": "f749e5d141e1384c05e49abe92a4fb90", - "TypeName": "FlaxEngine.Scene", - "LightmapSettings": { - "IndirectLightingIntensity": 1.0, - "GlobalObjectsScale": 1.0, - "ChartsPadding": 3, - "AtlasSize": 1024, - "BounceCount": 1, - "CompressLightmaps": true, - "UseGeometryWithNoMaterials": true, - "Quality": 10 - } - }, - { - "ID": "8048c4f041c327d1bbd03ab890f73405", - "TypeName": "FlaxEngine.StaticModel", - "ParentID": "f749e5d141e1384c05e49abe92a4fb90", - "Name": "CubeFloor", - "Transform": { - "Translation": { - "X": 0.0, - "Y": 10.555465698242188, - "Z": 0.0 - }, - "Scale": { - "X": 3.7614870071411135, - "Y": 0.26607516407966616, - "Z": 3.4711759090423586 - } - }, - "Model": "b43f0f8f4aaba3f3156896a5a22ba493", - "Buffer": { - "Entries": [ - { - "Material": "00000000000000000000000000000000", - "ShadowsMode": 3, - "Visible": true, - "ReceiveDecals": true - } - ] - } - }, - { - "ID": "c26bd5b24ea23e14a6bd77b1ff3e6a19", - "TypeName": "FlaxEngine.BoxCollider", - "ParentID": "8048c4f041c327d1bbd03ab890f73405", - "Name": "BoxCollider" - }, - { - "ID": "3ebecf744a613387694b3b9432a576f5", - "TypeName": "FlaxEngine.RigidBody", - "ParentID": "f749e5d141e1384c05e49abe92a4fb90", - "Name": "RigidBody", - "Transform": { - "Translation": { - "X": 0.0, - "Y": 92.45675659179688, - "Z": -42.916717529296878 - } - }, - "Mass": 27.00000762939453 - }, - { - "ID": "3be79c2b48f15d4ab126fcbb34104efb", - "TypeName": "FlaxEngine.BoxCollider", - "ParentID": "3ebecf744a613387694b3b9432a576f5", - "Name": "BoxCollider", - "Transform": { - "Scale": { - "X": 0.30000001192092898, - "Y": 0.30000001192092898, - "Z": 0.30000001192092898 - } - } - }, - { - "ID": "8d3acad54ec87dc0bccd0c9b68bd09a8", - "TypeName": "FlaxEngine.StaticModel", - "ParentID": "3ebecf744a613387694b3b9432a576f5", - "Name": "Cube", - "Transform": { - "Scale": { - "X": 0.30000001192092898, - "Y": 0.30000001192092898, - "Z": 0.30000001192092898 - } - }, - "Model": "b43f0f8f4aaba3f3156896a5a22ba493", - "Buffer": { - "Entries": [ - { - "Material": "00000000000000000000000000000000", - "ShadowsMode": 3, - "Visible": true, - "ReceiveDecals": true - } - ] - } - } - ] -} \ No newline at end of file diff --git a/Content/Scenes/MultiSceneTest.scene b/Content/Scenes/MultiSceneTest.scene deleted file mode 100644 index 08c4c68..0000000 --- a/Content/Scenes/MultiSceneTest.scene +++ /dev/null @@ -1,207 +0,0 @@ -{ - "ID": "5524fb9c40412196af3d79a9daae64cc", - "TypeName": "FlaxEngine.SceneAsset", - "EngineBuild": 65045, - "Data": [ - { - "ID": "5524fb9c40412196af3d79a9daae64cc", - "TypeName": "FlaxEngine.Scene", - "LightmapSettings": { - "IndirectLightingIntensity": 1.0, - "GlobalObjectsScale": 1.0, - "ChartsPadding": 3, - "AtlasSize": 1024, - "BounceCount": 1, - "CompressLightmaps": true, - "UseGeometryWithNoMaterials": true, - "Quality": 10 - } - }, - { - "ID": "c95a3dab492c1b2046ce2191daa2b111", - "TypeName": "Game.Q3MapImporter", - "ParentID": "5524fb9c40412196af3d79a9daae64cc", - "V": { - "mapPath": "Assets/Maps/aerowalk.map", - "importLights": true, - "BrightnessMultiplier": 0.8227397, - "LightRadiusMultiplier": 9.458821, - "StaticBatching": true -} - }, - { - "ID": "3a7aeb9c482dce809d729287977859be", - "TypeName": "Game.MultiSceneScript", - "ParentID": "5524fb9c40412196af3d79a9daae64cc", - "V": {} - }, - { - "ID": "ff6b6db54b5aa08e7286ef86246149ef", - "PrefabID": "cb74184545f392e5c67815808bc63e58", - "PrefabObjectID": "9e1b61dc44338f962e69f78ecb3d0536", - "ParentID": "5524fb9c40412196af3d79a9daae64cc", - "IsActive": false, - "V": {} - }, - { - "ID": "02119c7243cb3a4a4ffcd395ff07e23d", - "PrefabID": "cb74184545f392e5c67815808bc63e58", - "PrefabObjectID": "e94561104b27c841e6ab0bb479bde17a", - "ParentID": "ff6b6db54b5aa08e7286ef86246149ef", - "V": {} - }, - { - "ID": "ad0c546649722a6c7a6b9aa8fdcac019", - "PrefabID": "cb74184545f392e5c67815808bc63e58", - "PrefabObjectID": "926bc11f416c9cef57d383875a480ded", - "ParentID": "ff6b6db54b5aa08e7286ef86246149ef", - "Transform": { - "Translation": { - "X": -101.0, - "Y": -22.0, - "Z": 0.0 - } - }, - "Data": {} - }, - { - "ID": "35b34b0c4476f0ed43aa8fb4d5f2eebc", - "PrefabID": "cb74184545f392e5c67815808bc63e58", - "PrefabObjectID": "85ddca4e46ed0c030d063599ac716e96", - "ParentID": "ad0c546649722a6c7a6b9aa8fdcac019", - "V": { - "control": "ad0c546649722a6c7a6b9aa8fdcac019" -} - }, - { - "ID": "2fe5467d4e92726e24227cbcbcbd2844", - "TypeName": "FlaxEngine.UIControl", - "ParentID": "ff6b6db54b5aa08e7286ef86246149ef", - "Name": "CrosshairWidget", - "Control": "FlaxEngine.GUI.Image", - "Data": { - "Brush": { - "$type": "FlaxEngine.GUI.MaterialBrush, FlaxEngine.CSharp", - "Material": "3f912eea48c6e2438fe49881210cb7d7" - }, - "Margin": { - "Left": 0.0, - "Right": 0.0, - "Top": 0.0, - "Bottom": 0.0 - }, - "Color": { - "R": 1.0, - "G": 1.0, - "B": 1.0, - "A": 1.0 - }, - "MouseOverColor": { - "R": 1.0, - "G": 1.0, - "B": 1.0, - "A": 1.0 - }, - "DisabledTint": { - "R": 0.5019608, - "G": 0.5019608, - "B": 0.5019608, - "A": 1.0 - }, - "KeepAspectRatio": false, - "ClipChildren": true, - "CullChildren": true, - "AnchorMin": { - "X": 0.0, - "Y": 0.0 - }, - "AnchorMax": { - "X": 1.0, - "Y": 1.0 - }, - "Offsets": { - "Left": 0.0, - "Right": 0.0, - "Top": 0.0, - "Bottom": 0.0 - }, - "Scale": { - "X": 1.0, - "Y": 1.0 - }, - "Pivot": { - "X": 0.5, - "Y": 0.5 - }, - "Shear": { - "X": 0.0, - "Y": 0.0 - }, - "Rotation": 0.0, - "BackgroundColor": { - "R": 0.0, - "G": 0.0, - "B": 0.0, - "A": 0.0 - }, - "Enabled": true, - "Visible": true, - "AutoFocus": false -} - }, - { - "ID": "e12c6b914501fde5098a14a350c2809c", - "TypeName": "Game.CrosshairWidget", - "ParentID": "2fe5467d4e92726e24227cbcbcbd2844", - "V": {} - }, - { - "ID": "8736d067492170db415102997d187ff7", - "TypeName": "FlaxEngine.DirectionalLight", - "ParentID": "5524fb9c40412196af3d79a9daae64cc", - "IsActive": false, - "Name": "DirectionalLight", - "Transform": { - "Translation": { - "X": -370.8681335449219, - "Y": 191.241943359375, - "Z": -134.10745239257813 - }, - "Orientation": { - "X": 0.8119235038757324, - "Y": -7.162299908713976e-8, - "Z": -7.162299908713976e-8, - "W": 0.5837640166282654 - } - }, - "Brightness": 21.700000762939454, - "ViewDistance": 15400.0, - "ShadowsDistance": 9715.0, - "ShadowsFadeDistance": 5000.0 - }, - { - "ID": "6d29a4d44ce988b4b1844caa39c2a2bd", - "TypeName": "FlaxEngine.Camera", - "ParentID": "5524fb9c40412196af3d79a9daae64cc", - "Name": "Camera", - "Transform": { - "Translation": { - "X": 136.9144744873047, - "Y": 131.739990234375, - "Z": -495.9844665527344 - }, - "Orientation": { - "X": 0.09739881008863449, - "Y": -0.05181961879134178, - "Z": 0.005078235175460577, - "W": 0.9938824772834778 - }, - "Scale": { - "X": 1.0006136894226075, - "Y": 0.999918520450592, - "Z": 1.0005552768707276 - } - } - } - ] -} \ No newline at end of file diff --git a/Content/Settings/EngineSettings/PhysicsSettings.json b/Content/Settings/EngineSettings/PhysicsSettings.json index 28650d9..e5001c7 100644 --- a/Content/Settings/EngineSettings/PhysicsSettings.json +++ b/Content/Settings/EngineSettings/PhysicsSettings.json @@ -1,25 +1,26 @@ { "ID": "4bd8a4cc460399b5f1975fbe0a668e3f", "TypeName": "FlaxEditor.Content.Settings.PhysicsSettings", - "EngineBuild": 6331, + "EngineBuild": 6510, "Data": { "DefaultGravity": { "X": 0.0, "Y": -800.0, "Z": 0.0 }, - "QueriesHitTriggers": true, - "TriangleMeshTriangleMinAreaThreshold": 5.0, "BounceThresholdVelocity": 200.0, "FrictionCombineMode": 0, "RestitutionCombineMode": 0, "DisableCCD": false, - "EnableAdaptiveForce": false, + "BroadPhaseType": 3, + "SolverType": 0, "MaxDeltaTime": 0.1, "EnableSubstepping": false, "SubstepDeltaTime": 1E-05, "MaxSubsteps": 600, "SupportCookingAtRuntime": true, + "TriangleMeshTriangleMinAreaThreshold": 5.0, + "QueriesHitTriggers": true, "LayerMasks": [ 4294967295, 4294967295, diff --git a/Content/config.cfg b/Content/config.cfg index d283deb..6279ea8 100644 --- a/Content/config.cfg +++ b/Content/config.cfg @@ -1,5 +1,5 @@ // comment -r_shadows 0 +r_shadows 1 r_lighting 1 cl_maxfps 0 r_upscaling 0 diff --git a/Source/Game/Camera/CameraRender.cs b/Source/Game/Camera/CameraRender.cs index deb4b52..3185167 100644 --- a/Source/Game/Camera/CameraRender.cs +++ b/Source/Game/Camera/CameraRender.cs @@ -51,7 +51,7 @@ public class CameraRender : PostProcessEffect public override void OnAwake() { viewModelHolder = Parent.Parent.Parent.Parent.GetChild("ViewModelHolder"); - if (useMainCamera) + if (useMainCamera && viewModelHolder != null) { camera.IsActive = false; void foo(Actor actor) diff --git a/Source/Game/Console/Console.cs b/Source/Game/Console/Console.cs index cc7a346..9dd10c1 100644 --- a/Source/Game/Console/Console.cs +++ b/Source/Game/Console/Console.cs @@ -204,6 +204,7 @@ public class ConsoleInstance : IDisposable // Initializes the Console system. internal void InitConsoleSubsystems() { + return; #if USE_NETCORE var assemblies = Utils.GetAssemblies(); #else diff --git a/Source/Game/Console/ConsoleScript.cs b/Source/Game/Console/ConsoleScript.cs index e0f7b4a..207dc1d 100644 --- a/Source/Game/Console/ConsoleScript.cs +++ b/Source/Game/Console/ConsoleScript.cs @@ -159,6 +159,9 @@ public class ConsoleScript : Script + " long line in repeat a very very very long long long 4 line in repeat"); Console.Print("another normal line");*/ + //for (int i=0; i<10000; i++) + // Debug.Log("a very very very long long long line in repeat a very very very long long long line in"); + Debug.Logger.LogHandler.SendLog += OnSendLog; Debug.Logger.LogHandler.SendExceptionLog += OnSendExceptionLog; diff --git a/Source/Game/GameMode/NetworkManager_Client.cs b/Source/Game/GameMode/NetworkManager_Client.cs index bc5c32e..2a4cc4f 100644 --- a/Source/Game/GameMode/NetworkManager_Client.cs +++ b/Source/Game/GameMode/NetworkManager_Client.cs @@ -19,15 +19,7 @@ public static partial class NetworkManager public static bool ConnectServer(string serverAddress = "localhost", bool listenServer = false) { if (!listenServer) - { Cleanup(); - //WorldStateManager.Init(); - clientWorldStateManager = new WorldStateManager(isClient: true); - } - else - { - clientWorldStateManager = new WorldStateManager(isLocalClient: true); - } ServerAddress = serverAddress; //var driver = Object.New(typeof(ENetDriver)); @@ -56,6 +48,17 @@ public static partial class NetworkManager Console.Print("Failed to connect to the server."); return false; } + Debug.Log("Connected..."); + + if (!listenServer) + { + //WorldStateManager.Init(); + clientWorldStateManager = new WorldStateManager(isClient: true); + } + else + { + clientWorldStateManager = new WorldStateManager(isLocalClient: true); + } Scripting.FixedUpdate += OnClientNetworkUpdate; if (!listenServer) diff --git a/Source/Game/GameMode/WorldStateManager.cs b/Source/Game/GameMode/WorldStateManager.cs index 1480128..630dce6 100644 --- a/Source/Game/GameMode/WorldStateManager.cs +++ b/Source/Game/GameMode/WorldStateManager.cs @@ -99,6 +99,8 @@ public class WorldStateManager else NetworkManager.RegisterClientMessageCallback(OnMessage); + Debug.Log($"WorldStateManager Init is server: {IsServer}"); + Debug.Log($"WorldStateManager Init is local client: {IsLocalClient}"); PhysicsScene localPhysicsScene = Physics.FindOrCreateScene(IsLocalClient ? "ClientPhysicsScene" : "ServerPhysicsScene"); @@ -158,7 +160,7 @@ public class WorldStateManager var importer = FlaxEngine.Object.New(); importer.mapPath = @"C:\dev\GoakeFlax\Assets\Maps\aerowalk.map"; - importer.LoadCollidersOnly = false;//IsServer; + importer.LoadCollidersOnly = IsServer; importer.Parent = scene; //importer.Enabled = true; @@ -182,6 +184,13 @@ public class WorldStateManager { FlaxEngine.Object.Destroy(player); } + + if (scene) + { + if (Level.UnloadScene(scene)) + throw new Exception("Failed to unload scene"); + scene = null; + } } private PlayerFrame GetPlayerFrame(uint playerIndex, ulong playerFrameIndex) @@ -256,7 +265,9 @@ public class WorldStateManager //PlayerInputState inputState = playerMovement.input.GetCurrentInputState(); var playerFrame = playerLastFrame[playerId]; if (!playerMovement.input.GetState(playerFrame, out var inputState, out var actorState)) - Console.Print("send input failure to client"); + { + //Console.Print("send input failure to client"); + } { NetworkMessage message = NetworkManager.ServerBeginSendMessage(); diff --git a/Source/Game/Hud/PerformanceWidget.cs b/Source/Game/Hud/PerformanceWidget.cs index f441725..dd6e957 100644 --- a/Source/Game/Hud/PerformanceWidget.cs +++ b/Source/Game/Hud/PerformanceWidget.cs @@ -53,7 +53,7 @@ public class PerformanceWidget : Script StringBuilder text = new StringBuilder(10); -#if false +#if true long triangles = 0; long drawCalls = 0; @@ -67,7 +67,7 @@ public class PerformanceWidget : Script #endif text.AppendLine($"{triangles} tris\n {drawCalls} drawcalls"); - text.AppendLine($"{(int)Math.Round(1.0f / updateTimeAvg2)}fps2\n"); + text.AppendLine($"{(int)Math.Round(1.0f / updateTimeAvg2)}fps2"); #endif text.Append($"{(int)Math.Round(1.0f / updateTimeAvg)}fps"); diff --git a/Source/Game/Level/Q3MapImporter.cs b/Source/Game/Level/Q3MapImporter.cs index 81a66e5..cc4c16d 100644 --- a/Source/Game/Level/Q3MapImporter.cs +++ b/Source/Game/Level/Q3MapImporter.cs @@ -512,7 +512,6 @@ public class Q3MapImporter : Script bool useStaticBatching = StaticBatching && !LoadCollidersOnly; bool convexMesh = true; - FlaxEngine.Debug.Log("Loading map, static batching: " + useStaticBatching); { string matBasePath = Path.Combine(AssetManager.ContentPath, "Materials"); @@ -730,24 +729,24 @@ public class Q3MapImporter : Script if (!LoadCollidersOnly) { - geom.model = Content.CreateVirtualAsset(); - geom.model.SetupLODs(new[] { geom.meshes.Length }); - geom.model.SetupMaterialSlots(geom.meshes.Length); + geom.model = Content.CreateVirtualAsset(); + geom.model.SetupLODs(new[] { geom.meshes.Length }); + geom.model.SetupMaterialSlots(geom.meshes.Length); - for (int i = 0; i < geom.meshes.Length; i++) - { - BrushGeometryMesh mesh = geom.meshes[i]; - if (mesh.vertices.Count == 0) - continue; + for (int i = 0; i < geom.meshes.Length; i++) + { + BrushGeometryMesh mesh = geom.meshes[i]; + if (mesh.vertices.Count == 0) + continue; - geom.model.LODs[0].Meshes[i].UpdateMesh(mesh.vertices, mesh.indices, mesh.normals, - null, mesh.uvs); - geom.model.LODs[0].Meshes[i].MaterialSlotIndex = i; - geom.model.MaterialSlots[i].Material = geom.meshes[i].material; - } + geom.model.LODs[0].Meshes[i].UpdateMesh(mesh.vertices, mesh.indices, mesh.normals, + null, mesh.uvs); + geom.model.LODs[0].Meshes[i].MaterialSlotIndex = i; + geom.model.MaterialSlots[i].Material = geom.meshes[i].material; + } - //Not supported yet, should be done here - //geom.model.GenerateSDF(); + //Not supported yet, should be done here + //geom.model.GenerateSDF(); } brushIndex++; @@ -1317,6 +1316,19 @@ public class Q3MapImporter : Script Console.Print($"Generated level SDF in {sw2.Elapsed.TotalMilliseconds}ms"); }); } + + //Content.AssetDisposing += Content_AssetDisposing; + //Content.AssetReloading += Content_AssetReloading; + } + + private void Content_AssetReloading(Asset obj) + { + Debug.Log("asset reload: " + obj.Path + $" ({obj.TypeName})"); + } + + private void Content_AssetDisposing(Asset obj) + { + Debug.Log("asset disposing: " + obj.Path + $" ({obj.TypeName})"); } private void ParseLight(MapEntity entity, ref int lightIndex) @@ -1395,6 +1407,10 @@ public class Q3MapImporter : Script light.ShadowsDistance = 500f; light.ShadowsDepthBias = 0.027f;//0.005f; +#if FLAX_1_9_OR_NEWER + light.ShadowsUpdateRate = 0.0f; +#endif + int preset = 3; if (preset == 0) // most accurate?, huge radius and low performance {