[Added] CODE PATCH: Ultrawide support for Doom

Moderator: GZDoom Developers

CODE PATCH: Ultrawide support for Doom

Postby sludge » Wed Mar 02, 2016 6:23 pm

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 428 times
sludge
 
Joined: 02 Mar 2016

Re: CODE PATCH: Ultrawide support for Doom

Postby Graf Zahl » Wed Mar 02, 2016 7:05 pm

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: CODE PATCH: Ultrawide support for Doom

Postby sludge » Wed Mar 02, 2016 8:41 pm

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.
sludge
 
Joined: 02 Mar 2016

Re: CODE PATCH: Ultrawide support for Doom

Postby MadTux » Thu Mar 03, 2016 12:50 am

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
MadTux
 
Joined: 02 Apr 2014

Re: CODE PATCH: Ultrawide support for Doom

Postby Graf Zahl » Thu Mar 03, 2016 4:01 am

I still go by the currently implemented two-man-rule here. I'm undecided so we need a second opinion here.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: CODE PATCH: Ultrawide support for Doom

Postby Caligari87 » Thu Mar 03, 2016 12:21 pm

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
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: CODE PATCH: Ultrawide support for Doom

Postby Major Cooke » Thu Mar 03, 2016 12:24 pm

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
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: CODE PATCH: Ultrawide support for Doom

Postby randi » Thu Mar 03, 2016 7:02 pm

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.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: CODE PATCH: Ultrawide support for Doom

Postby Blzut3 » Thu Mar 03, 2016 10:48 pm

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.
Blzut3
Pronounced: B-l-zut
 
 
 
Joined: 24 Nov 2004

Re: CODE PATCH: Ultrawide support for Doom

Postby Zardoz » Fri Mar 04, 2016 7:29 am

Push this ASAP! 21:9 monitors are here and becoming more popular. Also, ultra wide screen looks very awesome on any 3d game.
Zardoz
 
Joined: 25 Oct 2012

Re: CODE PATCH: Ultrawide support for Doom

Postby Nash » Fri Mar 04, 2016 7:50 am

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
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: CODE PATCH: Ultrawide support for Doom

Postby _mental_ » Fri Mar 04, 2016 7:54 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: CODE PATCH: Ultrawide support for Doom

Postby PlayerLin » Sun Mar 06, 2016 1:43 am

_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
User avatar
PlayerLin
 
Joined: 11 Nov 2007
Location: XinZhuang, XinBei/New Taipei City(Former Taipei County), Taiwan.

Re: CODE PATCH: Ultrawide support for Doom

Postby musante » Sun Aug 21, 2016 11:25 am

Any update on this? Has it officially been added to the patch?
musante
 
Joined: 21 Aug 2016


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: MSN [Bot] and 1 guest