PabloMK7 / citra

A Nintendo 3DS Emulator
GNU General Public License v2.0
2.96k stars 573 forks source link

Add "Picture-in-Picture" Screen Layout Option #96

Open garrettm4 opened 2 months ago

garrettm4 commented 2 months ago

Is there an existing issue for this?

What feature are you suggesting?

A "Picture-in-Picture" (PiP) screen layout option (as commonly see on TVs) would allow full-screen integer scaling of the "main" screen while also showing non-critical information on the "secondary" screen as a small overlay. This option makes better use of full-screen area than the current "Large Screen" option which resizes the main screen (breaking integer scaling) to make room for the smaller secondary screen. For displays that have a larger aspect ratio than the 3DS (e.g. 16:9 and so on), the PIP overlay can be tactically placed at the top right or left corner of the display to minimize coverage of the main screen.

Additionally, the secondary screen PIP overlay can be rendered at a much smaller resolution the the main screen, thereby saving GPU and CPU resources. Say 1x or 2x native resolution (or 0.5x steps) for the secondary screen vs. 9x for the main screen when gaming on a 4k display.

Currently, a sudo PiP setup can be done using the "Separate Windows" screen layout option and setting the secondary window to "Always on Top" (in Gnome) and scaling it to a comfortable mini-map sized area:

sudo_pip

For comparison, we have the "Large Screen" option that breaks integer scaling / full-screen coverage of the main screen when placing the secondary screen next to it.

large_screen

Why would this feature be useful?

A Picture-in-Picture screen layout mode would improve full-screen game play and make better use of letter-boxing area on displays with a higher aspect ratio than the 3DS. It is (arguably) a general improvement over the Large Screen layout option since it avoids breaking integer scaling and maximizes the use of available area on a given display. Finally, it could lead to the reduction of GPU and CPU usage through the use of reduced resolution for the secondary screen PiP overlay, thereby improving game play and runtime on mobile devices and older hardware.

Hiroex commented 2 months ago

You can use the hidden custom layout feature by editing qt-config.ini to achieve a similar effect. The bottom screen can be any size and anywhere you want. This is for 4K monitors with a similar layout to the one you suggested.

custom_layout\default=false
custom_layout=true
custom_top_left\default=false
custom_top_left=120
custom_top_top\default=false
custom_top_top=0
custom_top_right\default=false
custom_top_right=3720
custom_top_bottom\default=false
custom_top_bottom=2160
custom_bottom_left\default=false
custom_bottom_left=0
custom_bottom_top\default=false
custom_bottom_top=0
custom_bottom_right\default=false
custom_bottom_right=640
custom_bottom_bottom\default=false
custom_bottom_bottom=480
garrettm4 commented 2 months ago

@Hiroex, thank you! I had no idea I could set a custom screen layout. This works great except I cannot get the "custom_second_layer_opacity" to change the bottom screen's opacity. Is this option for something else? It would be nice to set the opacity of the smaller screen when doing a PiP setup. Either way, I can always reposition the smaller display so it doesn't interfere with the game's menu and dialog placements.

Thanks again!

custom_layout

rtiangha commented 2 months ago

I think that opacity option only works for OpenGL (or Vulkan; one of them anyway, if at all).

garrettm4 commented 2 months ago

@rtiangha, thanks. I'm using Vulkan with a Radeon 7600, so it must only work for OpenGL. For some reason I can't select which GPU to use when using OpenGL (defaults to my iGPU), Vulkan on the other hand lets me choose between the iGPU or dGPU.