libretro / RetroArch

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

[Feature Request] Zoom option (for letterbox games) #4158

Open SomeoneIsWorking opened 7 years ago

SomeoneIsWorking commented 7 years ago

Some games are letterbox and 4:3 which makes causes both vertical and horizontal black bars wasting screen space. If there was a configurable zoom option in menu which would resize the game window by X percent, user could scale the game into fitting the window. This of course would preserve the aspect ratio

Normal screenshot 1

X1.11 zoom screenshot 2

This is of course best used when combined with game config overrides

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39748021-feature-request-zoom-option-for-letterbox-games?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github).
Awakened0 commented 7 years ago

Right now you can do this in Mednafen cores with the Initial and Last scanline core options, but the aspect ratio isn't automatically adjusted so the image is stretched vertically. I have to do 320/(240-X), where X is the amount of scanlines I cut off, to get the decimal to use as the custom aspect in my per game configs. PSX games are pretty annoying because so many games have a different amount of active scanlines.

SomeoneIsWorking commented 7 years ago

Yea, I figrued each game has it's own black borders so there isn't much can be done about them automatically but maybe with a zoom feature, I can make overrides for games I play in a few seconds

Awakened0 commented 7 years ago

Yeah, I think a zoom feature would be easier to configure. Since it'd be at the frontend level, it'd work for cores that don't have scanline cropping options like the N64 cores too.

SomeoneIsWorking commented 7 years ago

Tried to add it myself but couldn't compile RA under windows, seems like final g++ -o retroarch command of make exceeds command line character limit under windows because I was getting a error on a path but it was truncated

Awakened0 commented 7 years ago

I haven't succesfully compiled RA in a few years, but maybe this guide will get you there: https://github.com/libretro/docs/blob/master/docs/compilation/windows.md

The msys2 installer link isn't working, but it's easy enough to google: https://msys2.github.io/

andres-asm commented 7 years ago

https://bot.libretro.com/docs Compilation Guide there on the sidebar

On Tue, Dec 6, 2016, 4:27 PM Awakened0 notifications@github.com wrote:

I haven't succesfully compiled RA in a few years, but maybe this guide will get you there: https://github.com/libretro/docs/blob/master/docs/compilation/windows.md

The msys2 installer link isn't working, but it's easy enough to google: https://msys2.github.io/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/libretro/RetroArch/issues/4158#issuecomment-265277793, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpC0LEDadS7yYvpkq_-9kAq1r4zVjrhks5rFdNRgaJpZM4LDnr_ .

SomeoneIsWorking commented 7 years ago

I tried the guides with msys2 somewhere it just says something like g++ file not found obj-unix/./libretro_comm It's supposed to be libretro_common/something but it's cut short

andres-asm commented 7 years ago

The guide I posted is what we use for every build and it is working and verified. MSYS2's prompt doesn't cut stuff, it moves to the next line so no idea of what could be truncated.

I can try to help you as long you paste a build error.

Awakened0 commented 7 years ago

I will note that by setting the aspect ratio index to "Custom" and increasing the viewport x and y values you can zoom already. But that can be fiddly since you're setting the aspect yourself based on how much you increase the x and y. It's also resolution dependent, so if you move to a higher or lower res display you need to mess with the values again.

If you can code a zoom option that increases the x and y by a percentage that respects whatever aspect ratio is set and doesn't require retweaking at different resolutions, that'd be pretty slick.

andres-asm commented 7 years ago

can't this be done with the image-adjustment shader and game presets? it's way less invasive than overrides too

Awakened0 commented 7 years ago

Maybe. It can be hard to figure out how to combine that with multi-pass shaders sometimes. I like having the ability to use the shader hotkeys to swap between easymode-halation and pixellate; I don't know how I'd rig that up if I had per core and per game shader presets set up instead of using scanline cropping overrides.

Awakened0 commented 7 years ago

I got image-adjustment working as a first pass with easymode on top of it. That shader's zoom function does some uneven scaling that looks pretty bad. Turning on linear filtering for that pass doesn't look good either. Cutting off scanlines with core options or using a custom viewport with integer scaling enabled look much better. Not sure if you could do a zoom function as good or better than those methods.

SomeoneIsWorking commented 7 years ago

I adjust with x/y offset + width/height for now but I use different resolutions on TV and Monitor so it becomes a problem

Here is my build issue by the way image

My idea of zoom was to be applied on top of viewport like

zoomed_viewport.x = viewport.x - (zoom-1)*viewport.width/2
zoomed_viewport.y = viewport.y - (zoom-1)*viewport.height/2
zoomed_viewport.height = viewport.height*zoom
zoomed_viewport.width = viewport.width*zoom
Ryunam commented 4 years ago

Bringing this up again, since I have recently stumbled on the same issue as in the example posted by @needo2. It would be very convenient to have an option under Settings -> Video that does not depend on desktop resolution and / or the use of shaders, enabling the user to zoom in the image at preference while keeping the core-provided aspect ratio intact.

cgarz commented 3 years ago

Right now you can do this in Mednafen cores with the Initial and Last scanline core options, but the aspect ratio isn't automatically adjusted so the image is stretched vertically.

This doesn't seem to be the case. At least for me with the current Beetle HW core. The aspect ratio stays the same and the bars on the left and right also shrink. In fact, depending on the game the cropping required can be so severe that it nearly fills out my 1080p 16:9 TV all the way to the edges :laughing:

But yes, an easier option for this issue is sorely needed. Especially on cores without the handy scan line options. Perhaps even a way to auto detect it could be created. Though you would probably need to ensure the current scene was bright all the way to the edges of the output. Still though, thats much less hassle than what we have to currently do.

Awakened0 commented 3 years ago

Well, I posted that in 2016 and yeah, it was fixed ages ago :P

The DuckStation and SwanStation cores have similar cropping features that respect the aspect ratio too.

It would still be useful to have zoom cropping on the frontend side so core authors didn't have to add core options for it. Seems like it's trickier to do there with nice looking scaling though.

Jimmy-Z commented 2 years ago

I would want this too, I was playing Castlevania SOTN recently on OGA, it has huge black borders top and bottom, and the device had a 3:2 screen, so black borders on all 4 sides, and the only PSX core this device is capable is pcsx-rearmed which unfortunately doesn't have custom cropping.

hizzlekizzle commented 2 years ago

In the case of the OGA, it doesn't have enough pixels on its screen for zooming to be worthwhile. That is, if you cropped off the borders and zoomed to fit, you would have a mess of doubled/dropped pixels that would make text, for example, nearly unreadable.

Jimmy-Z commented 2 years ago

With bilinear filtering(or RGA scaling), it is blurry but definitely not unreadable, less black border means more effective pixels.

BTW this game runs at 256*240 with 20/13 lines of black borders on top/bottom, in duckstation set 12/-5 for "display line start/end offset".

asoderq commented 2 years ago

Zoom option would be great!