View Issue Details

IDProjectCategoryView StatusLast Update
0005520The Dark ModGraphicspublic06.12.2026 19:45
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.
nbohr1more

nbohr1more

06.12.2026 16:57

developer   ~0017436

I'm not trying to be argumentative here but I feel I need to clarify

1) Changing g_fov from 90 to 74 at 16:9 ( and the equivalent changes at other ratios ) is the only "distortion correction" associated with these changes
This was largely agreed to be correct regardless of other changes

2) The thing I am trying to correct for is that g_fov 74 ( the correct FOV ), feels terrible to players. Thus the camera distance change

If a shader is a better solution for that then so be it
stgatilov

stgatilov

06.12.2026 18:59

administrator   ~0017437

With your new mode which measures FOV as horizontal angle, the default FOV for 16 : 9 aspect ratio should become 106 degrees.
It certainly should not fall below 90.

Here is what Gemini says about defaults:
=========================================

All values below follow the format vertical : horizontal (4:3) : horizontal (16:9 Hor+),
rounded to the nearest full degree using standard Hor+ (horizontal-plus) scaling where the vertical angle remains constant.

Thief series
• Thief: The Dark Project (1998): 74° : 90° : 106°
• Thief II: The Metal Age (2000): 74° : 90° : 106°
• Thief: Deadly Shadows (2004): 65° : 81° : 97°
• Thief (2014): 59° : 74° : 90°

Classic & modern FPS games
• Counter-Strike 2: 74° : 90° : 106°
• Half-Life 2: 75° : 91° : 108°
• Doom Eternal: 59° : 74° : 90°
• Valorant: 71° : 87° : 103°
• Overwatch 2: 71° : 87° : 103°
• Rainbow Six Siege: 60° : 75° : 91°
• Call of Duty 4: Modern Warfare (Single-Player): 51° : 65° : 81°
• Modern Call of Duty (e.g., MWIII / Black Ops 6): 51° : 64° : 80°
nbohr1more

nbohr1more

06.12.2026 19:43

developer   ~0017438

Last edited: 06.12.2026 19:45

Right. The cvar is meant to make a default g_fov 90 setting act like g_fov 90 in other modes so you wouldn't input 75 directly
in the menu, you would choose ( or default to ) 90 ( g_fov ) and then the "magic" would scale that to the correct aspect to give the same effect as 4:3 / 90.

If that means that the resultant "horizontal FOV" is 106 degrees then that is what's intended.

Players could of course change the value but it would be offset
from the real value. The other option would be to force an aspect ratio change to overwrite the g_fov value to the corrected value which seems a little crude.

Basically this was following the logic previously mentioned in this tracker:

"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). "

It may be that other games are just as permissive if not more permissive about distortion?

( Certainly looks like a zoo of different defaults with no standardization. )

I'm open to any solution that makes this behave the "industry standard way" as long as it doesn't involve me getting motion sick by being too close to the scene.

the pm_cameraDistance thing also comes in handy for interesting screen-shots but probably not what I wanted it for ( orthographic screen-shots )

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
06.12.2026 16:57 nbohr1more Note Added: 0017436
06.12.2026 18:59 stgatilov Note Added: 0017437
06.12.2026 19:43 nbohr1more Note Added: 0017438
06.12.2026 19:45 nbohr1more Note Edited: 0017438