5:4 aspect ratio incorrect in GL renderer

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
Doom_user
Posts: 14
Joined: Tue Feb 21, 2006 5:07

5:4 aspect ratio incorrect in GL renderer

Post by Doom_user »

The 5:4 aspect ratio in the GL renderer increases the player's vertical viewing area too much. As a result, the player's view of the level gets vertically compressed/scrunched in compared to the 4:3 aspect ratio.

http://img197.imageshack.us/img197/6871/glcomp.png

If it were correct, the 4:3 and 5:4 screenshots would line up exactly, like they do in the software renderer.

http://img143.imageshack.us/img143/4772/softcomp.png

There was an identical bug in PrBoom Plus's GL renderer. The cause was the aspect ratio being entered as 1.2 instead of 1.25.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: 5:4 aspect ratio incorrect in GL renderer

Post by Gez »

I'll be honest, I don't understand how aspect ratio works in GZDoom.

There's this table which is apparently used:

Code: Select all

// First column: Base width (unused)
// Second column: Base height (used for wall visibility multiplier)
// Third column: Psprite offset (needed for "tallscreen" modes)
// Fourth column: Width or height multiplier
const int BaseRatioSizes[5][4] =
{
	{  960, 600, 0,                   48 },			//  4:3   320,      200,      multiplied by three
	{ 1280, 450, 0,                   48*3/4 },		// 16:9   426.6667, 150,      multiplied by three
	{ 1152, 500, 0,                   48*5/6 },		// 16:10  386,      166.6667, multiplied by three
	{  960, 600, 0,                   48 },
	{  960, 640, (int)(6.5*FRACUNIT), 48*15/16 }	//  5:4   320,      213.3333, multiplied by three
};
Then there's the problem that I don't get any video modes with a width identical to the single 5:4 mode I have at my disposal. I don't know how to add more modes -- without getting them letterboxed in the screenshots, which makes the comparison impossible. (Though they're curiously not letterboxed in the game window...)
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: 5:4 aspect ratio incorrect in GL renderer

Post by Graf Zahl »

Please don't ask me how that table is supposed to work. I had to do some alternate calculations because it doesn't make sense so even if there's differences it's very unlikely that it's going to change unless it's something obvious.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: 5:4 aspect ratio incorrect in GL renderer

Post by Gez »

Yeah, I don't understand what it does and how it does it.


[spoiler]The only thing I've figured out is that the first column always correspond to the width for a height of 720 in the given resolution (720*4/3 =960, 720*16/9=1280, 720*16/10=1152) except for the 5:4 one where then it would have to be 900. But that column is apparently not used anyway.

Then there's the multiplier.
Base ratio is 4:3.
16:3 => 3/4; 4*4=16; 3*3=9 => 16:9
16:10 => 5/6; 4*6=24; 3*5=15=> 24:15 = 8:5 = 16:10
5:4 => 15/16; 4*16=64; 3*15=45 => 64:45 != 5:4

So if my hunch is correct, it should be 16/15, not 15/16! 4*15=60; 3*16=48 => 60:48 = 5*12:4*12 = 5:4.

16/15 would also make more sense wrt. the second column:
450 = 3/4 * 600
500 = 5/6 * 600
640 = 16/15 * 600

Tell you what, I think I'll upload an experimental build with that change and let Doom_user try it out.[/spoiler]

Doesn't matter, this only affects HUD sprites.


Fixed, it was in gl_scene I ought to have been looking.
Locked

Return to “Closed Bugs”