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

Fix logo animation not rendering correctly on iOS #351

Merged
merged 3 commits into from
Dec 24, 2024

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Dec 23, 2024

This issue is happening also due to premult, and is not one that can be fixed by ppy/osu-framework#6470, as premult is the norm in iOS's internals and what the logic in that PR does is use API that "un-premult" it, therefore there are inaccuracies introduced (this can be seen by the comparison picture in the PR where the two boxes aren't exactly 1:1 identical around the middle). Not to mention that this is 100% required when we use premult everywhere.

The fix is simply stripping alpha away from the textures entirely and storing its information in a colour channel instead (green is chosen), therefore the texture does not get affected by premult. This may sound one step backwards but I don't think it's usual for us to define shaders that act based on the colour value of the texture while including alpha information to it, so we have to change the formatting of the texture instead (also trimming KBs in the process).

The new format of the texture is:

  • red channel for animation progression
  • green channel for alpha information
  • blue channel is unused
  • no alpha channel present, or must be 100% in every pixel to avoid premult.
CleanShot.2024-12-23.at.16.54.09.mp4

@frenzibyte frenzibyte self-assigned this Dec 23, 2024
@peppy
Copy link
Member

peppy commented Dec 24, 2024

Tested on windows and macOS, looks good 👍 .

@peppy peppy merged commit d05ee7c into ppy:master Dec 24, 2024
2 checks passed
@frenzibyte frenzibyte deleted the fix-intro-animation branch December 24, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intro animation broken on iOS
2 participants