team-eternity / eternity

The Eternity Engine
http://eternity.youfailit.net/wiki/Main_Page
GNU General Public License v3.0
230 stars 36 forks source link

Eternity Engine wrong FOV with 32:9 monitor. #621

Closed Meerschweinmann closed 3 weeks ago

Meerschweinmann commented 1 month ago

Hello.

When using Eternity Engine with 32:9 monitor the FOV default is wrong.

It has to be set in console with R_FOV 139 to look like it does in International DOOM, Woof, Odamex and GZDoom.

This happens every startup.

Here are two pictures. One shows the FOV set at 139, the other FOV at default.

FOV139 FOVdefault

ioan-chera commented 3 weeks ago

Unfortunately the equation to get fov seems to be the following:

   // The general equation is as follows:
   // y = mx + b -> fov = (75/2) * ratio + 40
   // This gives 90 for 4:3, 100 for 16:10, and 106 for 16:9.
   fov = static_cast<int>((75.0/2.0) * ratio + 40.0);

It has a very special case for 320x200 and 640x400 to keep it 90 degrees (as opposed to 100 as resulting from this formula).

Guess we need a better formula?

I wonder if a solution is to increase FOV so that the 4:3 middle subscreen always keeps 90 degrees.

Meerschweinmann commented 3 weeks ago

One thing i had noticed meanwhile. When using 43:18 as aspect ratio (3440x1440). Everything seems fine with FOV. But going wider is like there is something letting the fov explode to higher numbers then necessary. I had not compared the 43:18 ratio to other ports and count pixels in textures, but i can do this if this is helpful. Same i had done with 32:9 to get the needed FOV of 139.

ioan-chera commented 3 weeks ago

Fixed. The formula was just a very raw polynomial approximation, which ran away when outside the range. Now it just uses the arctangent, as it should.

Meerschweinmann commented 3 weeks ago

Thank you :) Will test it tomorrow when the new version is downloadable at DRD devbuilds.