taisei-project / taisei

A free and open-source Touhou Project fangame
https://taisei-project.org/
Other
959 stars 88 forks source link

Artifacts on fullscreen toggle #282

Open zzaba opened 3 years ago

zzaba commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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.