MultiMC / Launcher

A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once
https://multimc.org/
Other
4.28k stars 875 forks source link

Incorrect DPI #3380

Open Idunno1 opened 3 years ago

Idunno1 commented 3 years ago

System Information

MultiMC version: 0.6.11-1430

Operating System: Win10 x64

Summary of the issue or suggestion:

When launching an instance, Minecraft will only run at 1080p, even though it's in a 4K monitor and MultiMC is set to be high-DPI scaled on System (Enhanced).

The mouse moves much slower in-game.

What should happen:

Minecraft should launch in 4K. (No fuzziness, smaller window, etc.)

Steps to reproduce the issue (Add more if needed):

  1. Literally just open the game for me.

Suspected cause:

MultiMC doesn't have a way of having MC to check the resolution of the device and set it accordingly?

Logs/Screenshots:

[//]: # https://paste.ee/p/MY4aB

Additional Info:

I can't set the DPI settings myself because I have no way of accessing the launcher's properties.

QuImUfu commented 3 years ago

IDK what high-DPI scaled on System (Enhanced) on windows is supposed to do but minecraft has been capable of adapting the rendering resolution of GUI elements to mach almost any resolution for ages, without any weird OS-Level feature.
Disable it, and everything should work fine. (as it did for years)
If i did not understand your issue correctly, please post screenshots or make the issue more clear in some other way.

Idunno1 commented 3 years ago

IDK what high-DPI scaled on System (Enhanced) on windows is supposed to do but minecraft has been capable of adapting the rendering resolution of GUI elements to mach almost any resolution for ages, without any weird OS-Level feature. Disable it, and everything should work fine. (as it did for years) If i did not understand your issue correctly, please post screenshots or make the issue more clear in some other way.

Sorry for not being more direct about this.

https://imgur.com/a/JI8VCx7

When I launch an instance in MultiMC, Minecraft assumes i'm on a 1080p monitor, making it appear fuzzy. When I launch it on the Twitch client, everything is scaled correctly. Hopefully that gave you more insight.

Also, forcing it to display in 4K using optifine still assumes its in 1080p, making it much larger than it needs to be. Setting it to 1920x1080 fills the monitor the way it should.

Another thing to note is that MMC's GUI scale is set to normal, while Twitch's is set to high.

peterix commented 3 years ago

MultiMC has absolutely nothing to do with DPI scaling in the game for anything after 1.5.2 (where MultiMC had some semblance of control). Neither does Twitch. Twitch isn't even a launcher to begin with.

You are most likely looking at the side effect of something else on your system guessing and getting it wrong. Probably some part of Windows.

peterix commented 3 years ago

Anyway, no matter where the blame goes, it needs investigation.

Janrupf commented 3 years ago

Windows might be inheriting the DPI scale to child processes. I'm not sure if the Twitch launcher registers itself as DPI aware to the system (electron might to this internally) or MultiMC does (Qt might do this internally, or MultiMC explictly does), it is possible that it influences child processes.

Janrupf commented 3 years ago

Looks like MultiMC tells Qt to enable HighDPI mode: https://github.com/MultiMC/MultiMC5/blob/af5120c828831dfe41482ebaff79608ba8531ede/application/main.cpp#L32-L33 Now, after some research it looks like electron registers itself as DPI aware too. However, I'm unsure if Qt calls the actual Win32 function for registering processes as DPI aware (see here).

Additional resources:

peterix commented 3 years ago

This being inherited in any way sounds like a bug.

peterix commented 3 years ago

Using older Java has fixed this for an another user.

Try using the Java from https://github.com/MultiMC/MultiMC5/wiki/Unsupported-Intel-GPUs

Carionis commented 2 years ago

Hey, sorry for the necro on this issue, but I didn't want to open a new one. I was stuck with a resolution which MultiMC picked from somewhere, I have no clue, which. Resizing the window, fullscreen, nothing changed the resolution. Seeing as I am on a 4k monitor, this made things very fuzzy. I found this thread and today I found a solution.

The following launch arguments (I used the ones GDLauncher uses by default, except the ones for memory): -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump

fixed ALL resolution issues. Now the window resizes properly and uses the correct corresponding resolution. Hope this helps somehow.

Janrupf commented 2 years ago

@Carionis the arguments are provided are VERY VERY unlikely to fix anything at all, let me pick them apart for you:

https://github.com/MultiMC/Launcher/blob/94fdf13f4a113bb1ffc75a4862308f12c904b2c4/launcher/minecraft/MinecraftInstance.cpp#L331-L335

Please test again without the arguments and report your findings. It might be more convenient to talk to us on Discord

Carionis commented 2 years ago

Okay, you're onto something. Restarting the same instance without the arguments now I have also the correct resolution which adapts to window size as opposed to the old situation with one fixed resolution. Considering that I didn't change anything else - at least to my knowledge, I'm now totally mystified as to what happened. I even un-checked the "High performance" windows setting for my java, just to make sure that wasn't it either. Resolution is still fine. BTW: Does the "ifdef" even work on a 64 bit Windows? - sorry, I have no clue about programming.

In summary: Launching once with the above arguments fixed something - at least that's my hypothesis. And even not using them the problem stays fixed for now.

P.S. Discord wasn't really an option today. I might reconsider tomorrow.

jredfox commented 2 years ago

I figured out this bug today. it's from the java version itself at least in game. adoptiumopenjdk appears to fix DPI scaling issues. it's not going to use the dpi thus fixing the blurriness. while oracle jre has had this issue for a while. you should install the default java as adoptium openjdk per minecraft instance. and then only if the user plays with the settings either instance or global will it change

simply test this by extracting adotpium openjdk to a folder and linking multimc javaw.exe to adoptium openjdk. this will fix the issues

TheAndrey commented 2 years ago

I also faced this problem 😐 I have already found a solution - disable scaling via Windows compatibility mode. But I don't found any settings in MultiMC. You just need to set the environment variable __COMPAT_LAYER=HIGHDPIAWARE to game process to turn off the OS scaling.

ImLunaHey commented 1 year ago

The launcher also has DPI issues.

This is on windows 11 with a 4k screen set to 2x.

image

phit commented 1 year ago

use this build on modern Windows for better scaling support https://files.multimc.org/downloads/mmc-develop-win32-5.15.2.zip