betacraftuk / betacraft-launcher

A launcher for Minecraft focused on legacy versions of the game
https://betacraft.uk
GNU General Public License v3.0
330 stars 40 forks source link

Mac: M1 Color Issue #38

Closed jadenquinn closed 1 year ago

jadenquinn commented 3 years ago

All you need as a description of the issue is this: https://youtu.be/TX-kBaHHc0U

It's on an M1 MacBook Air, but it happens on the M1 Mac mini as well.

Moresteck commented 3 years ago

I'm aware of that, and a fix is in-the-works ;)

jadenquinn commented 3 years ago

Oh wow nice - I wasn't expecting this to ever get fixed lol

cocona20xx commented 3 years ago

Hey, I'm part of the BetterThanWolves Community Edition Project; when the fix exists could you ping me in this thread? Since we are on 1.5.2, we have the exact same issue (Apple Silicon Color issues + Window Resize Crash + Incorrect Fullscreen behavior), so I'd like to discuss figuring out how to apply it to the BTW CE project when you have it working. Thanks!

jadenquinn commented 3 years ago

To be clear because I may be asked to test this again: I returned this MacBook Air a while ago, as I planned to, so I don’t have it anymore. If you need someone to do old, retro, and new-ish Mac testing I can still do that, just not the ARM systems like the M1.

cocona20xx commented 3 years ago

I'm capable of testing Apple Silicon machines, fyi.

cocona20xx commented 3 years ago

Any news on this? If you have even a clue of why the issue occurs, I'd love to know (so that I can work on a fix for at least 1.5.2, and maybe provide it as a more generalized pull request here too)

jadenquinn commented 2 years ago

I’ve seen this problem mentioned so many times on the Discord server, would be useful to know how far along the fix is before the close of the year, I have a few reasons for this and I know others do too.

FluffyPuppyKasey commented 2 years ago

Issues still persist, on many versions. Classic, Indev, and Infdev versions do not launch under Rosetta 2. First version to actually launch is Alpha 1.0.1_01. This has the colour issues

All tested versions that launch (Alpha, Beta, and final release) have colour issues.

M1 MacBook Air, 8c GPU, 8GB of RAM, macOS 12.1.

The game refuses to launch using an ARM-native JRE (first image), so this (second image) is running through Rosetta 2. Game is playable otherwise.

EDIT: Pre-classic is perfectly fine!

Screenshot 2022-01-02 at 8 51 07 PM

Screenshot 2022-01-02 at 8 49 29 PM

FluffyPuppyKasey commented 2 years ago

Okay, small update. I was able to figure out why Minecraft was having the issues - red and blue are swapped.

It should be fairly simple to write a mod (or patch) that swaps red and blue

FluffyPuppyKasey commented 2 years ago

Update: Adding an option directly in the launcher to enable and disable the fix.

Now to figure out how to implement the actual fix

EDIT: Managed to get classic, indev, and infdev to launch. As others have reported, there's a black screen issue, BUT these versions also have the colour issues

cocona20xx commented 2 years ago

As a sidenote: ive done testing myself on why the red and blue color channels are swapped; it isn't occurring at the rendering-level; this can be inferred from that screenshots, when created, show the correct colors.

A possible solution, is, perhaps, to apply a per-pixel shader that swaps the red and blue channels of each pixel within the game window after they are drawn to the window? Not sure how that works in the old versions of LWJGL present in old minecraft, though

jadenquinn commented 2 years ago

If possible, Windows7Ultimate and I are after a "mod" of sorts that directly fixes the M1 color issue, as well as an option within the Betacraft launcher. I just got another M1 Mac, and I'll be getting an M1 Pro MacBook Pro by the end of the month that I can test with. I've had issues with MultiMC regarding this issue as well, this is a problem all across the board. I noticed that when I launch a mudpack with a custom icon (icons that usually appear in the dock/taskbar on macOS), when the icons appear on the dock, they have the same discoloration issue as the game does. This is an issue from as early as I've tested (a1.0.16) to as far late as I've tested (Release 1.5.2). Happens on and off Forge, on and off Optifine, but now I am unable to even see anything in my Minecraft window in my custom 1.5.2 modpack, which is new. This doesn't seem to happen on any other version as far as I can see, but the white screen in fullscreen mode is still a thing, but one time I changed into fullscreen mode, the screen was black instead, not white.

