ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.05k stars 2.22k forks source link

Optionally disable music visualiser around osu! logo #4748

Closed jai-x closed 5 years ago

jai-x commented 5 years ago

Describe the new feature:

The logo visualisation seems to tank FPS on some low end hardware I tested lazer on, being more of an issue in the carousel screen. This could be optionally disabled by the user for smoother performance in menu screens.

Proposal designs of the feature:

Add a toggle to enable/disable this effect in the Options -> Graphics -> Detail Settings menu.

smoogipoo commented 5 years ago

I don't want to go about it this way. From a GPU perspective, the visualiser doesn't even constitute 1x fill from what I recall, and much much less than that in song select. On the CPU side the drawnode performance could likely be improved - maybe a flattening of the bars via a shader, using half the bars by merging directly opposite bars, etc.

Also it's by far not the biggest contributor to fps loss in song select, I'd don't believe CPU limitations will be reached before fillrate.

peppy commented 5 years ago

The overhead in local performance testing is absolutely negligible. Would be interested in knowing how you are testing this.

jai-x commented 5 years ago

I testing this against commit 3f702d1, with a modified OsuLogo.cs file that had the logo visualizer removed and this beatmap playing music always.

Here is the diff:

diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs
index 4631f4e22..bc21bb8e2 100644
--- a/osu.Game/Screens/Menu/OsuLogo.cs
+++ b/osu.Game/Screens/Menu/OsuLogo.cs
@@ -38,7 +38,6 @@ public class OsuLogo : BeatSyncedContainer
         private readonly Container logoBeatContainer;
         private readonly Container logoAmplitudeContainer;
         private readonly Container logoHoverContainer;
-        private readonly LogoVisualisation visualizer;

         private readonly IntroSequence intro;

@@ -139,14 +138,6 @@ public OsuLogo()
                                             AutoSizeAxes = Axes.Both,
                                             Children = new Drawable[]
                                             {
-                                                visualizer = new LogoVisualisation
-                                                {
-                                                    RelativeSizeAxes = Axes.Both,
-                                                    Origin = Anchor.Centre,
-                                                    Anchor = Anchor.Centre,
-                                                    Alpha = 0.5f,
-                                                    Size = new Vector2(0.96f)
-                                                },
                                                 new Container
                                                 {
                                                     AutoSizeAxes = Axes.Both,
@@ -299,12 +290,6 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint,
                     .FadeTo(0.2f * amplitudeAdjust, early_activation, Easing.Out)
                     .Then()
                     .FadeOut(beatLength);
-
-                visualizer.ClearTransforms();
-                visualizer
-                    .FadeTo(0.9f * amplitudeAdjust, early_activation, Easing.Out)
-                    .Then()
-                    .FadeTo(0.5f, beatLength);
             }
         }

PC Specs:
2019-05-09-150602_556x294_scrot

Ran game fullscreen.

Screen Visualizer Enabled Visualizer Removed
Menu 80 - 90 FPS 90 - 100 FPS
Carousel 12 - 50 FPS 40 - 54 FPS
Gameplay 85 - 100 FPS 85 - 100 FPS

There are probably a bunch of other things in the carousel that affect draw performance more, but disabling the visualizer did have a noticeable impact. I can understand if that's not the way you would like to address the problem though :)

peppy commented 5 years ago

Based on those results alone, there's a clear discrepancy which suggests it has less to do with the visualisation (carousel vs menu).

Also keep in mind different songs and different times in the song will cause different loads on the system. Also that there are other things on screen which are happening that can affect framerate.

Both smoogi and I have give you our word that there's no way what you are seeing is visaulisation related. Please use proper benchmarking methods if bringing up performance issues (using BenchmarkDotNet (which runs hundreds to millions of times to remove outliers) or at very least using long-running isolated and customised VisualTests).

jai-x commented 5 years ago

Alright then, I'll keep that in mind in the future 👍