ppy / osu

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

Hitcircles flash with color/saturation at kiai sections #26990

Open Pallid3 opened 8 months ago

Pallid3 commented 8 months ago

Type

Cosmetic

Bug description

Basically at kiai sections the hitcircles flash, which is normal. But in lazer they have bit of color/saturation, unlike in stable.

Video comparing stable and lazer: https://www.youtube.com/watch?v=QRaLodKmQSI

Screenshots or videos

No response

Version

2024.131.0-lazer

Logs

compressed-logs.zip

bdach commented 8 months ago

I had to launch gimp and use the ol' difference trick to even see what you were talking about.

image

There's a faint green glow on the sides of the hitcircle.

Please link the skin.

Pallid3 commented 8 months ago

the skin https://drive.google.com/file/d/1ayx0kkgh6nZgI_pCVKSm1sACgm12UKHN/view?usp=sharing

EVAST9919 commented 8 months ago

My guess would be that stable is using white flash colour for hitcircle overlays which is not the case in lazer where it's using circle colour https://github.com/ppy/osu/blob/c64d414d1b229c5dc508eadcfea1d8a9425cbcbd/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs#L131 Looking at the video it's hard to tell whether kiai flash is being applied to overlays in the first place.

peppy commented 3 weeks ago

This may be due to stable adding a separate lighting layer for each kiai flash?

JetBrains Rider-EAP 2024-10-03 at 10 59 22

Another possibility is that the layering is different. In lazer the flashing layers are adjacent to their originals while in stable both layers are at a higher depth to the original

This will require someone to experiment further to visually match.

Here's the stable code for reference:

        internal virtual void UpdateKiai()
        {
            if (!player.NewSyncBeatWaiting) return;

            int len = (int)(AudioEngine.BeatLength * 0.75f * 100f / AudioEngine.CurrentPlaybackRate);

            foreach (HitObject h in player.hitObjectManager.hitObjectsMinimal)
            {
                int thisLen = len;

                if (thisLen + AudioEngine.Time > h.EndTime)
                    thisLen = h.EndTime - AudioEngine.Time;

                if (thisLen < 0) continue;

                if (h.IsHit || !h.IsVisible || h.SpriteCollection.Count == 0) continue;

                float finalFade = 0;// 1 - ((float)thisLen / len);

                int add = Math.Max(25, 300 - h.Colour.R - h.Colour.G - h.Colour.B);

                Color c = new Color(
                    (byte)Math.Min(h.Colour.R + add, 255),
                    (byte)Math.Min(h.Colour.G + add, 255),
                    (byte)Math.Min(h.Colour.B + add, 255));

                if (ConfigManager.sHitLighting)
                {
                    pSprite plight =
                        new pSprite(TextureManager.Load(@"lighting"),
                                    h.SpriteCollection[0].Field,
                                    Origins.Centre,
                                    Clocks.AudioOnce, h.Position, 0, false, h.Colour);
                    plight.Scale = 1.2f;
                    plight.Transformations.Add(
                        new Transformation(TransformationType.Fade, 0, 0.5f, AudioEngine.Time,
                                           AudioEngine.Time + 50));
                    plight.Transformations.Add(
                        new Transformation(TransformationType.Fade, 0.5f, finalFade, AudioEngine.Time + 50,
                                           AudioEngine.Time + thisLen * 2));
                    plight.Additive = true;
                    player.hitObjectManager.spriteManager.Add(plight);
                }

                foreach (pSprite s in h.CreateKiaiSprites())
                {
                    if (s == null || !s.IsVisible) continue;

                    s.Clock = Clocks.AudioOnce;
                    s.Depth += 0.1f;
                    s.Additive = true;
                    s.AlwaysDraw = false;
                    s.InitialColour = c;
                    s.Transformations.RemoveAll(t => t.Type == TransformationType.Fade);
                    s.Transformations.Add(new Transformation(TransformationType.Fade, s.Alpha * 0.3f, finalFade * s.Alpha, AudioEngine.Time, AudioEngine.Time + thisLen));

                    player.hitObjectManager.spriteManager.Add(s);
                }
            }
        }