Field of View: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
(22 intermediate revisions by 9 users not shown)
Line 1: Line 1:
'''Field of view''' ('''FOV''') is the maximum angle between the peripherals of a person's or camera's vision.
{{LanguageBar}}


In [[HL2]] the Player Character's ''Horizontal'' Field of View is set to 75 degrees. Screen settings aspect ratios are achieved by cropping the top and bottom of the image (ie reducing the vertical FOV).  
A [[Field of View]] (abbreviated '''FOV''') is the maximum angle between the peripherals of a person's or camera's vision.  


The [[NPC FOV]] angle determines the 'scope' of their [[Viewcone]].  
There are two types of fields of view—one for players and one for [[NPC]]s:
*The player's FOV represents the ''Horizontal+ Angular Field of View'' {{since|{{src|3.1}}}}, {{also|{{sc|3}} version 5.04+ and {{hl1|3}} post-25th anniversary update}}, determining the angle of a geometrical ''viewwedge'' called a [http://en.wikipedia.org/wiki/Frustrum Frustum], whose rectangular cross-section corresponds to the player's rectangular screen. <br>In {{gldsrc|3.1}} and earlier titles (and older versions of {{hl1|3}}), it is ''Vertical- Angular Field of View'' instead.
*The [[NPC FOV]] instead represents the ''Angular Field of View'', determining the angle of its [[viewcone]]. (You can display [[NPC]] fields of view in-game with the [[Developer Console|console]] command {{ent|npc_viewcone}}.)


== Optimising Player FOV ==


* '''[http://en.wikipedia.org/wiki/Motion_sickness Motion Sickness]''' : Smaller FOVs tend to exaggerate camera movement, whilst larger FOVs tend to minimise its effect on the image. Thus setting a wider FOV can sometimes help to reduce Motion Sickness during gameplay. If you are experiencing such problems in Half-Life 2, try changing the FOV to 90 using the command "<code>sv_cheats 1;fov 90</code>" in the console.
==The Player's FOV==
In {{Hl2|2}}, the player's vertical ''Field of View'' is set to 75 degrees by default. Screen settings aspect ratios are achieved by expanding the horizontal field of vision, not by cropping top and bottom portions of the image. Thus, the player will see more of the picture when using a widescreen aspect ratio than when using standard 4:3.


* '''[http://en.wikipedia.org/wiki/Perspective_distortion_%28photography%29 Perspective Distortion]''' : Wider FOVs introduce more Perspective Distortion into a image, whereas small FOVs tend to ''flatten'' perspective. The distortion is caused by projecting (spherical) optical geometry onto a flat screen - that's why IMAX Dome screens are curved. Like all optical artifacts, perspective distortion is much more noticeable in still images than in the moving images of FPS gameplay. For making more ''cinematic'' screenshots, use a smaller FOV and a larger camera-object distance.
You can change this value in three ways:
*By changing the [[Developer Console|console]] variable {{ent|fov}}. (This is flagged as a cheat.)
*By changing the [[Developer Console|console]] variable {{ent|fov_desired}}. (Some games may not have this variable, especially with older games and/or engine branch.)
*By using the {{ent|env_zoom}} map entity.


* Theoretically, an ''optically correct'' perspective can be obtained by matching the Camera's angle of view to the angle between the Player's eye and the edges of the image on his screen. Obviously this angle varies according to the actual size of the Player's screen and how far away from the screen he is actually sitting. Most players will be sitting close to a fairly small screen and unconsciously move their head position to obtain the most comfortable perspective. However, if using an unusually large screen (eg Overhead Projection) a suitable seat position can be calculated with :
=== Optimization ===
* '''[http://en.wikipedia.org/wiki/Motion_sickness Motion sickness]''' : Smaller FOVs tend to exaggerate camera movement, whilst larger FOVs tend to minimize its effect on the image. Thus setting a wider FOV can sometimes help to reduce motion sickness during gameplay. If you are experiencing such problems in ''Half-Life 2'', try changing the FOV to 90 using the command "<code>fov_desired 90</code>" in the console.
 
