CS:GO Calculate real FOV from engine FOV mirv_fov - advancedfx/advancedfx GitHub Wiki

In CS:GO the game scales the FOV based on the screen aspect ratio (like in the Alien Swarm SDK). Below is the formula and example values.

Formula:

Input:
width: width in pixels
height: height in pixels
fovDegrees: engine FOV set (in degrees)

Output:
resultFov: actual FOV in degrees

Calculate (make sure your calculator is in DEG (degrees) mode!):
engineAspectRatio = width / height
defaultAspectRatio = 4/3
ratio = engineAspectRatio / defaultAspectRatio
halfAngle = fovDegrees * 0.5
t = tan( halfAngle ) * ratio
resultFov = atan( t ) * 2.0

Example values:

Input: fovDegrees = 90°, engineAspectRatio = 16/9 Output: resultFov = 106.26020470831195740628877488181°

Input: fovDegrees = 100°, engineAspectRatio = 16/9 Output: resultFov = 115.63355622690279323979029011803°

Input: fovDegrees = 110°, engineAspectRatio = 16/9 Output: resultFov = 124.58707264740344327903880684516°

Input: fovDegrees = 120°, engineAspectRatio = 16/9 Output: resultFov = 133.1735511072589240879687950147°

Other

HLAE / AfxHookSource currently internally limits the fovDegrees / engine FOV set (in degrees) to be in 1 to 179 degrees: https://github.com/advancedfx/advancedfx/blob/fba6bf43d3ad4410d461735e83dd29028d58d694/AfxHookSource/RenderView.cpp#L267