View Issue Details

IDProjectCategoryView StatusLast Update
0005520The Dark ModGraphicspublic06.12.2026 15:09
ReporterJudith Assigned Tonbohr1more  
PrioritynormalSeveritynormalReproducibilityalways
Status feedbackResolutionreopened 
Product VersionSVN 
Target VersionTDM 2.15Fixed in VersionTDM 2.15 
Summary0005520: FOV: Find a way to correct the distortion
DescriptionThe pincusion distortion in TDM is huge. Even at fairly narrow FOV of 70, you can see objects getting stretched and looking much bigger than in the center. It's even more visible with FOV 80 or higher. In most games (and with widescreen resolutions), the effect much less severe, typically until FOV is like 110-120 and higher.

UPDATE (stgatilov): This statement is most likely not true.
TDM distortion is the same as in the other games with the same FOV values set.
But the number which people see/control was different in TDM, that's why people often compared apples to oranges.
Steps To ReproduceLook at any object that is in the center of the screen, then rotate the camera so it's at one of the corners.
TagsNo tags attached.
Attached Files
Clipboard02.jpg (541,429 bytes)

Activities

nbohr1more

nbohr1more

03.02.2021 19:39

developer   ~0013626

Topic:

https://forums.thedarkmod.com/index.php?/topic/19539-conformal-perspective-as-an-option-in-tdm/
stgatilov

stgatilov

04.02.2021 17:53

administrator   ~0013637

Last edited: 04.02.2021 17:53

"In most games the effect much less severe, typically until FOV is like 110-120 and higher."

I guess that's because most games measure horizontal FOV.
As far as I remember, TDM measures some weird quantity which is neither horizontal nor vertical FOV, but something connected to virtual 640x480 screen.

If you really want to check if TDM distortion is more severe, you should ensure that actual FOV is the same, because numbers give you wrong impression.
cabalistic

cabalistic

07.02.2021 10:40

developer   ~0013662

Just looked it up in the code to have a reference point. An FOV setting of 90 actually results in horizontal FOV of 106 and vertical FOV of 74 (on a 16:9 resolution).

An FOV setting of 75 would give horizontal FOV of 91 and vertical FOV of 60 (again, for a 16:9 resolution).
AluminumHaste

AluminumHaste

28.03.2021 19:25

developer   ~0013817

Yeah I think the original FOV is calculated by 4:3 aspect.

Maybe this is something to look into?

https://www.decarpentier.nl/lens-distortion
cabalistic

cabalistic

28.03.2021 20:05

developer   ~0013818

I think the quick (initial) fix would be to set the default FOV to 75. That value is much closer to the typical horizontal FOV value of 90 and already significantly reduces the problem. Adding barrel distortion is not without its own side effects. If the issue is still more pronounced in TDM than in other games at comparable FOV values, I'd like to understand why, first :)
nbohr1more

nbohr1more

28.03.2021 20:28

developer   ~0013819

I wonder if we can summon Tels to discuss what he did with r_fovRatio and see if there is some disconnect that happened either after it's removal or moving to Standalone or 64-bit.

I can artificially correct this by issue setting a lower fov and then noclipping backward from the target scene so I imagine a proper fix might include a z axis adjustment to the camera too.
nbohr1more

nbohr1more

04.12.2026 20:03

developer   ~0017410

Rev 11386
New g_autoAspectRatioCorrection that automatically corrects the FOV value based on screen ratio and also moves the player camera location to correct the perceived distance scale to match a 4:3 / 90 FOV experience. Also a new pm_cameraDistance cvar to manually override the camera distance.
nbohr1more

nbohr1more

05.12.2026 13:10

developer   ~0017416

Rev 11389
Make frob more responsive when the camera distance is offset
stgatilov

stgatilov

06.12.2026 12:14

administrator   ~0017423

Last edited: 06.12.2026 12:15

I have reverted most of the changes in svn rev 11393, which are "camera is not at the player's eye".
This is terrible hack for a first-person game and I can't even see how it can improve anything.

As for the g_autoAspectRatioCorrection, it is now called g_horizontalFov.
Because what it does is: g_fov specifies horizontal FOV when it is enabled.
I also rewrote the formula (did AI write it under torture?)

Now we have started to measure FOV differently, which may be a breaking change.
I suggest testing missions which play around with FOV, like e.g. some William Steele mission had drunkedness effect.
nbohr1more

nbohr1more

06.12.2026 12:40

developer   ~0017425

Last edited: 06.12.2026 12:40

Thank you for reviewing and improving.

I fixed the compile error from the revert.

Hopefully the the new design will preserve the intended design:

Reduced barrel / fisheye distortion while preserving the same perceived distance to the scene for player comfort.
It should "feel" like playing on a 90 FOV 4:3 screen.
stgatilov

