Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to render frosted sliders #30347

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion osu.Game.Rulesets.Osu/Skinning/Default/DrawableSliderPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Lines;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public abstract partial class DrawableSliderPath : SmoothPath
public abstract partial class DrawableSliderPath : BackdropBlurPath
{
public const float BORDER_PORTION = 0.128f;
public const float GRADIENT_PORTION = 1 - BORDER_PORTION;

private const float border_max_size = 8f;
private const float border_min_size = 0f;

protected DrawableSliderPath()
{
EffectBufferScale = new Vector2(0.25f);
}

private Color4 borderColour = Color4.White;

public Color4 BorderColour
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ private void load()
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Alpha = priorityLookupPrefix == null ? 0.75f : 0.5f // TODO: this is kind of a dirty way to check if we're a hitcircle or a circle that's part of a slider.
},
OverlayLayer = new Container
{
Expand Down
13 changes: 12 additions & 1 deletion osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using osu.Game.Rulesets.Osu.Skinning.Default;
using osu.Game.Skinning;
using osu.Game.Utils;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Osu.Skinning.Legacy
Expand All @@ -18,11 +19,21 @@ public partial class LegacySliderBody : PlaySliderBody
protected override Color4 GetBodyAccentColour(ISkinSource skin, Color4 hitObjectAccentColour)
{
// legacy skins use a constant value for slider track alpha, regardless of the source colour.
return base.GetBodyAccentColour(skin, hitObjectAccentColour).Opacity(0.7f);
return base.GetBodyAccentColour(skin, hitObjectAccentColour).Opacity(0.6f);
}

private partial class LegacyDrawableSliderPath : DrawableSliderPath
{
public LegacyDrawableSliderPath()
{
BlurSigma = new Vector2(16f);

BackdropTintStrength = 0.5f;

// To prevent shadows from contributing to the background blur effect
MaskCutoff = 0.25f;
}

protected override Color4 ColourAt(float position)
{
// https://github.com/peppy/osu-stable-reference/blob/3ea48705eb67172c430371dcfc8a16a002ed0d3d/osu!/Graphics/Renderers/MmSliderRendererGL.cs#L99
Expand Down
6 changes: 5 additions & 1 deletion osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,11 @@
Children = new Drawable[]
{
backReceptor = new ScreenFooter.BackReceptor(),
ScreenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both },
new RefCountedBackbufferProvider

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Code Quality

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Code Quality

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 997 in osu.Game/OsuGame.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

The type or namespace name 'RefCountedBackbufferProvider' could not be found (are you missing a using directive or an assembly reference?)
{
RelativeSizeAxes = Axes.Both,
Child = ScreenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }
},
BackButton = new BackButton(backReceptor)
{
Anchor = Anchor.BottomLeft,
Expand Down
Loading