Project-Pandora-Game / pandora

https://project-pandora.com
Other
11 stars 3 forks source link

[FEATURE] Multiple texture resolutions support #768

Closed Jomshir98 closed 4 months ago

Jomshir98 commented 4 months ago

Depends on pandora-assets#242.

Adds a support for using down-scaled textures. At the moment resolutions 1 (no change), 1/2, and 1/4 can be selected. This applies to normal assets, room devices and room backgrounds; no matter which screen uses them (both room and wardrobe).

There is also an option for "auto", which tries to guess best resolution automatically (might need tweaking in the future). This is the default. It works by looking at the true pixel size of the screen (so window size multiplied by DevicePixelRatio (a.k.a. factional scaling). It is tuned such that PC FHD (1080p) screen gets 1/2 resolution (it still looks rather good!), but QHD (1440p) gets full resolution. For phones the logic works the exact same. To be specific there are thresholds for both width and height, combined with an 'OR'. The automatic resolution is remembered and reused the next time. The screen is also observed for changes and the resolution might get automatically upgraded if the window is resized. It is never downgraded automatically.

Jomshir98 commented 4 months ago
  1. It covers zoom in the sense that it was tested with "The whole screen is focused on a one character" - so zoom to the level of whole character still being visible.
  2. I will check that, it might need some changes.
Jomshir98 commented 4 months ago

Fixed the editor - the editor now always forces full resolution for autodetection.