Very strange.

jadenquinn commented 2 years ago

Any news on this? If you have even a clue of why the issue occurs, I'd love to know (so that I can work on a fix for at least 1.5.2, and maybe provide it as a more generalized pull request here too)

On this, Windows7Ultimate (AKA the owner of AlphaPlace and other (version)place servers and I are going to begin testing out fixes, as far as I gather. I'm not sure what he's been able to get done so far if anything, he hasn't responded to my latest message yet letting him know that I am now in possession of another M1 machine, but the fix he comes up with would likely only be for Minecraft Beta 1.1_02, as that's the version of his server, but I'm hoping the same fix can loosely be applied to all versions from alpha to release.

Note: This is not final, this is just my best guess. Communication isn't really my strong suite, but he did vocalize wanting to have the ability to test old Minecract versions and fixes for them on an M1 Mac. Might use parsec or something lol.

jadenquinn commented 2 years ago

As a sidenote: ive done testing myself on why the red and blue color channels are swapped; it isn't occurring at the rendering-level; this can be inferred from that screenshots, when created, show the correct colors.

A possible solution, is, perhaps, to apply a per-pixel shader that swaps the red and blue channels of each pixel within the game window after they are drawn to the window? Not sure how that works in the old versions of LWJGL present in old minecraft, though

This is incorrect. If you used the game's screenshotting ability, it's disqualified as it uses a different composition technique. I recently recorded my screen and the graphics are messed up in the recording too, OBS and QuickTimePlayer, so Minecraft clearly uses some other capture technique than everything else, therefore not producing screenshots with the glitch present.

Moresteck commented 2 years ago

I've developed a working M1 fix with the help of Dereku already, though it's very unlikely it will make its way to launcher v1.09 :( You can only wait for the next major release, or for LegacyFix (for MMC, Mojang and Mojang-like launchers). There's no ETA yet

jadenquinn commented 2 years ago

Building on what I said before, turns out that Windows isn't going to work on this, Steck up to the stage!

cocona20xx commented 2 years ago

https://github.com/MinecraftMachina/ManyMC/issues/39 is likely relevant to everyone in this thread; and contains a temporary workaround for Apple Silicon users (using ManyMC or other launchers with the macOS High DPI patch when running versions with the issue in the game's Fullscreen Mode fixes the color inversion, and no longer scales to fit the screen incorrectly!)

Furthermore, the Asahi Linux (Linux on Apple Silicon, https://github.com/AsahiLinux) project is developing Mesa drivers for Apple Silicon for both macOS and Linux. Said drivers may lead to said older versions working correctly in the future, especially on Linux where they should work out of the box once the drivers are complete (and therefor allowing for GPU support in Linux on Apple Silicon).

StereoMadnessss commented 2 years ago

BetaCraft is practically what not to play when it comes to launching older versions but then there is no real alternative so mainly in my eyes BetaCraft is practically left with their own decisions at their point to cut off MacOS or keep developing it. One thing is that it would be sad but I feel that it could happen as the MacOS version is an unstable, unhelpful mess for launching versions. The MacOS version is a messy dysfunctional mess.

jredfox commented 2 years ago

@StereoMadnessss it has little to do with macos itself but the ISA of both the supported JRE 1.8 for legacy versions and the natives which is different. The natives could be one of the fallowing {powerpc, x86, x64} and the newest is arm64. You need to configure rosetta to use x cpu ISA to y cpu ISA. you would have to know which is which in which natives of the game. from there they should work. I am sure it's not just the graphics but also keyboard, mouse, and whatever other things the natives did like say sounds

Yepthatsmy commented 2 years ago

All you need as a description of the issue is this: https://youtu.be/TX-kBaHHc0U

It's on an M1 MacBook Air, but it happens on the M1 Mac mini as well.

The video does not exist anymore, can someone send the patcher link?

StereoMadnessss commented 2 years ago

The YouTube video doesn't work but the issue is a problem for M1 Mac users.

jadenquinn commented 2 years ago

The YouTube video doesn't work but the issue is a problem for M1 Mac users.

Sorry about that, I made an editing mistake and my channel got terminated, here's a direct archive link for you to watch that video: https://archive.org/download/iredmc3/good/M1%20Alpha-%20MC%20Color%20Issue%20-%20Github%20Bug%20Report%205%20.mp4

jadenquinn commented 2 years ago

Update: They got it running, here’s it running: https://youtu.be/LlUL1dCt1H8

cocona20xx commented 2 years ago

Update: They got it running, here’s it running: https://youtu.be/LlUL1dCt1H8

Is the code for this fix available publicly yet?

Moresteck commented 2 years ago

Is the code for this fix available publicly yet?

Yes

lia-07 commented 2 years ago

Is the code for this fix available publicly yet?

Yes

How do you implement it?

lollar1337 commented 1 year ago

All you need as a description of the issue is this: https://youtu.be/TX-kBaHHc0U

It's on an M1 MacBook Air, but it happens on the M1 Mac mini as well.

Thank you for that dead link very helpfull.

jadenquinn commented 1 year ago

All you need as a description of the issue is this: https://youtu.be/TX-kBaHHc0U It's on an M1 MacBook Air, but it happens on the M1 Mac mini as well.

Thank you for that dead link very helpfull.

Blameyoutube - If you looked in the thread, you'd find the archive.

Edit: Ok actually it's literally like right above your comment.. https://github.com/Moresteck/BetaCraft-Launcher-Java/issues/38#issuecomment-1152318450 Hopefully that is more.. "helpfull" - That's not a word XD

Sorry just bitchy today.

jadenquinn commented 1 year ago

I'd say if anyone has the option still, get an Intel i9 MacBook Pro if you have your heart dead set on gaming on a MacBook, it's still quite performant but the battery is as bad as you'd expect, and prepare to have the fans on at full speed the entire time. MANUALLY.

Although, this fix would probably be used mostly by kids/young adults that never had the money to choose what machine they ultimately got for school or college or whatever, and are just using the tools provided for them, which... mad respect.

Moresteck commented 1 year ago

Fixed for v2

lia-07 commented 1 year ago

I'd say if anyone has the option still, get an Intel i9 MacBook Pro if you have your heart dead set on gaming on a MacBook, it's still quite performant but the battery is as bad as you'd expect, and prepare to have the fans on at full speed the entire time. MANUALLY.

Although, this fix would probably be used mostly by kids/young adults that never had the money to choose what machine they ultimately got for school or college or whatever, and are just using the tools provided for them, which... mad respect.

Nah Intel Macs are a total waste of money, especially now. All you need to do is fn + f11 to fullscreen and the colour issue is fixed. It's not as convenient, especially if you're using Discord, but it works.

spearphishing commented 7 months ago

Color inversion is still an issue in the latest release.

Screenshot 2024-03-21 at 3 32 50 AM
Moresteck commented 7 months ago

Color inversion is still an issue in the latest release.

Screenshot 2024-03-21 at 3 32 50 AM

This won't be fixed in v1

spearphishing commented 7 months ago

Color inversion is still an issue in the latest release.

Screenshot 2024-03-21 at 3 32 50 AM

This won't be fixed in v1

Good to know, thanks

benjamingwynn commented 5 months ago

@Moresteck how was this fixed in v2? I'm trying to debug #342 further and suspect this fix or another change, but I can't actually find where the fix for this is in the source code of v2 (or a related commit)

Moresteck commented 5 months ago

@Moresteck how was this fixed in v2? I'm trying to debug #342 further and suspect this fix or another change, but I can't actually find where the fix for this is in the source code of v2 (or a related commit)

This is fixed with legacyfix, with deAWT & patchMouse options. deAWT makes the game run natively, outside of the Java applet (which is what triggers the BGR color issue), patchMouse makes versions before a1.0.1_01 playable on macOS, and for later versions it improves performance.

The resizing issue has to do with LWJGL natives on Apple Silicon. It doesn't matter whether you use native ARM64 natives or x86_64 natives with Rosetta2, it is always going to have a 50% chance of crashing when resizing. I'm not sure how to fix it though, but I know it would involve patching up LWJGL native code.