[CODE SUBMISSION] Choosing/forcing Aspect Ratio

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [CODE SUBMISSION] Choosing/forcing Aspect Ratio

Re: [CODE SUBMISSION] Choosing/forcing Aspect Ratio

by Rachael » Sat Jun 06, 2009 9:01 am

Your version is probably cleaner coded, I'm sure, as well. I'm used to creating functions for every set of functions that I repeat more than 2 times, but C++ is still kinda new territory to me. Sometimes the oversimplification with scripting languages is a boon. ;) Anyway, thanks Graf.

Re: [CODE SUBMISSION] Choosing/forcing Aspect Ratio

by Graf Zahl » Sat Jun 06, 2009 8:38 am

Added with a few changes:

This submission made the new CVAR depend on other settings like blocking widescreen or 5:4 ratios. However, since this is supposed to override the default resolution it should also override these blocks.

Re: [CODE SUBMISSION] Choosing/forcing Aspect Ratio

by phi108 » Mon May 25, 2009 9:06 am

Can this code be added? It works perfectly, and I don't think it really needs a menu option, at least not for us console-literate users.

Re: [CODE SUBMISSION] Choosing/forcing Aspect Ratio

by Hirogen2 » Wed May 20, 2009 11:31 am

Now let me trying to hit the nail :mrgreen: — the OP has a crappy monitor where the pixel aspect ratio is ≥1.2 for any 4:3 mode, that's all. As such, the video output of the program (Zdoom) produces shall be horizontally squished (i.e. the perspective may not “line up”, as Enjay called it—just like calling “Resize” in your favorite image editor while “keep aspect ratio” is disabeld), similar to how DVD video is actually encoded on-disc.

Re: Choosing/forcing Aspect Ratio

by Rachael » Sat May 09, 2009 11:17 am

I guess it just needs a menu update. I hate the idea of messing around with the menu, but it seems I have no other choice.

The way I am going to do it is if the value is non-zero, it makes the default aspect ratio selector invisible (since it has no use when vid_aspect is set, anyway), and presents this CVar in its place. You can modify the CVar from the new menu option.

There will be a second menu option that reads whether this cvar is set at all, and it will be named "Anamorphic Aspect Ratio" (or something shorter if there's a good way to shorten it). If it is, it sets itself to "yes", if not, it sets itself to "no". When switched, the following will happen:

If switched to "yes", it copies the current aspect ratio selection (which will become invisible) to the vid_aspect cvar, which can be updated with the menu option which will now become visible.

If switched to "no", it copies from the vid_aspect cvar to the aspect ratio selection, set vid_aspect to zero, allowing you to interact with the resolution menu as previous.

Re: Choosing/forcing Aspect Ratio

by Gez » Sat May 09, 2009 11:01 am

This thread (and the ammo_checkboth one too) should be moved to Code Submission...

Re: Choosing/forcing Aspect Ratio

by phi108 » Sat May 09, 2009 10:56 am

Many thanks SoulPriestess for the new build! This option is perfect!

Re: Choosing/forcing Aspect Ratio

by Rachael » Fri May 08, 2009 5:42 am

I hate to bump this - but is there any chance of this being added, now that this is a code submission?

It works solidly and I have not had any issues with it yet. I have a test build available also which shows that it is working. If needed, I'll make a menu option for it.

Re: Choosing/forcing Aspect Ratio

by Rachael » Fri Apr 24, 2009 2:18 am

This is now a code submission.

Added new cvar: vid_aspect
Integer, accepts the following arguments:
0 - Let engine decide
1 - 16:9
2 - 16:10
3 - 4:3
4 - 5:4 (Only if vid_tft is enabled)

vid_nowidescreen overrides this cvar.

EDIT: Fixed a bug.
Attachments
vid_aspect.zip
Applied against r1557
.diff's are changes only, .cpp's are full sources
(33.37 KiB) Downloaded 38 times

Re: Choosing/forcing Aspect Ratio

by phi108 » Wed Apr 15, 2009 10:30 am

So THAT's what anamorphic means. I noticed that this is how the Xbox does it's widescreen as well.

Re: Choosing/forcing Aspect Ratio

by HotWax » Tue Apr 14, 2009 6:53 pm

Is it too late to point out that what the OP is asking for has been around for a long time and is called anamorphic widescreen? :) Many DVD players and some game consoles (including the Wii) use this method of rendering to widescreen displays. The system "squeezes" a widescreen image into a standard 4:3 screen area and relies on the display device to stretch the image back to the proper width.

Here's an adequate (if amateurish) explanation of how it works with pretty pictures! :P The bottom shot is what it looks like when viewing the Wii's widescreen mode on a standard TV, or with your 16:9 TV incorrectly set to 4:3 mode. The one three images up from the bottom is the result after your TV/monitor stretches that same image out to fill all the available space.

Re: Choosing Acspect Ratio

by phi108 » Wed Apr 08, 2009 1:42 pm

Anyway I think the needed changes would be in v_video.cpp, near the bottom below these lines:

// Tries to guess the physical dimensions of the screen based on the
// screen's pixel dimensions. Can return:

Somewhere a cvar would need to be added: Vid_forceaspectratio, that overrides any of the engine's guesses of the correct aspect ratio.

Re: Choosing Acspect Ratio

by Rachael » Wed Apr 08, 2009 1:33 pm

Enjay wrote:How much difference do those few extra pixels at the side of the screen make to a machine's performance? I mean, my setup gives me 16:10 ratios from 360x240 upwards. Would that be significantly slower than a 16:10 image squashed to 320x240 then stretched back out by the monitor?
Not much difference - however the point here is the availability of those 16:10 resolutions - 768x480, for example, is rarely supported, and it's the only true 16:10 aspect ratio with 480 lines.

Re: Choosing Acspect Ratio

by phi108 » Wed Apr 08, 2009 1:32 pm

Well, in terms of performance, 1360X768 (the only widescreen mode that my TV supports), can have low performance on detailed maps or with many transparent textures. So If I could just use 800x600 (much better performance), stretched to fill the 16x9 tv screen, I would get a whole widescreen wiew (map01 showing all of both pillars), without having to run at a huge 1360x768 resolution.

Re: Choosing Acspect Ratio

by Enjay » Wed Apr 08, 2009 1:09 pm

Phew! Thanks. That means I'll be able to sleep tonight. ;)

How much difference do those few extra pixels at the side of the screen make to a machine's performance? I mean, my setup gives me 16:10 ratios from 360x240 upwards. Would that be significantly slower than a 16:10 image squashed to 320x240 then stretched back out by the monitor?

Top