disable shadows casted by viewmodels, more perf stats

This commit is contained in:
2022-06-09 20:42:51 +03:00
parent 17296d3749
commit f16af1de30
3 changed files with 35 additions and 5 deletions

View File

@@ -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