Kir-Antipov / cubes-without-borders

A mod that allows you to play Minecraft in a borderless fullscreen window
MIT License
17 stars 7 forks source link

Breaks Distant Horizons with shaders #14

Open Scubakay opened 3 months ago

Scubakay commented 3 months ago

Distant Horizons released a new version with support for shaders this week. Also, I am trying Cubes Without Borders to replace Borderless mining, because it goes unsupported for very long stretches of time. Somehow CWB breaks the shaders in DH. This doesn't seem to happen after reloading the world.

I added some screenshots of what is happening.

Steps to reproduce:

With different shaders:

Photon image Complementary Reimagined image

Kir-Antipov commented 3 months ago

Are you on v1.1.0 or v1.0.0?

Scubakay commented 3 months ago

Just downloaded, it's 1.1.0+1.20

Kir-Antipov commented 3 months ago

Please, try downgrading to v1.0.0 and tell me of the issue persists.

Scubakay commented 3 months ago

Will do, but Modrinth seems to have a hard time with the 1.21 release :D

Oh, I forgot to mention btw. I'm still on 1.20.1!

Kir-Antipov commented 3 months ago

Aren't we all? :D

P.S. - you can also grab the JAR from GitHub Releases/CurseForge.

Scubakay commented 3 months ago

On our server we decided not to update due to the villager nerfs but now 1.21 is here we are definitely updating :D

Anyway, it works on 1.0.0!

Scubakay commented 3 months ago

Wait, so this little commit is probably what broke it?

https://github.com/Kir-Antipov/cubes-without-borders/commit/41ea26dd5ea87f0995f234141a50ad26aca430a4

Kir-Antipov commented 3 months ago

On our server we decided not to update due to the villager nerfs but now 1.21 is here we are definitely updating :D

That's understandable. While I support the general idea of encouraging players to explore their worlds a bit more and making this experience more rewarding, I'm definitely not thrilled about some deals vanishing completely and utterly out of existence!

Anyway, it works on 1.0.0!

Great! v1.1.0 turned out to be worse for Windows users. Since there are no new features in that version, feel free to stay on v1.0.0 while I work on v2.0.0, which will include some requested features and will also bring back a Windows-specific fix from v1.0.0 :)

Wait, so this little commit is probably what broke it?

Yup, it is. v1.0.0 contained a workaround for a GLFW bug related to borderless windows on Windows. However, my friend, who had asked me to create this mod, complained that it performed worse on their PC than a "beta" I had given them, which didn't have that "fix" implemented yet. So, I rushed to remove it.

However, it turned out that the issue wasn't with the mod. I guess it was just very unlucky timing, with Windows winding up its update services, telemetry, taking screenshots every two seconds, or whatever Windows does nowadays, when my friend tried to play the game. Sigh.

Scubakay commented 3 months ago

Allright, thanks for the help! I'll keep an eye on this mod for future updates!

(and yeah Windows is doing some crazy stuff!)

Kir-Antipov commented 3 months ago

You are always welcome!

Kir-Antipov commented 3 months ago

The issue is back. Or, to be more precise, it's never been properly fixed. It was "fixed" for a short amount of time, during which I resorted to using windowed mode for Windows users until I could find a way to snap the game window out of Windows' exclusive fullscreen, which causes flickering on focus change and other problems. The solution has been found, so the mod is back to using proper borderless fullscreen on Windows once again. However, this also means that the problem has re-emerged. Additionally, it was never resolved for Linux/macOS users, as they used true borderless fullscreen from the very start.

I had a theory that it has something to do with how CWB reports itself (i.e., as a non-fullscreen mode, since it's not the same fullscreen that Minecraft uses). However, after some testing, it seems that the issue only arises whenever you switch from one fullscreen mode to another. For example, ON -> Borderless and, more importantly, Borderless -> ON. Pressing F11 to toggle the current fullscreen mode, whatever it is, helps to solve the problem at hand.

I also tested this without Distant Horizons, and there are no problems with shaders, Iris, Indium, and Sodium on their own. So it's something very specific to Distant Horizons. Honestly, I would ask their developers what happens here and why their mod breaks whenever the game switches from one fullscreen mode to another, but not from windowed mode to the same fullscreen mode, as they know much more about their pipeline than I do.