From 9e8e9e11748e54c1b08af4e0abc2df28e4ce1275 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Mon, 8 Jun 2026 09:14:24 +0300 Subject: [PATCH] Enable osu-stable sliders smoothness (#38015) Recent changes in path rendering framework-side made sliders more sharp. Prior to https://github.com/ppy/osu-framework/pull/6658 when rendering path's frame buffer linear filtering was applied which combined with `SmoothPath`'s internal antialiasing made them already smooth enough to disable this osu-side additional smoothing. Now we can re-enable this. (also there's https://github.com/ppy/osu-framework/pull/6763 which fixes edge artifacts present in master) |stable|master|pr|pr with https://github.com/ppy/osu-framework/pull/6763| |---|---|---|---| |stable|master|pr|pr-edge-fix| --- .../Skinning/Legacy/LegacySliderBody.cs | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs index 43b7260e2c..0fd1a85aee 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySliderBody.cs @@ -27,10 +27,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy protected override Color4 ColourAt(float position) { // https://github.com/peppy/osu-stable-reference/blob/3ea48705eb67172c430371dcfc8a16a002ed0d3d/osu!/Graphics/Renderers/MmSliderRendererGL.cs#L99 - // float aaWidth = Math.Min(Math.Max(0.5f / PathRadius, 3.0f / 256.0f), 1.0f / 16.0f); - // applying the aa_width constant from stable makes sliders blurry, especially on CS>5. set to zero for now. - // this might be related to SmoothPath applying AA internally, but disabling that does not seem to have much of an effect. - const float aa_width = 0f; + float aaWidth = Math.Min(Math.Max(0.5f / PathRadius, 3.0f / 256.0f), 1.0f / 16.0f); Color4 shadow = new Color4(0, 0, 0, 0.25f); Color4 outerColour = AccentColour.Darken(0.1f); @@ -40,19 +37,19 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy const float shadow_portion = 1 - (OsuLegacySkinTransformer.LEGACY_CIRCLE_RADIUS / OsuHitObject.OBJECT_RADIUS); const float border_portion = 0.1875f; - if (position <= shadow_portion - aa_width) - return LegacyUtils.InterpolateNonLinear(position, Color4.Black.Opacity(0f), shadow, 0, shadow_portion - aa_width); + if (position <= shadow_portion - aaWidth) + return LegacyUtils.InterpolateNonLinear(position, Color4.Black.Opacity(0f), shadow, 0, shadow_portion - aaWidth); - if (position <= shadow_portion + aa_width) - return LegacyUtils.InterpolateNonLinear(position, shadow, BorderColour, shadow_portion - aa_width, shadow_portion + aa_width); + if (position <= shadow_portion + aaWidth) + return LegacyUtils.InterpolateNonLinear(position, shadow, BorderColour, shadow_portion - aaWidth, shadow_portion + aaWidth); - if (position <= border_portion - aa_width) + if (position <= border_portion - aaWidth) return BorderColour; - if (position <= border_portion + aa_width) - return LegacyUtils.InterpolateNonLinear(position, BorderColour, outerColour, border_portion - aa_width, border_portion + aa_width); + if (position <= border_portion + aaWidth) + return LegacyUtils.InterpolateNonLinear(position, BorderColour, outerColour, border_portion - aaWidth, border_portion + aaWidth); - return LegacyUtils.InterpolateNonLinear(position, outerColour, innerColour, border_portion + aa_width, 1); + return LegacyUtils.InterpolateNonLinear(position, outerColour, innerColour, border_portion + aaWidth, 1); } ///