* '''[http://en.wikipedia.org/wiki/Perspective_distortion_%28photography%29 Perspective distortion]''' : Wider FOVs introduce more perspective distortion into a image, whereas small FOVs tend to ''flatten'' perspective. The distortion is caused by projecting (spherical) optical geometry onto a flat screen - that's why IMAX Dome screens are curved. Like all optical artifacts, perspective distortion is much more noticeable in still images than in the moving images of FPS gameplay. For making more ''cinematic'' screenshots, use a smaller FOV and a larger camera-object distance.
 
* Theoretically, an ''optically correct'' perspective can be obtained by matching the camera's angle of view to the angle between the player's eye and the edges of the image on his screen. Obviously, this angle varies according to the actual size of the player's screen and how far away from the screen he is actually sitting. Most players will be sitting close to a fairly small screen and unconsciously move their head position to obtain the most comfortable perspective. However, if using an unusually large screen (e.g., overhead projection), a suitable seat position can be calculated with :
  viewer distance = (screenwidth)/(2*tan(FOV/2))
  viewer distance = (screenwidth)/(2*tan(FOV/2))
so where the FOV is 75 degrees:  
so where the ''horizontal'' FOV is 75 degrees:  
  viewer distance = (screenwidth * 0.652)
  viewer distance = (screenwidth * 0.652)


== FOV calculations ==
=== FOV Calculations ===
* A useful rule of thumb: an object will appear twice as tall and twice as wide if the camera-to-object distance is halved. This is true for any FOV. This may be helpful when working with [[LOD]] distances such as making [[LOD Models]], [[MIP Mapping]] textures, and setting [[Fade Distance]]s.
* A useful rule of thumb: an object will appear twice as tall and twice as wide if the camera-to-object distance is halved. This is true for any FOV. This may be helpful when working with [[LOD]] distances such as making [[LOD Models]], [[MIP Mapping]] textures, and setting [[Fade Distance]]s.


Line 28: Line 38:
:* For 90&deg; Angle of View the ObjectScale = 0.5.
:* For 90&deg; Angle of View the ObjectScale = 0.5.
:* If you want it all in one formula (which is much less handy) : ''ObjectScreenWidth = ScreenResolution * ObjectWidth / (ObjectDistance * (2 tan (FOV/2)))''
:* If you want it all in one formula (which is much less handy) : ''ObjectScreenWidth = ScreenResolution * ObjectWidth / (ObjectDistance * (2 tan (FOV/2)))''
{{note| In Source, we work to a percentage of Horizontal FOV because Vertical FOV varies with Aspect Ratio settings. However, the ObjectScale in pixels is the same for both ObjectHeight and ObjectWidth.}}


== See also ==
== See also ==
* {{CSS}} {{ent|Info_view_parameters}}
* [[Wikipedia:Angle of view|Angle of view]] - a Wikipedia article on view angles.
* [[Wikipedia:Angle of view|Angle of view]] - a Wikipedia article on view angles.
* [[Wikipedia:Parallax|Parallax Motion]] - The Wikipedia article on parallax motion.
* [[Wikipedia:Parallax|Parallax Motion]] - The Wikipedia article on parallax motion.


[[Category:Camera]]
[[Category:Glossary]]
[[Category:Glossary]]
[[Category:Camera]]
 
 
{{stub}}

Latest revision as of 00:08, 12 November 2024

English (en)Español (es)Translate (Translate)

A Field of View (abbreviated FOV) is the maximum angle between the peripherals of a person's or camera's vision.

There are two types of fields of view—one for players and one for NPCs:

  • The player's FOV represents the Horizontal+ Angular Field of View (in all games since Source), (also in Sven Co-op version 5.04+ and Half-Life post-25th anniversary update), determining the angle of a geometrical viewwedge called a Frustum, whose rectangular cross-section corresponds to the player's rectangular screen.
    In GoldSrc and earlier titles (and older versions of Half-Life), it is Vertical- Angular Field of View instead.
  • The NPC FOV instead represents the Angular Field of View, determining the angle of its viewcone. (You can display NPC fields of view in-game with the console command npc_viewcone.)


