From aa9582c0fa6a5d07dc6c345ae859e68520203fa8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Feb 2017 11:28:12 +0900 Subject: [PATCH 1/5] Add exponential fall-off of triangles' alpha values. --- osu.Game/Graphics/Backgrounds/Triangles.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 219af9bd38..1eac06d472 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -10,6 +10,7 @@ using osu.Framework.MathUtils; using OpenTK; using OpenTK.Graphics; using System; +using osu.Framework.Graphics.Colour; namespace osu.Game.Graphics.Backgrounds { @@ -37,6 +38,12 @@ namespace osu.Game.Graphics.Backgrounds private float triangleScale = 1; + /// + /// Whether we should exponentially drop-off alpha values to improve the visual appearance of unbuffered fades. + /// This defaults to on as it is generally more aesthetically pleasing, but should be turned off in buffered contexts. + /// + public bool ExponentialAlphaAdjust = true; + public float TriangleScale { get { return triangleScale; } @@ -63,8 +70,11 @@ namespace osu.Game.Graphics.Backgrounds { base.Update(); + float adjustedAlpha = ExponentialAlphaAdjust ? (float)Math.Pow(((Color4)DrawInfo.Colour.Colour).A, 3) : 1; + foreach (var t in Children) { + t.Alpha = adjustedAlpha; t.Position -= new Vector2(0, (float)(t.Scale.X * (50 / DrawHeight) * (Time.Elapsed / 950)) / triangleScale); if (ExpireOffScreenTriangles && t.DrawPosition.Y + t.DrawSize.Y * t.Scale.Y < 0) t.Expire(); From 585d42f89f44386cabc5d4423e9edfee0ed9bb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 28 Feb 2017 19:01:02 +0100 Subject: [PATCH 2/5] Improve naming and correctness of triangles fading --- osu.Game/Graphics/Backgrounds/Triangles.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 1eac06d472..f3b75ce91a 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -39,10 +39,11 @@ namespace osu.Game.Graphics.Backgrounds private float triangleScale = 1; /// - /// Whether we should exponentially drop-off alpha values to improve the visual appearance of unbuffered fades. - /// This defaults to on as it is generally more aesthetically pleasing, but should be turned off in buffered contexts. + /// Whether we should drop-off alpha values of triangles more quickly to improve + /// the visual appearance of fading. This defaults to on as it is generally more + /// aesthetically pleasing, but should be turned off in s. /// - public bool ExponentialAlphaAdjust = true; + public bool HideAlphaDiscrepancies = true; public float TriangleScale { @@ -70,7 +71,10 @@ namespace osu.Game.Graphics.Backgrounds { base.Update(); - float adjustedAlpha = ExponentialAlphaAdjust ? (float)Math.Pow(((Color4)DrawInfo.Colour.Colour).A, 3) : 1; + float adjustedAlpha = HideAlphaDiscrepancies ? + // Cubically scale alpha to make it drop off more sharply. + (float)Math.Pow(DrawInfo.Colour.AverageColour.Linear.A, 3) : + 1; foreach (var t in Children) { From f0e9ed463627284e1cae8cf52e180a22cea7c958 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Mar 2017 11:56:14 +0900 Subject: [PATCH 3/5] Fix regression in TrianglesPiece. --- osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs index 33ed93e625..26d44f3865 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs @@ -14,6 +14,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces public TrianglesPiece() { TriangleScale = 1.2f; + HideAlphaDiscrepancies = false; } protected override void Update() From ec83da2845260a4163034ba5284e190eb46af52a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Mar 2017 11:56:26 +0900 Subject: [PATCH 4/5] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index b061324151..4c0762eec2 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b0613241512e46eed9dc16ae08ed4064d2db4101 +Subproject commit 4c0762eec20d2a3063df908a49432326570bea9f From 22c46ec9fb03dacb89cc413131781a30e63e7094 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Mar 2017 13:03:33 +0900 Subject: [PATCH 5/5] Fix CI? --- osu.Desktop.Tests/osu.Desktop.Tests.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Desktop.Tests/osu.Desktop.Tests.csproj b/osu.Desktop.Tests/osu.Desktop.Tests.csproj index 9037acb220..07495311e0 100644 --- a/osu.Desktop.Tests/osu.Desktop.Tests.csproj +++ b/osu.Desktop.Tests/osu.Desktop.Tests.csproj @@ -54,9 +54,6 @@ $(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll - - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll -