Page 3 of 3

Re: Option to change aspect ratio of menu background images

PostPosted: Sun Mar 15, 2020 6:02 am
by Nash
@ Graf: someone was puzzled about this addition because apparently "widescreen images have always worked" for them.

It turns out that said person was using a 1920x1080 TITLEPIC replacement, which doesn't squash the image to 4:3.

I downscaled the image to 356x200 and the picture gets squashed.

Was it meant to be like that? As in, if the image is high res, it doesn't get squashed?

Re: Option to change aspect ratio of menu background images

PostPosted: Sun Mar 15, 2020 8:53 am
by Graf Zahl
I never added such a thing so I cannot say.

Re: Option to change aspect ratio of menu background images

PostPosted: Sun Mar 15, 2020 9:23 am
by Nash
I won't be surprised if said mod was relying on undefined behaviour/code then.

Re: Option to change aspect ratio of menu background images

PostPosted: Mon Mar 16, 2020 2:40 pm
by Tormentor667
Graf Zahl wrote:Aaaand...
It's finally done. :)


Awesome :) Is there already a wiki entry describing how it is implemented or defined?

Re: Option to change aspect ratio of menu background images

PostPosted: Wed Mar 25, 2020 11:39 pm
by Matrix
Glad this has been resolved.

Is there a specific setting to enable it though?

I downloaded the most recent GZDoom release and the behavior appears to be the same as previously.

When I have the "video mode" settings set to 16:9 forced aspect ratio and 1920x1080 pixel scaling the initial start menu and stat screens between levels backgrounds still have black bars.


Also, when did the settings font get changed? Is there a way to change it back to the DOOM font?

Thank you.

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 3:11 am
by drfrag
You need a GAMEINFO flag:
Code: Select allExpand view
Due to backwards compatibility needs and for flexibility this needs to be controlled by a gameinfo setting (fullscreenautoaspect):

0: Treat all images as having an aspect ratio of 4:3, this is the default for compatibility reasons
1: Scale all images to fit the screen, i.e. either pillarbox or letterbox them.
2: Scale all images to fill the screen.
3: Scale all images so that the center 4:3 area is always fully visible. This is the recommended mode for 16:9 images designed to be shown with the sides being cropped on narrower displays.

And wide pics of course, and a recent devbuild.
About the generic font, since 4.0.0 i believe. LZDoom still uses the Doom font.

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 3:22 am
by Gez
Question: does the "center 4:3 area" take aspect ratio correction into account or not?

Because technically a 21:9 at Doom's resolution will be 560x200 stretched to 560x240. But if aspect ratio correction is not taken into account, the 4:3 area in the image will be detected to be 266⅔x200.

We might need additional fullscreenautoaspect values for this.

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 2:57 pm
by Matrix
drfrag wrote:You need a GAMEINFO flag:
Code: Select allExpand view
Due to backwards compatibility needs and for flexibility this needs to be controlled by a gameinfo setting (fullscreenautoaspect):

0: Treat all images as having an aspect ratio of 4:3, this is the default for compatibility reasons
1: Scale all images to fit the screen, i.e. either pillarbox or letterbox them.
2: Scale all images to fill the screen.
3: Scale all images so that the center 4:3 area is always fully visible. This is the recommended mode for 16:9 images designed to be shown with the sides being cropped on narrower displays.

And wide pics of course, and a recent devbuild.
About the generic font, since 4.0.0 i believe. LZDoom still uses the Doom font.


Thanks. I will wait for this to make it's way to a public build then.

Are there plans to implement this in LZDoom as well?

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 4:15 pm
by Chris
Gez wrote:Question: does the "center 4:3 area" take aspect ratio correction into account or not?

Because technically a 21:9 at Doom's resolution will be 560x200 stretched to 560x240. But if aspect ratio correction is not taken into account, the 4:3 area in the image will be detected to be 266⅔x200.

We might need additional fullscreenautoaspect values for this.

This would definitely be relevant to the Nash's widepix project. If they take the original 320x200 (5:4) image and extend the sides so it's 560x200, will the center 320x200 pixels still fill a 4:3 display (with the full image fitting a 21:9 display despite being 14:5)? Or would it need to be stretched to 560x240 for the 320x240 pixels to fit a 4:3 display and the whole thing to fit a 21:9 display?

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 4:21 pm
by Nash
There's an open ticket for this right now. I'd typically expect it to work like this: if you have a very wide picture (say 560) open in Photoshop, but the canvas is only 320 at first. There's a bunch of hidden content that's outside of the canvas borders. Then when I extend the canvas to 426 (16:9), some of the hidden content is shown. And when I extend the canvas to 560 (21:9), even more content is shown. I expected it to just reveal the parts outside of the current frame without modifying the "center portion".

However, what's really happening right now is it's doing some scaling that I don't understand the inner workings of.

viewtopic.php?p=1141919#p1141919

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 4:42 pm
by Chris
Nash wrote:However, what's really happening right now is it's doing some scaling that I don't understand the inner workings of.

viewtopic.php?p=1141919#p1141919

That does appear to be roughly in-line with what I'd expect from not considering the original aspect ratio. The original 320x200 image is normally "corrected" to fit a 320x240 area. Without that correction, it appears squished vertically or stretched horizontally. Basically, you're taking the original 320x200 (5:4) image and extending the sides so it's 560x200 (14:5), and that is then scaled up to fill the screen maintaining the image's 14:5 aspect ratio. The engine would have to apply the correction (stretch the 560x200 image to fit a 560x240 area, i.e. 14:5 -> 21:9) to make it appear correct.

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 5:09 pm
by Graf Zahl
The drawer only autocorrects 320x200 and 640x400. Everything else gets used in its native aspect ratio.

Re: Option to change aspect ratio of menu background images

PostPosted: Thu Mar 26, 2020 5:12 pm
by Gez
So could there be a mode that's basically 3 + vertical stretching by 20%; or should TEXTURES be used to rescale all images first?

Re: Option to change aspect ratio of menu background images

PostPosted: Fri Mar 27, 2020 12:58 am
by Graf Zahl
I think with a height of 200 we can generally assume that it needs to be stretched. For anything higher, even 400, I wouldn't.