stgatilov

06.12.2026 12:51

administrator   ~0017427

Last edited: 06.12.2026 12:51

There is no way to reduce distortion except for actually distorting the output (which will look good statically but feel awful in movement/rotations).
The change is only in the scale of the "FOV" number displayed in the settings.
I believe the game still works exactly like playing on 4:3 screen if you disable g_horizontalFov and set g_fov to 90.
nbohr1more

nbohr1more

06.12.2026 13:00

developer   ~0017428

Last edited: 06.12.2026 13:01

The "bad feeling" is because the player is perceptually too close to the scene.
Moving the camera backward corrects that "feeling".

The calculation to get the same perceived scene distance for 4:3 with 90 FOV requires the camera to move backward 30% ( 19 units ) when in 16:9 to get that "feeling".
If the pm_cameraDistance cvar still remains, I guess players can manually adjust that way?
stgatilov

stgatilov

06.12.2026 13:08

administrator   ~0017429

Moving camera cannot correct anything a meter away from the player.
Take any outside scene, and this correction will be totally useless.

I don't understand how you got this math, like 30% of what?
It needs to be "30% of the distance to the object player looks at", but you don't have this number.
nbohr1more

nbohr1more

06.12.2026 14:04

developer   ~0017432

Last edited: 06.12.2026 14:05

30% is the change in "average" near-field distance.

On consideration, I think a better design is to match the perceived near-field distance at 16:9 90 FOV
since the 4:3 distance is such a small adjustment and still isn't as comfortable as 16:9 90.

If there is no good way to do this, then letting players use pm_cameraDistance will have to be good enough?
stgatilov

stgatilov

06.12.2026 15:00

administrator   ~0017434

I don't see the point in reducing "near-field distortion" if the "middle-field" and "far-field" distortions are still the same.

If you are really that dedicated to reducing distortion, maybe just implement an optional undistortion postprocess shader?
You know, the one that remaps the screen image rendered with normal pinhole camera into something like stereographic projection or whatever.
It will really reduce distortion near screen boundaries (and will of course cause the same uneasy feelings during rotations).
I recall there were people who suggested it and even believed they would like it better.

Issue History

Date Modified Username Field Change
03.02.2021 11:28 Judith New Issue
03.02.2021 11:28 Judith File Added: Clipboard02.jpg
03.02.2021 19:39 nbohr1more Note Added: 0013626
04.02.2021 17:53 stgatilov Note Added: 0013637
04.02.2021 17:53 stgatilov Note Edited: 0013637
07.02.2021 10:40 cabalistic Note Added: 0013662
28.03.2021 19:25 AluminumHaste Note Added: 0013817
28.03.2021 20:05 cabalistic Note Added: 0013818
28.03.2021 20:28 nbohr1more Note Added: 0013819
04.12.2026 20:03 nbohr1more Note Added: 0017410
04.12.2026 20:04 nbohr1more Assigned To => nbohr1more
04.12.2026 20:04 nbohr1more Status new => resolved
04.12.2026 20:04 nbohr1more Resolution open => fixed
04.12.2026 20:04 nbohr1more OS Windows =>
04.12.2026 20:04 nbohr1more OS Version 7 =>
04.12.2026 20:04 nbohr1more Platform x64 =>
04.12.2026 20:04 nbohr1more Product Version => SVN
04.12.2026 20:04 nbohr1more Fixed in Version => TDM 2.15
04.12.2026 20:04 nbohr1more Target Version => TDM 2.15
05.12.2026 13:10 nbohr1more Note Added: 0017416
06.12.2026 12:14 stgatilov Note Added: 0017423
06.12.2026 12:14 stgatilov Note Edited: 0017423
06.12.2026 12:15 stgatilov Note Edited: 0017423
06.12.2026 12:40 nbohr1more Note Added: 0017425
06.12.2026 12:40 nbohr1more Note Edited: 0017425
06.12.2026 12:42 nbohr1more Status resolved => feedback
06.12.2026 12:42 nbohr1more Resolution fixed => reopened
06.12.2026 12:51 stgatilov Note Added: 0017427
06.12.2026 12:51 stgatilov Note Edited: 0017427
06.12.2026 13:00 nbohr1more Note Added: 0017428
06.12.2026 13:00 nbohr1more Note Edited: 0017428
06.12.2026 13:01 nbohr1more Note Edited: 0017428
06.12.2026 13:08 stgatilov Note Added: 0017429
06.12.2026 14:04 nbohr1more Note Added: 0017432
06.12.2026 14:05 nbohr1more Note Edited: 0017432
06.12.2026 15:00 stgatilov Note Added: 0017434
06.12.2026 15:08 stgatilov Description Updated
06.12.2026 15:09 stgatilov Description Updated