libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.86k stars 1.78k forks source link

[Feature Request] Underlay option for Backdrops/Bezels/Backgrounds #15138

Open Smelltastic opened 1 year ago

Smelltastic commented 1 year ago

Currently, the Overlay option is commonly used for backdrops and bezels, typically to fill out the empty space surrounding the play area when a game's aspect ratio doesn't match the host system, or when integer scaling is used. This proves there is some demand for the ability to fill that space with a custom image. As the Overlay feature wasn't originally intended for this purpose, a good amount of effort has to go into making backdrop images conform to its requirements without obscuring the play area.

Host system resolution, original system resolution and its aspect ratio, and integer scaling all need to be taken into account to generate a unique image for each combination of these variables. On top of this, if the user is using the overlay function for its original intent (i.e. to play on a touchscreen), they cannot use this feature for bezels simultaneously.

I propose that a separate option for "Underlays", independent of the current Overlays, is warranted. Such a feature could let the user choose any arbitrary image, and it would be used to fill the screen borders while remaining under the gameplay area. The image could be specifically sized to work well on the target host and emulated system, but it should be functional without obstructing the gameplay area even if not.

Searching Retroarch's issues history, I could see several issues and feature requests driven by users retrofitting bezels onto the existing Overlay feature. I could not find anyone requesting underlays/backdrops separately (though I may have missed it somewhere).

Here's how I would propose such a feature should work, by default:

-The user chooses any image similarly to how they choose Overlays currently.

-On game load, Retroarch loads that image and compares the resolution to the current screen resolution (the physical system, not the emulated one). If necessary, Retroarch then resizes the image, maintaining aspect ratio, such that one dimension is the same size as the current screen, and the other dimension is the same or larger. I.E. a 640x480 image on a 1920x1080 host would scale up to 1920x1440; a 2880x2160 image would also be resized down to 1920x1440.

-Then that image would be center-cropped to fit the screen. The example image would crop off the top and bottom 180 pixels for a clean non-stretched 1920x1080 backdrop.

-The gameplay area, menus, and anything else would display on top of that backdrop; the image should always be on the bottom. If the user toggles integer scaling off, for example, the backdrop would be obscured by the game, rather than the other way around.

Possibly, the user could be given the option to stretch the image instead of cropping, in case the edges of the image are more important to them than maintaining the aspect ratio. An option to letterbox the image instead of cropping doesn't seem necessary to me, since that'd defeat the only purpose I can think of for having the feature.

I apologize if this has been brought up before; I did search the Issues list and couldn't find any similar requests. I know a lot of work has been done specifically with the Bezel project, and was a little surprised I didn't see this brought up previously. I intentionally put all the relevant search words I could think of in the subject, so if anyone considers bringing it up in the future hopefully they can find this.

sanviler commented 4 weeks ago

I would love such feature to be implemented. Thumbs up!