krcroft wrote on 2020-01-07, 22:38:So instead of DOSBox internally scale=normal3x'ing and aspect=true'ing, we can pass the emulated video driver's raw 320x200 frame as-is to SDL2 and tell it to scale it to 1280x1000 (pixel perfect 4 x 5 scaling, texture or opengl nearest-neighbour), rendered unstretched to the screen's native or current desktop resolution (either fullscreen or a window sized to match).
Ant_222 wrote on 2020-01-08, 14:33:Yes—and openglpp does exactly that in the current version of the patch, as does bladesk.
it has been a while since I've toyed with the pp scaling - long enough for me to forget how it works
so I wanted to test the described behaviour with ECE r4301, using these 3 scenarios:
#1 : dos prompt @640x400
#2 : doom demo @320x200
#3 : quake demo @640x480
this is the relevant content of my config file:
machine=svga_s3
output=openglpp
fullscreen=false
fullborderless=false
fullresolution=desktop
windowresolution=desktop
aspect=true
scaler=none
these are the results when using a display set to a HD (720p) resolution:
640x400 (16:10) => upscaled (1x1) to 640x400 (16:10) => presented as 640x400 (16:10)
320x200 (16:10) => upscaled (3x3) to 960x600 (16:10) => presented as 960x600 (16:10)
640x480 (4:3) => upscaled (1x1) to 640x480 (4:3) => presented as 1280x960 (4:3)
these are the results when using a display set to a FHD (1080p) resolution:
640x400 (16:10) => upscaled (2x2) to 1280x800 (16:10) => presented as 1280x800 (16:10)
320x200 (16:10) => upscaled (4x5) to 1280x1000 (32:25) => presented as 1280x1000 (32:25)
640x480 (4:3) => upscaled (2x2) to 1280x960 (4:3) => presented as 1280x960 (4:3)
these would be the results (I'm unable to test in 4K) when using a display set to a UHD (2160p) resolution:
640x400 => upscaled (5x5) to 3200x2000 (16:10) => presented as 3200x2000 (16:10)
320x200 => upscaled (8x10) to 2560x2000 (32:25) => presented as 2560x2000 (32:25)
640x480 => upscaled (4x4) to 2560x1920 (4:3) => presented as 2560x1920 (4:3)
am I right in saying that basically openglpp:
- ignores the "aspect" setting
- performs only integer scaling
- avoid using scaling multipliers that would lead to an upscaled resolution bigger than the current display resolution
I also wonder if it would be possible to make it behave like this:
1) get the raw frame from the video driver
2) choose scaling multipliers that would: A) perform integer scaling, B) enable aspect ratio correction, C) upscale to a resolution bigger than the display
3) upscale the frame to a offscreen render target, using the chosen scaling multipliers
4) downscale the resulting frame to the size defined in fullresolution/windowresolution
the new behaviour would be, for both HD and FHD displays :
640x400 (16:10) => upscaled (5x6) to 3200x2400 (4:3) => presented as pillarboxed at desktop resolution (16:9)
320x200 (16:10) => upscaled (5x6) to 1600x1200 (4:3) => presented as pillarboxed at desktop resolution (16:9)
640x480 (4:3) => upscaled (5x5) to 3200x2400 (4:3) => presented as pillarboxed at desktop resolution (16:9)
the new behaviour would be, when using UHD displays :
640x400 (16:10) => upscaled (5x6) to 3200x2400 (4:3) => presented as pillarboxed at desktop resolution (16:9)
320x200 (16:10) => upscaled (10x12) to 3200x2400 (4:3) => presented as pillarboxed at desktop resolution (16:9)
640x480 (4:3) => upscaled (5x5) to 3200x2400 (4:3) => presented as pillarboxed at desktop resolution (16:9)