From f16af1de306e78390774c52d6dfa7981cb884741 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Thu, 9 Jun 2022 20:42:51 +0300 Subject: [PATCH] disable shadows casted by viewmodels, more perf stats --- Content/Common/RocketLauncherPrefab.prefab | 4 ++-- Source/Game/Console/EngineSubsystem.cs | 16 +++++++++++++++- Source/Game/Hud/PerformanceWidget.cs | 20 ++++++++++++++++++-- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Content/Common/RocketLauncherPrefab.prefab b/Content/Common/RocketLauncherPrefab.prefab index fe10c99..8022d08 100644 --- a/Content/Common/RocketLauncherPrefab.prefab +++ b/Content/Common/RocketLauncherPrefab.prefab @@ -38,7 +38,7 @@ "Entries": [ { "Material": "ae5c8a4b4f723b60b8b31290a9dfb21a", - "ShadowsMode": 3, + "ShadowsMode": 0, "Visible": true, "ReceiveDecals": true } @@ -69,7 +69,7 @@ "Entries": [ { "Material": "ae5c8a4b4f723b60b8b31290a9dfb21a", - "ShadowsMode": 3, + "ShadowsMode": 0, "Visible": true, "ReceiveDecals": true } diff --git a/Source/Game/Console/EngineSubsystem.cs b/Source/Game/Console/EngineSubsystem.cs index 1f49b16..b6d872c 100644 --- a/Source/Game/Console/EngineSubsystem.cs +++ b/Source/Game/Console/EngineSubsystem.cs @@ -219,7 +219,21 @@ namespace Game globals.SetValue("Scene Lighting", boolValue); - // TODO: make sure AO is disabled (it's not) + + PostFxVolume postFx = Level.FindActor(); + if (postFx != null) + { + AmbientOcclusionSettings aoSettings = postFx.AmbientOcclusion; + /*aoSettings.OverrideFlags = (aoSettings.OverrideFlags & ~AmbientOcclusionSettingsOverride.Enabled) | + (boolValue + ? AmbientOcclusionSettingsOverride.Enabled + : 0 & AmbientOcclusionSettingsOverride.Enabled); + */ + aoSettings.Enabled = boolValue; + postFx.AmbientOcclusion = aoSettings; + } + + // TODO: disable GI Light[] lights = Level.GetActors(); foreach (Light light in lights) diff --git a/Source/Game/Hud/PerformanceWidget.cs b/Source/Game/Hud/PerformanceWidget.cs index fa66210..ce950b0 100644 --- a/Source/Game/Hud/PerformanceWidget.cs +++ b/Source/Game/Hud/PerformanceWidget.cs @@ -8,7 +8,7 @@ namespace Game [ExecuteInEditMode] public class PerformanceWidget : Script { - private const double updateInterval = 0.25; + private const double updateInterval = 0.2; public UIControl control; private Label label; @@ -37,7 +37,23 @@ namespace Game updateTimeAvg = elapsed / updateTimeCount; updateTimeCount = 0; - label.Text = $"{(int)Math.Round(1.0f / updateTimeAvg)}fps"; + label.Text = ""; + + long triangles = 0; + long drawCalls = 0; + +#if BUILD_DEBUG || BUILD_DEVELOPMENT + var gpuEvents = ProfilingTools.EventsGPU; + if (gpuEvents.Length > 0) + { + triangles = gpuEvents[0].Stats.Triangles; + drawCalls = gpuEvents[0].Stats.DrawCalls; + } +#endif + + label.Text += $"{triangles} tris\n {drawCalls} drawcalls\n"; + + label.Text += $"{(int)Math.Round(1.0f / updateTimeAvg)}fps"; } #if false