taisei-project / taisei

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

Minor WebGL/Emscripten resolution issue #297

Open StarWitch opened 3 years ago

StarWitch commented 3 years ago

The Emscripten build is mostly looking good, but there's a couple of issues I've noticed with the resolution setting:

  1. At launch, the default resolution has the game go off the screen. This can be fixed by accessing settings and manually changing the resolution (somewhat). (See 1st screenshot.)
  2. When changing the resolution, the available settings seem a bit limited, and the default ones available tend to make the game pretty small on the screen. (See 2nd screenshot.)
  3. Flipping "Fullscreen" on and off tends to not work, and/or distort the display area of the game. Basically, it seems to lock to resolution to the "overscanned" behaviour of the first screenshot permanently. It might be worth disabling that for WebGL and letting the browser itself handle fullscreen.

Screenshots are of Safari on macOS (with the "experimental" WebGL 2.0 extension enabled), but the behaviour is the same on iPadOS, and also with Firefox on macOS. I also tested with Firefox on Ubuntu and it seemed to have the same behaviour.

Again, these are pretty minor issues, and the game plays fine otherwise (even on iPad!).

image image
Akaricchi commented 3 years ago

1 and 2 may be a high-DPI UI scaling specific problem. Have you tried it on a low-DPI/unscaled display? I couldn't reproduce it without scaling on both Chromium and Firefox (Linux, Wayland); haven't tried scaling yet.

Fullscreen seems to work fine for me in Chromium, but has a really weird tri-state behavior in Firefox. It feels like the game and the browser both try to interpret the F11 key and conflict with eachother.

It might be worth disabling that for WebGL and letting the browser itself handle fullscreen.

Might be a good idea, but requires writing some JS to detect fullscreen and size the canvas appropriately & inform the game. Not high on my priority list for now, so patches welcome.