Page 1 of 1

Changing the projection matrix

Posted: Sat Jul 28, 2012 18:39
by Nash
Where in the code is GZDoom doing the aspect ratio correction? I'd like to get rid of the view stretching for my project.

Re: Changing the projection matrix

Posted: Sat Jul 28, 2012 19:09
by Gez

Re: Changing the projection matrix

Posted: Sat Jul 28, 2012 21:54
by NeuralStunner
I'd still quite like a mod-available setting for both GL and software. (As many folks as are using widescreen nowadays, I don't think it would hurt visibility. Personally I'd hate seeing screenshots of my mod stretched the hell out when a cube should really be a cube.)

Re: Changing the projection matrix

Posted: Sun Jul 29, 2012 8:58
by Nash
Graf Zahl wrote:The aspect ratio stretching is currently done in the projection matrix but that's the wrong place
This is what I'd like to find, so I can "undo" the stretching. Changing the code to do stretching in the modelview matrix seems like a huge change. I just want a "quick fix"...

Re: Changing the projection matrix

Posted: Mon Jul 30, 2012 19:16
by Nash
Any help with this please? I really need to get rid of the stretching for my game project...

Re: Changing the projection matrix

Posted: Wed Aug 01, 2012 23:52
by Nash
Well I found this under FGLRenderer::RenderView in gl_scene.cpp:

Code: Select all

#define RMUL (1.6f/1.333333f)
Changing it to 1.0f seems to do what I want it to do. :dunno: Tested in all aspect ratios too, seems to work.

Re: Changing the projection matrix

Posted: Thu Aug 02, 2012 2:12
by Enjay
I'm intrigued how does it look - both with your mod and when running a Doom game?

Re: Changing the projection matrix

Posted: Sat Aug 04, 2012 2:43
by Nash
Hi Enjay, sorry for the late reply.

I don't have much to show yet, but I guess you can see the difference in these WIP shots.

4:3

Square pixels:

Image

Squashed pixels:

Image

16:10

Square pixels:

Image

Squashed pixels:

Image

(DISCLAIMER: Car model is a placeholder by real_trisk and WILL NOT BE USED in final production. It was added just to demonstrate the scaling)

It seems that with square pixels, the horizontal FOV does become slightly smaller, but I'm sure that can be compensated by altering the FOV code so that 1:1 pixels match the FOV of 1:1.2 pixels...