[CODE SUBMISSION] Choosing/forcing Aspect Ratio
Moderator: GZDoom Developers
[CODE SUBMISSION] Choosing/forcing Aspect Ratio
This would be similar to the vid_nowidescreen, but it would be more complete.
With vid_aspectratio (or vid_forceaspectratio), you could switch to 4:3, 16:9, 16:10, or 5:4 aspect ratio no matter what resolution you are running at.
This would help in the display of 640x480 resolution stretched on a 16:9 HDTV, where HD 16:9 resolutions are too resource-intensive.
With vid_aspectratio (or vid_forceaspectratio), you could switch to 4:3, 16:9, 16:10, or 5:4 aspect ratio no matter what resolution you are running at.
This would help in the display of 640x480 resolution stretched on a 16:9 HDTV, where HD 16:9 resolutions are too resource-intensive.
Last edited by phi108 on Sat May 16, 2009 9:07 pm, edited 2 times in total.
Re: Choosing Acspect Ratio
Many monitors have this feature built in. I know that mine does. With a quick dive into the men for the monitor, I can switch to using widescreen aspect ratios to 4:3 centred horizontally with black strips either side of the picture like a vertical version of letterbox view. Perhaps your monitor has something similar?
Re: Choosing Acspect Ratio
Yes, my TV can show 4:3 and 16:9, but this feature would squash a 16:9 view into a 4:3 resolution, so that when stretched to 16:9, it would look correct. With my TVs limited number of supported ratios, I can't play in widescreen on a low resolution.
- Chris
- Posts: 2969
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Choosing Acspect Ratio
I think it would still be nice to use a 4:3 fullscreen (non-letterbox) resolution on a widescreen monitor, with the engine handling the aspect ratio difference instead of stretching or rendering that many extra columns. My widescreen monitor seems to only have one or two widescreen modes, one of which is its native resolution of 1440x900, and all the rest are roughly 4:3. So you can't really use a lower resolution and maintain a square pixel ratio.. the engine would have to compensate. Many games can do this.Enjay wrote:With a quick dive into the men for the monitor, I can switch to using widescreen aspect ratios to 4:3 centred horizontally with black strips either side of the picture like a vertical version of letterbox view. Perhaps your monitor has something similar?
BTW, my monitor can't do a "vertical letterbox" mode. I have to set it as a graphics card option, and that basically uses the GPU to upscale the image and maintain the aspect ratio.
Re: Choosing Acspect Ratio
OK, I'm starting to get confused as to what we are talking about now. If it's resolutions that can be set via the in game menu, then Zdoom should make available all the modes available to the system. That wasn't what I thought we were talking about but now I'm not so sure.
Re: Choosing Acspect Ratio
I'm talking about changing the aspect ratio of the game without switching resolutions. So a wide 16:9 wiew could be squashed into 640X480 or 800X600, which would look correct if the picture was stretched by the display device.
Re: Choosing Acspect Ratio
Not all monitors support the functions you mentioned, Enjay.
For example, my monitor, if I choose 640x480, I'm stuck with a horizontally stretched screen, and there is no way around it. There are no options in my monitor's menu to force a letterbox mode or otherwise change the aspect ratio - it's stuck in widescreen no matter what I do. And even if I try to shrink the view horizontally, it's not enough to put it back at 4:3.
I really would like a feature like Phi mentioned; I don't ever expect it to happen based on the fact that he's suggested it before and it's never been implemented, but I would like it.
For example, my monitor, if I choose 640x480, I'm stuck with a horizontally stretched screen, and there is no way around it. There are no options in my monitor's menu to force a letterbox mode or otherwise change the aspect ratio - it's stuck in widescreen no matter what I do. And even if I try to shrink the view horizontally, it's not enough to put it back at 4:3.
I really would like a feature like Phi mentioned; I don't ever expect it to happen based on the fact that he's suggested it before and it's never been implemented, but I would like it.
Re: Choosing Acspect Ratio
OK, so I think that I am back on track with what the request is.
Basically, the request is to have an option in the set video mode menu (or somewhere) to force Zdoom to occupy a 4:3 space centred in the middle of the monitor. Presumably the vertical dimension will be set to fit whatever the height of the monitor is but the horizontal value will be only as big as a 4:3 ratio would allow, with something like black strips padding out the sides to the edge of the monitor? (ie the vertical letterbox that I mentioned.)
If so, that is indeed what I can get my monitor to do using its own setup. On checking the other two widescreen monitors that I have though, my one is the only one that allows it as far as I can tell.
Here's a photo of my monitor running GZdoom at 1024x768 forced into 4:3 ratio using the menu. The monitor itself has a 16:10 ratio.

Is that the kind of thing you want Zdoom to be able to do internally?
Basically, the request is to have an option in the set video mode menu (or somewhere) to force Zdoom to occupy a 4:3 space centred in the middle of the monitor. Presumably the vertical dimension will be set to fit whatever the height of the monitor is but the horizontal value will be only as big as a 4:3 ratio would allow, with something like black strips padding out the sides to the edge of the monitor? (ie the vertical letterbox that I mentioned.)
If so, that is indeed what I can get my monitor to do using its own setup. On checking the other two widescreen monitors that I have though, my one is the only one that allows it as far as I can tell.
Here's a photo of my monitor running GZdoom at 1024x768 forced into 4:3 ratio using the menu. The monitor itself has a 16:10 ratio.

Is that the kind of thing you want Zdoom to be able to do internally?
Re: Choosing Acspect Ratio
Isn't that a feature on most recent graphics cards (GPU scaling)?
I have it turned on for the fullscreen games that simply don't have widescreen modes...
I have it turned on for the fullscreen games that simply don't have widescreen modes...
Re: Choosing Acspect Ratio
Looking at the NVidia control panel, yes that does seem to be something the card is supposed to be able to do. However, it doesn't seem to do it. regardless of which of the options I pick, things get stretched to the full screen unless I force 4:3 using the monitor.
The options I am supposed to have are:
NVidia scaling - scales everything to the monitor size
NVidia scaling with fixed aspect ratio - same as the effect you can see in my picture
Use display's scaling - let the monitor, not the GPU do the scaling
No scaling - program uses its original number of pixels. If its a 320x200 game, then it will appear as a tiny postage stamp in the middle of the screen.
My guess is that my monitor is overriding options 1,2 and 4 and scaling everything. I'll see if there is some way to stop it doing that. But you are right, it does seem to be a feature of recent graphics cards.
[edit] And having read around a bit, this is a common problem. It's an NVidia driver issue that appeared at least 2 years ago and which has not been satisfactorily addressed. It works for some people, but not for others. [/edit]
The options I am supposed to have are:
NVidia scaling - scales everything to the monitor size
NVidia scaling with fixed aspect ratio - same as the effect you can see in my picture
Use display's scaling - let the monitor, not the GPU do the scaling
No scaling - program uses its original number of pixels. If its a 320x200 game, then it will appear as a tiny postage stamp in the middle of the screen.
My guess is that my monitor is overriding options 1,2 and 4 and scaling everything. I'll see if there is some way to stop it doing that. But you are right, it does seem to be a feature of recent graphics cards.
[edit] And having read around a bit, this is a common problem. It's an NVidia driver issue that appeared at least 2 years ago and which has not been satisfactorily addressed. It works for some people, but not for others. [/edit]
Re: Choosing Acspect Ratio
Enjay, you're close, but not quite.
Here's the request:
Let's say I want to use 640x480 on my widescreen monitor. I don't want ZDoom to give me black bars - what I want is for ZDoom to call it a 16:10 mode, and scale things accordingly. Exactly how vid_nowidescreen works to force any widescreen mode into 4:3.
So I'm still wanting to use my full 640x480, but on my widescreen monitor which stretches it, the view will be scaled properly because ZDoom unstretches it.
Granted, it will look horribly ugly at 640x480, but at least it won't look odd.
Here's the request:
Let's say I want to use 640x480 on my widescreen monitor. I don't want ZDoom to give me black bars - what I want is for ZDoom to call it a 16:10 mode, and scale things accordingly. Exactly how vid_nowidescreen works to force any widescreen mode into 4:3.
So I'm still wanting to use my full 640x480, but on my widescreen monitor which stretches it, the view will be scaled properly because ZDoom unstretches it.
Granted, it will look horribly ugly at 640x480, but at least it won't look odd.
Re: Choosing Acspect Ratio
OK, this is clearly one of those simple concepts which, for some reason, I'm just not getting.SoulPriestess wrote:So I'm still wanting to use my full 640x480, but on my widescreen monitor which stretches it, the view will be scaled properly because ZDoom unstretches it.
See if this is it:
You want to run (for example) 640x480 on a widescreen monitor.
Your hardware would normally stretch this to the 16:9 (or 16:10) aspect of your monitor making everything wider looking than it should be.
What you want is an option for Zdoom to unstretch that wideness?
If so, and here's the bit I'm not sure about, how much of the screen would the 640x480 take up? The only way I can conceive of the image not looking stretched is if it narrows the image to occupy the middle part of the screen in a similar way to my photo. The image would still be 640 (or whatever) pixels wide, but those pixels would not occupy the whole width of the screen.
I know that me understanding the request is utterly irrelevant to it being implemented, but not understanding is bugging me.

Re: Choosing Acspect Ratio
Correct.Enjay wrote:You want to run (for example) 640x480 on a widescreen monitor.
Your hardware would normally stretch this to the 16:9 (or 16:10) aspect of your monitor making everything wider looking than it should be.
What you want is an option for Zdoom to unstretch that wideness?
640x480 takes up the whole screen. I get the impression you've never used widescreen modes before - or maybe you have but the whole idea isn't setting into this subject like it should be - So I'm going to make some examples.Enjay wrote:If so, and here's the bit I'm not sure about, how much of the screen would the 640x480 take up? The only way I can conceive of the image not looking stretched is if it narrows the image to occupy the middle part of the screen in a similar way to my photo. The image would still be 640 (or whatever) pixels wide, but those pixels would not occupy the whole width of the screen.
Spoiler: Images, beware!
I'm that way too, you have no need to justify that.Enjay wrote:I know that me understanding the request is utterly irrelevant to it being implemented, but not understanding is bugging me.


Re: Choosing Acspect Ratio
Thanks for trying, but I'm still not getting it. 
I understand everything up to the last picture. That's where I get lost. The last picture has a 4:3 ratio but the monitor doesn't. So what will Zdoom do?
I have used Wide screen modes and they aren't just wider. They show show more of the world as you said. That's why the edge of the Hexen figher fist gets cut off and the gas mask in my Burghead mod doesn't cover the whole screen in widescreen modes (
). Even in map01 of Doom2, if I Switch between a 4:3 ratio and a 16:10 one, I can see more of the pillars. Zdoom is showing pixels that are outside the normal 4:3 ratios when I use widescreen mode. In widescreen modes (rather than stretched 4:3 modes) the image is not distorted because there is more image at the sides.
This pic illustrates this. The normally lit area is from a 4:3 screenshot which I overlaid onto a brightened 16:10 screenshot. As you can see, the images line up properly (ie neither are distorted) and the widescreen version shows more of the world.
If I'm still not getting it, what would really explain it for me would be to show me a 16:10 ratio picture frame (the monitor) with a 4:3 ratio doom screen shot shown inside it to illustrate how Zdoom would display such a game image on a monitor of those dimensions without distortion in the way you are asking about.
[ducks flying skillet]
Sorry for being a pain.
[edit] In fact, here is "your" 480x300 monitor. How should Zdoom show the 320x240 image on it?

I understand everything up to the last picture. That's where I get lost. The last picture has a 4:3 ratio but the monitor doesn't. So what will Zdoom do?
I have used Wide screen modes and they aren't just wider. They show show more of the world as you said. That's why the edge of the Hexen figher fist gets cut off and the gas mask in my Burghead mod doesn't cover the whole screen in widescreen modes (

This pic illustrates this. The normally lit area is from a 4:3 screenshot which I overlaid onto a brightened 16:10 screenshot. As you can see, the images line up properly (ie neither are distorted) and the widescreen version shows more of the world.
Spoiler:And that's my problem. I can understand wanting to use correct aspect ratios for the game. However, if the monitor does not have that same aspect ratio, I don't see how the picture can fill the screen and remain at the correct aspect ratio. That is why I thought that the sides should be getting padded out by black bars and merely a 4:3 area in the middle should be occupied by the game screen if 4:3 was being forced.
If I'm still not getting it, what would really explain it for me would be to show me a 16:10 ratio picture frame (the monitor) with a 4:3 ratio doom screen shot shown inside it to illustrate how Zdoom would display such a game image on a monitor of those dimensions without distortion in the way you are asking about.
[ducks flying skillet]
Sorry for being a pain.

[edit] In fact, here is "your" 480x300 monitor. How should Zdoom show the 320x240 image on it?
Spoiler:[/edit]
Last edited by Enjay on Wed Apr 08, 2009 12:35 pm, edited 2 times in total.
Re: Choosing Acspect Ratio
Thing is, we're not forcing 4:3 in my example - we're forcing 16:10 onto a 4:3 mode.
So, squishy 4:3 image (which is the 3rd image I posted) gets expanded by the cheap ass monitor I have to look very close to the first image. Zdoom is actually drawing the 3rd image, but you remember the transition from image 1 to image 2? It would happen to Image 3 as well, which would show the correct aspect ratio, at the lower resolution.
We are not, in fact, forcing 4:3 at all. We just want the game to look right on a stretched screen - and yeah, you could pad the sides with black bars but that's not the most ideal solution. It's still going to be 640x480, and those black bars will be taking up some of those precious 640 horizontal pixels - not what we want.
Instead, if we treat 640x480 as a widescreen mode, the resolution itself looks the same on the monitor - stretched. But, Zdoom looks different - it's squished. When you stretch a squish, it looks right. On an ordinary monitor everything would look narrow - but on a widescreen monitor - just perfect.
So, squishy 4:3 image (which is the 3rd image I posted) gets expanded by the cheap ass monitor I have to look very close to the first image. Zdoom is actually drawing the 3rd image, but you remember the transition from image 1 to image 2? It would happen to Image 3 as well, which would show the correct aspect ratio, at the lower resolution.
We are not, in fact, forcing 4:3 at all. We just want the game to look right on a stretched screen - and yeah, you could pad the sides with black bars but that's not the most ideal solution. It's still going to be 640x480, and those black bars will be taking up some of those precious 640 horizontal pixels - not what we want.
Instead, if we treat 640x480 as a widescreen mode, the resolution itself looks the same on the monitor - stretched. But, Zdoom looks different - it's squished. When you stretch a squish, it looks right. On an ordinary monitor everything would look narrow - but on a widescreen monitor - just perfect.