-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extreme Stuttering While Using Shaders In Borderless Fullscreen #40
Comments
First of all, thank you so much for providing such a detailed bug report! And I really appreciate the extra effort you put into recording and editing a video to demonstrate the issue, big preesh for that! Based on the recording, it seems that the game itself doesn't stutter. Instead, the issue appears to be with how the game window is displayed on your system. Here's my working theory: your system might be under heavy load (welp, playing with shaders while also recording that can definitely be taxing on your PC :D). Since Windows doesn't recognize Minecraft as a fullscreen application, it may not give the game the priority it needs to run smoothly. As a result, the Windows compositor may occasionally miss V-Sync buffer swaps, leading to inconsistent frame times and visible stutters, because you basically see lots of the frames twice. This effect can be especially pronounced if you're using a high refresh rate monitor, like one running at 120-144Hz or higher. For now, you can address the issue by changing the borderless fullscreen mode used by CWB from So, would you mind testing if manually adjusting Minecraft's process priority resolves the problem? Unfortunately, I can't provide screenshots on how to do that since I no longer use Windows, but here's a somewhat step-by-step guide:
If this resolves the issue, I'll make sure that Minecraft automatically sets its priority a bit higher when running in borderless fullscreen mode, so Windows treats it as more than just another generic window. |
I'm familiar with how to change priorities haha, but 'ppreciate the guide nonetheless. Here's what I got: Setting the priority to high (while using the default borderless fullscreen type) did not help as far as I can tell, but setting the borderless fullscreen type to It's worth noting that I have a fairly beefy PC so while it's true that playing with shaders and recording simultaneously could be taxing on my PC, it should definitely still be able to run smoothly. If playing in regular fullscreen and borderless fullscreen changes how Windows prioritises the game though, it would explain why there's an extreme difference between the two. |
Well, you never know (and shouldn't assume) how tech-literate the person on the other side of the monitor is :)
Sigh, I was really hoping it would be as easy to fix as
Just out of curiosity, does
Oh, absolutely - it's not about your PC being able to run the game smoothly at all (as we saw in your recording, it actually performs quite well by itself). The issue is more about how the system prioritizes certain actions over others and the order in which those actions end up being executed. |
Could you please download the patched mod version from https://github.com/Kir-Antipov/cubes-without-borders/actions/runs/12069230075, so we can definitively determine whether changing the priority - both thread- and process-wise - has no impact on the issue, or, hopefully, resolves it in the end of the day? |
Yeah I gotcha haha, my bad if that came off as rude or anything. 😅
Yup! It doesn't seem as though there's any stuttering while using the (Actually, Anyhow, I'll test the patched mod version now, gimmie a moment... |
Oh, don't worry, it absolutely did not! :)
Great! Unlike On the other hand,
I'm aware of that issue, and I even submitted a PR to obsproject/obs-studio (since it's technically an OBS bug) a few months ago. However, it still hasn't been merged. |
I've been experimenting for a few minutes, and it would seem as though the patched mod version does help. It still doesn't feel quite as smooth as the vanilla fullscreen mode, but maybe that's just me - at the very least, it's definitely playable. It's worth noting that up until now, I've mainly been using 1.21.1 to test, partly due to the fact it's my primary version, and partly due to the fact that's where I've found the stuttering to be more significant - I'm only now realising that the mods I listed in the original comment were the 1.21.3 versions so that's on me. Either way, I tested the patched mod version on both 1.21.3 and 1.21.1 just to be sure, and it appears to help a lot on both. |
Interesting, I honestly just always assumed that it was something that came naturally "due to how borderless fullscreen works" or something, hence never reporting it. It's not difficult to make OBS capture a specific window so it's not a major issue anyway haha - good to know though! (And, yes, Discord is one of the primary reasons I use borderless fullscreen xD) |
Yay! Thanks for testing this out! I think setting only the thread priority through Task Manager didn't help because, according to the Win32 documentation, setting Technically, if the game still doesn't run smoothly, we could try pushing it a bit higher, within the
No worries! If it weren't for Forge/NeoForge, there would be a single mod version for all 1.21.x releases. :D So, it doesn't matter that much.
OBS searches for fullscreen windows by strictly comparing their edge coordinates to those of a monitor. And in some edge-case scenarios, like the one I need to rely on here, this doesn't really work.
Welp, sadly, |
Sure thing, how exactly would I do that? Would I need another link from you, or is that something I change via task manager? |
Thanks a lot! Once this workflow - https://github.com/Kir-Antipov/cubes-without-borders/actions/runs/12072732079 - finishes building the mod, please check if the higher base priority improves things and whether your system remains responsive overall. As a word of caution, since I'm unsure if setting a priority of 24/31 is too high for a graphical app, please, save all your important work beforehand. If Minecraft takes precedence over your mouse/keyboard, you might need to reboot your PC :D |
This definitely appears to be the smoothest version so far - if the priority being as high as it is becomes a risk to things like the keyboard and mouse, I do think the previous version would still suffice, but in my case, my keyboard and mouse were fine, and the stuttering was greatly reduced so that's a plus. That being said though, I also just tested the latest release of the mod again to compare the difference, and I'm weirdly unable to reproduce the original stuttering. I have changed absolutely nothing since creating this issue so now I'm just utterly confused - typically the lack of stuttering would be a good thing, but the release suddenly working now has me questioning whether the increased prioritiy is actually making a difference, or if my PC has somehow disregarded the issue altogether - do you have any ideas as to why that could be the case? I apologise for the confusion, but I myself am super confused as to why the stuttering has just randomly... vanished. 🤦♂️ |
Awesome! Then I'm gonna leave it at that.
It's not that this priority value poses a risk (if it works, it works); the issue is that I don't know which one does, because Microsoft's documentation is historically pretty mid. It provides just enough information to give you a basic understanding of what's going on, but not nearly enough to cover all the important details. Take this case, for example: they specify that system interrupt processing occurs somewhere within the Anyways, my interpretation is that the
More likely than not, these are typical Windows shenanigans. When Windows runs background tasks - like sending user data to advertisers or downloading/applying updates - these processes are given absurdly high priority over everything else, because Windows consistently prioritizes its own operations over the user's work. This was one of the many reasons I moved away from Windows, even before privacy concerns became a significant enough issue for me. I suspect Windows was doing something update-related in the background, as these tasks are notoriously resource-intensive, so lower-priority processes - like a humble Minecraft window - were likely getting throttled a bit. However, once Windows finished whatever it was doing, the issue disappeared, and so you stopped experiencing those horrible stutters even without the priority fix. Whatever it was, it's bound to happen again and will almost certainly affect other players too. So, thanks a lot for bringing this to my attention regardless! :) |
No worries - glad I was able to help! :) |
Hey - very sorry to bring this back, but as of just a few minutes ago, the stuttering has decided to return. Again, I've changed absolutely nothing as far as I'm aware, but I'm now realising that the higher priority build you asked me to test before isn't making a significant difference. I figured you should be aware of this before next updating the mod as I'm now unsure whether this issue is actually resolved or not. I really don't have any new details here - who knows what Windows is running in the background, but I can say I'm using the exact graphics drivers, Minecraft version, mods and shaders so I'm a little clueless as to why the stuttering keeps appearing and disappearing. If there's anything else you'd like me to test, just let me know! |
Thanks a lot for the notice! Welp, it's a shame, I really hoped this would solve the issue. If it's not a priority thing, could we be looking in the wrong place? Is there anything else you're doing on your PC when these stutters occur? The only other time I saw something similar (though to a much lesser degree), the person was also using OBS to record their gameplay. Maybe there's a connection there? |
When the stuttering returned yesterday, I don't believe I even had OBS open. Even so, I just put that to the test, and the stuttering is still there when the only open app (at least on my taskbar) is Minecraft. As far I know, nothing is changing between my multiple tests, but of course, anything could be happening in the background that I'm not aware of. Here's an interesting discovery I made while typing this comment though - the lower I cap my FPS, the less apparent the stuttering seems to be. This is extremely tempremental, it's hard to say what does or doesn't fix the issue, but the lower the cap, the more smooth the gameplay seems to be, at least for a while. Could this have anything to do with it? 🤔 |
I'll expand on this:
I thought this was interesting as you earlier mentioned inconsistent frame times and visible stutters being more apparent on higher refresh rates, and I typically play with uncapped FPS on a 240hz monitor. That being said though, moving the Minecraft window to my other monitor, which has a slightly lower refresh rate, or even lowering my refresh rate via display settings, does not help. I wouldn't really know if this information is relevant or not, but I figured I'll tell you everything I know, and maybe something here will spark your interest. ¯\_(ツ)_/¯ |
Never mind, the stuttering/low frame rates came back |
While using shaders and borderless fullscreen at the same time, the game appears to frequently stutter. This has been tested, and is reproducable, using the latest Cubes Without Borders version on both Minecraft 1.21.1 and 1.21.3. Any ideas as to why this is happening?
Further Details
Mods List
CWB.Issue.mp4
The text was updated successfully, but these errors were encountered: