CODE PATCH: Ultrawide support for Doom

Moderator: GZDoom Developers

Post Reply
sludge
Posts: 2
Joined: Wed Mar 02, 2016 5:19 pm

CODE PATCH: Ultrawide support for Doom

Post 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.
Attachments
zdoom_ultrawide_patch.txt
(13.27 KiB) Downloaded 955 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: CODE PATCH: Ultrawide support for Doom

Post 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.
sludge
Posts: 2
Joined: Wed Mar 02, 2016 5:19 pm

Re: CODE PATCH: Ultrawide support for Doom

Post 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.
User avatar
MadTux
Posts: 40
Joined: Wed Apr 02, 2014 7:50 am

Re: CODE PATCH: Ultrawide support for Doom

Post 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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: CODE PATCH: Ultrawide support for Doom

Post by Graf Zahl »

I still go by the currently implemented two-man-rule here. I'm undecided so we need a second opinion here.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: CODE PATCH: Ultrawide support for Doom

Post 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-)
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: CODE PATCH: Ultrawide support for Doom

Post 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.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: CODE PATCH: Ultrawide support for Doom

Post 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.
Blzut3
 
 
Posts: 3144
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: CODE PATCH: Ultrawide support for Doom

Post 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.
Zardoz
Posts: 4
Joined: Thu Oct 25, 2012 5:11 pm

Re: CODE PATCH: Ultrawide support for Doom

Post 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.
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: CODE PATCH: Ultrawide support for Doom

Post 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
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CODE PATCH: Ultrawide support for Doom

Post 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.
User avatar
PlayerLin
Posts: 580
Joined: Sun Nov 11, 2007 4:20 am
Graphics Processor: nVidia with Vulkan support
Location: XinZhuang, XinBei/New Taipei City(Former Taipei County), Taiwan.
Contact:

Re: CODE PATCH: Ultrawide support for Doom

Post 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
musante
Posts: 1
Joined: Sun Aug 21, 2016 10:15 am

Re: CODE PATCH: Ultrawide support for Doom

Post by musante »

Any update on this? Has it officially been added to the patch?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”