Page 1 of 1

CODE PATCH: Ultrawide support for Doom

PostPosted: Wed Mar 02, 2016 6:23 pm
by sludge
Today, I coded a patch that adds aspect ratio-correct Ultrawide 21:9 support to ZDoom. This is the ratio used in many new ultrawide monitors, such as the 34" Acer Predator x34. I have tested it at 3440x1440 and it looks great.

Here are some screenshots I took while playing:
http://imgur.com/a/ZV931

The patch has the following features:
- vid_aspect 6 forces 21:9
- 21:9 resolution autodetection works with vid_aspect 0 as expected.
- 21:9 aspect ratio has been added to the menus and modes can be selected
- all of the intermission and end level screens, credits and scrolling screens have been tested and work.

Notes to maintainers:
- This patch was created from HEAD of origin/master today.

- In many places, the test (ratio & 3) showed up in the code. In others, (ratio & 4) was used as a test. This sort of testing no longer works with newer aspect ratio options. Very simple one-line inline functions have been created to perform these tests and all of the bitwise tests have been replaced.

- Special care was taken to not stretch the fullscreen images (credits, title), but instead to apply black bars as expected.

- Tested on a playthrough of all intermission screens in Doom and Doom 2. No known issues.

- It has to draw a lot of pixels! This is taxing for a software renderer, even on a modern machine. It is tractible with a higher end PC today, however.

- Prior to my work, CheckRatio() used "vid_aspect 5" to create a "fakeratio" of 3. Because of this, the 5th entry in BaseRatioSizes has to be padded out and made redundant and the 21:9 aspect ratio has to be "vid_aspect 6". There is a comment to this effect in v_video.cpp.

- 21:9(2.333) is a marketing/public facing term for what is actually 64:27(2.37). The aspect ratio we use is actually 64:27, which is slightly different, but correct. However, all of the user-facing strings say 21:9 because that's what everyone expects.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Wed Mar 02, 2016 7:05 pm
by Graf Zahl
I honestly think that this stuff should be genuinely fixed, instead of seeing yet another ratio getting hacked in. Besides, 21:9 would probably be better served by cropping the top and bottom somewhat than having such a distorted display.

I'm going to wait for other opinions.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Wed Mar 02, 2016 8:41 pm
by sludge
I honestly think that this stuff should be genuinely fixed, instead of seeing yet another ratio getting hacked in.


The act of eventually fixing the cruft isn't harmed by having the feature in place in the interim. The code patch follows all of the existing logic.

Besides, 21:9 would probably be better served by cropping the top and bottom somewhat than having such a distorted display.


Did you try it on the target hardware, or are you just looking at the screenshots on a non-UW monitor? The screenshots were taken at fov 105 with +mlook on and the camera pitched slightly, the author's preference.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Thu Mar 03, 2016 12:50 am
by MadTux
I don't really see any reason not to include the patch. Yes, it's sort of hacked in, but until we *do* have other options, isn't it better to at least have 12:9 at all?

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Thu Mar 03, 2016 4:01 am
by Graf Zahl
I still go by the currently implemented two-man-rule here. I'm undecided so we need a second opinion here.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Thu Mar 03, 2016 12:21 pm
by Caligari87
Well, I'm not a Dev so I can't sway the vote, but what kind of work would be involved in getting the other stuff fixed (I assume so arbitrary resolutions are possible)? I wasn't aware that extra resolutions were "hacked" in the first place.

8-)

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Thu Mar 03, 2016 12:24 pm
by Major Cooke
Graf Zahl wrote:I still go by the currently implemented two-man-rule here. I'm undecided so we need a second opinion here.


Speaking of which... I think either this should be moved to code submissions so people can see that sticky, or that sticky be made visible in the feature suggestions general forum.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Thu Mar 03, 2016 7:02 pm
by randi
Graf Zahl wrote:I honestly think that this stuff should be genuinely fixed, instead of seeing yet another ratio getting hacked in.

I agree, but that hasn't happened yet and 21:9 monitors exist now.
Caligari_87 wrote:I wasn't aware that extra resolutions were "hacked" in the first place.

Ratios, not resolutions.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Thu Mar 03, 2016 10:48 pm
by Blzut3
I've said somewhere before, while I think having proper support for arbitrary aspect ratios is a good idea, there are some cases where it makes sense to adjust to a fixed ratio. For example the disagreement on 16:9 768 vertical resolutions between manufactures. If one uses arbitrary ratios then art designed for 16:9 will not properly fill those screens even though it's just a few pixels off from true 16:9.

Then of course there's our support for anamorphic aspect ratios which is probably handy to have easy selection of common ratios. I'm sure artists also like to be able to target a fixed set of ratios.

Therefore I'm still of the opinion that we should have a fixed list of common ratios as the default behavior and have the user opt in via the console to their true aspect ratio if desired. Or it could default to some semi-automatic mode where if the ratio appears to be far removed from any supported ratio it turns on.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Fri Mar 04, 2016 7:29 am
by Zardoz
Push this ASAP! 21:9 monitors are here and becoming more popular. Also, ultra wide screen looks very awesome on any 3d game.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Fri Mar 04, 2016 7:50 am
by Nash
Just a slightly offtopic comment... I was checking out some 21:9 videos of Fallout 4 and it looks like when zooming in with snipers, the fullscreen scope overlay appears to be made only for 16:9 - so you actually see the 3D display at the sides where the sniper zoom overlay gets cut off! This completely reminds me of ZDoom mods that use a similar concept of fullscreen graphics/HudMessages but not supporting wider displays! It was hilarious to see the exact same phenomenon in a triple-A game. xD

Similarly, my fear for this since a few years ago has led me to devise a solution which I have been using for many years now for the project I'm developing - beyond the center "piece" of the fullscreen graphic, I draw two more completely black fullscreen 16:9 overlays at the left and right sides of the center overlay... the idea being "that should cover any aspect ratios I'd never think of!". I used to think it was completely unnecessary and overkill (we're talking by 2010'ish standards) but it looks like I wasn't far off in predicting that this would become a problem in future... =P

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Fri Mar 04, 2016 7:54 am
by _mental_
Nash wrote:It was hilarious to see the exact same phenomenon in a triple-A game. xD

In a PC port of AAA game :) Never forget that consoles have 16:9 no matter what.

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Sun Mar 06, 2016 1:43 am
by PlayerLin
_mental_ wrote:
Nash wrote:It was hilarious to see the exact same phenomenon in a triple-A game. xD

In a PC port of AAA game :) Never forget that consoles have 16:9 no matter what.


Yeah, BGS's games are "console-based" and PC one was "ported" from that, but...I'm not sure 21:9 is more popular than 16:9 in PC gaming and since the menu of Fallout 4 Launcher for selecting ratios/resolutions keeps screwed up on my Win7 x64 then I won't be surprised. :p

Re: CODE PATCH: Ultrawide support for Doom

PostPosted: Sun Aug 21, 2016 11:25 am
by musante
Any update on this? Has it officially been added to the patch?