The Player's FOV

In Half-Life 2 Half-Life 2, the player's vertical Field of View is set to 75 degrees by default. Screen settings aspect ratios are achieved by expanding the horizontal field of vision, not by cropping top and bottom portions of the image. Thus, the player will see more of the picture when using a widescreen aspect ratio than when using standard 4:3.

You can change this value in three ways:

  • By changing the console variable fov. (This is flagged as a cheat.)
  • By changing the console variable fov_desired. (Some games may not have this variable, especially with older games and/or engine branch.)
  • By using the env_zoom map entity.

Optimization

  • Motion sickness : Smaller FOVs tend to exaggerate camera movement, whilst larger FOVs tend to minimize its effect on the image. Thus setting a wider FOV can sometimes help to reduce motion sickness during gameplay. If you are experiencing such problems in Half-Life 2, try changing the FOV to 90 using the command "fov_desired 90" in the console.
  • Perspective distortion : Wider FOVs introduce more perspective distortion into a image, whereas small FOVs tend to flatten perspective. The distortion is caused by projecting (spherical) optical geometry onto a flat screen - that's why IMAX Dome screens are curved. Like all optical artifacts, perspective distortion is much more noticeable in still images than in the moving images of FPS gameplay. For making more cinematic screenshots, use a smaller FOV and a larger camera-object distance.
  • Theoretically, an optically correct perspective can be obtained by matching the camera's angle of view to the angle between the player's eye and the edges of the image on his screen. Obviously, this angle varies according to the actual size of the player's screen and how far away from the screen he is actually sitting. Most players will be sitting close to a fairly small screen and unconsciously move their head position to obtain the most comfortable perspective. However, if using an unusually large screen (e.g., overhead projection), a suitable seat position can be calculated with :
viewer distance = (screenwidth)/(2*tan(FOV/2))

so where the horizontal FOV is 75 degrees:

viewer distance = (screenwidth * 0.652)

FOV Calculations

  • A useful rule of thumb: an object will appear twice as tall and twice as wide if the camera-to-object distance is halved. This is true for any FOV. This may be helpful when working with LOD distances such as making LOD Models, MIP Mapping textures, and setting Fade Distances.
  • To calculate actual screen pixels is usually unnecessary, but quite straight forward:
    1. The trick is to bisect the "FOV" and use simple trigonometry to convert the Angle to a ratio of : FrameWidth / Distance = 2 (tan (FOV/2). So for the Player's 75° FOV, the FrameWidth = Distance * 1.535.
    2. This represents how much the Frame's dimension increases with distance - which is very useful in itself. But we want to know how an object "shrinks" (relative to the frame) over distance, so our ObjectScale is the inverse of the FrameScale, ie : 1/ (2(tan (FOV/2))). For the Player's 75° Angle of View, the ObjectScale is 1/1.535 == 0.652.
    3. An object which is 8 units wide and 512 units away from the Player covers ObjectScale * ObjectWidth / Distance == 0.652 * 8 / 512 = 1% of the horizontal FOV, which is 1% of the horizontal screen resolution.
    4. Now, if you half the distance or double the size of the object, it will cover 2% of the width of your screen.
    5. If your horizontal screen resolution is 1600 pixels, 1% of 1600 = 16 pixels, 2% = 32 pixels, etc.
  • If the ObjectWidth is the same as the Distance, then (for Player's 75°) 0.652 * 1/1 = 65%, which is close enough to remember : 64 unit wide object viewed at 64 units distance covers 64% of the screenwidth.
  • For 90° Angle of View the ObjectScale = 0.5.
  • If you want it all in one formula (which is much less handy) : ObjectScreenWidth = ScreenResolution * ObjectWidth / (ObjectDistance * (2 tan (FOV/2)))

See also


Stub

This article or section is a stub. You can help by expanding it.