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

Artifacts on fullscreen toggle #282

Open
zzaba opened this issue Mar 10, 2021 · 3 comments
Open

Artifacts on fullscreen toggle #282

zzaba opened this issue Mar 10, 2021 · 3 comments

Comments

@zzaba
Copy link

zzaba commented Mar 10, 2021

Start the game and pause
1
Press F11 (enter fullscreen)
2
Press F11 (exit fullscreen)
3
Press F11 (enter fullscreen again, if the issue did not reproduce, press F11 some more)
4

More artifacts:
2
5
1
6
7

@Akaricchi
Copy link
Member

It's a known issue, I haven't fixed it yet just because it's pretty minor and "harmless".

It happens because we render the background frame once the pause menu is entered and simply store it in a texture without updating it. The texture is automatically resized (re-created actually) when the window is resized, and its contents remain undefined until we render the game scene again. So what you see there is whatever garbage ends up in that uninitialized region of GPU memory.

Possible solutions are to detect the resize and re-render the game scene into the new texture when it happens, or to stop automatically resizing the texture (just create a new one every time we pause, and destroy it when we unpause). The later case is a bit simpler, but it implies a small and temporary image quality loss after resizing the window, since the texture will be rendered with a scaling factor. The whole thing is blurred anyway though, so it probably won't be noticeable at all.

@zzaba
Copy link
Author

zzaba commented Mar 17, 2021

What should I do if I want to contribute to fixing this issue?
Shall I make a pr on some existing branch or create a new one (if so, what should I call it)?
It would be nice if you added some info about contributing to the project!

@Akaricchi
Copy link
Member

@zzaba

You have to fork the repository first, if you haven't already. Create a new branch based on master; you can call it whatever you want, but ideally the name should be short and descriptive of the changes you're making, e.g. fix-pause-artifacts. Once you have something to show, create a pull request.

If you need any help with navigating and/or hacking on the codebase, join our discord and feel free to ask us anything.

@StarWitch StarWitch changed the title Artifacts on fulscreen toggle Artifacts on fullscreen toggle Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants