### Author Topic: Default FoV  (Read 4125 times)

0 Members and 1 Guest are viewing this topic.

#### Spoon

• 212
• ヾ(´︶`♡)ﾉ
##### Default FoV
From the What would you like to see in a 'Freespace 1 Blue'? thread:

That's because -fov 0.75 in Freespace isn't the same as setting FOV to 75 in other games. Most games have a direct correlation between their FOV settting and the actual Field of View in degrees. In Freespace the default 0.75 FOV is actually something else. It's the vertical angle of view, in radians, multiplied by 1.39626348. for some reason.

First, you'd have to convert 0.75 radians to degrees which would be ~43 degrees.
Next you multiply that by 1.39626348 to get ~60 AoV. How this converts to FoV depends on your monitor's aspect ratio, but let's assume you're using a 16:9 widescreen one. Multiply 60 by (16/9) and you get 106.666...

The default Freespace FOV for a 16:9 monitor is actually ~107 degrees, which is quite high and this is why it causes "fisheye" distortions and makes big ships less impressive.

For a 16:9 monitor you need to divide whatever FOV you actually want by 142.2222 to get the number you need to use with the -fov flag. So if you want a 90 degree FOV you need to use -fov 0.6328.

On an old school 4:3 monitor the default FoV would be only 80, something that's much more natural.
I'm just thinking on how to get this information more widespread known to all the players. The fisheye effect is there, but its so much harder to notice in a space game with no good points of visual reference. So a lot of players are going to end up playing on a too wide of a FoV by default and then feel the scales for the ships are off. (incidently, I've been using default FoV for a long time myself, but my screens are 16:10). I feel ideally the scp should make the default to say 0.65 (so 85 fov on 16:10 and 94 fov on 16:9) or have it listed as a note on the launchers that FoV should probably be adjusted for a better experience. Or something.

Thoughts, opinions?
We're still having a default FoV that is basically tailored for 4:3 screens, while being in the year of our lord 2016.
Considering like half the WoD troubleshooting was caused by people not setting the resolution from 640x480 to something else in the launcher makes me feel not exactly hopeful that informing the player about FoV will get the point across. Setting the default to something else or have it auto adjust depending on screen size seems like the more idea solution in my book.
« Last Edit: July 02, 2016, 02:55:56 pm by Spoon »
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

#### Axem

• 211
##### Re: Default FoV
Yeah and a new command flag like -fovdeg where you go would input the desired angle in degrees and have the game auto do some hidden calculations would probably help a lot.

(So literally everything you said)

#### karajorma

• King Louie - Jungle VIP
• 214
##### Re: Default FoV
have it auto adjust depending on screen size seems like the more idea solution in my book.

This gets my vote. If no -fov flag is set it should just take a guess from the resolution.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

#### m!m

• 211
##### Re: Default FoV
I'm not exactly sure how the math would work but if you have a desired (horizontal or vertical) field of view you should be able to compute the right perspective projection matrix independently of the actually used resolution.

• 27
##### Re: Default FoV
Not too long ago, I took a look at a CMS (Content Managemen System, for those not heavily into web design and development) that I helped write back when I knew nothing about PHP/MySQL interactions, so I was working UI while a former friend worked the backend. One of the things he did that I absolutely detested was that he wrote indivual create/update functions for each table of the database. For those that know a bit about PHP/MySQL interactions, you're probably already facepalming. For those that don't, here's the deal. Since this was supposed to be a framework for websites that gets used and reused, that meant that each time it got used for a new site, I would have to go in and change several individual functions around to match table and field names. And this was also the way the lookup functions were written. I was going to refactor the thing, but after a few attempts, I realized it would be easier to write a new one. One where the server does as much of the work as possible. Using SHOW TABLES to generate an array that PHP uses to have the data for the lookup functions; have a create/update function that takes arguments from the form calling it to determine table and field names and if it's creating or updating a record; attempting to use directory lookup to procedurally generate a navigation bar, though I have to be careful with that because it will pull in alphabetical order, so I have to make sure of a sort order or logic to make sure the link to the main page is always on top; etc.

My point being, of course, I'm all for making the computers do the work instead of us, with allowances to adjust for personal taste.
There are only 10 kinds of people in the world;
those who understand binary and those who don't.

#### Yarn

• 210
##### Re: Default FoV
I figured out a formula that should produce a good FOV value for any aspect ratio in the 5:4-16:9 range:

sqrt( FOV^2 * (4/3) / AR )

where:

FOV = the requested vertical field of view (default is 0.75)
AR = aspect ratio, represented as the result of width / height

Assuming FOV is 0.75, this is equivalent to -fov 0.75 for 4:3, about -fov 0.68 for 16:10, and about -fov 0.65 for 16:9.

To ensure that players with very wide displays don't lose too much of the top and bottom, AR should probably be capped at a certain value, such as 16/9.

Also, AR should be derived from the center resolution (center_w and center_h), not the main resolution (max_w and max_h). This way, players using multiple monitors will get an FOV that's appropriate for the center monitor (which might be narrower than 16:9) rather than the entire viewing area.
« Last Edit: July 07, 2016, 04:49:01 pm by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

#### FrikgFeek

• 210
##### Re: Default FoV
That's pretty good for adjusting FOV based on aspect ratio but I'd still prefer a straight out -fovdeg flag or something that does the full calculations and gives you the desired FOV in degrees. Not the vertical AoV in radians multiplied by some random number.
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

#### Yarn

• 210
##### Re: Default FoV
Well, the formula doesn't have to (and probably shouldn't) be used if an explicit FOV is given, whether with -fov or -fovdeg.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

#### Lykurgos88

• 27
##### Re: Default FoV
Here is a comparison for your enjoyment:

Fov 30

Fov 60

Fov 75 (default)

Fov 90

#### Kobrar44

• On Suspended Sentence
• 29
• Let me tilerape it for you!
##### Re: Default FoV
Default fov gives you like 90 degree view angle horizontally, it is actually super standard. Unless you have a console. I don't think that is really too wide. Also, any sort of auto-adjusting could hurt mods with cockpits. I know these are badly implemented, but it's all we have right now.
Oh guys, use that [ url ][ img ][ /img ][ /url ] :/

#### FrikgFeek

• 210
##### Re: Default FoV
It's ~107 for 16:9 monitors and 96 for 16:10. Since most people are on 16:9 monitors I'd say 107 is really damn high. That's 17 degrees higher than the standard 90.

Or not, whoops.
« Last Edit: July 08, 2016, 06:30:43 am by FrikgFeek »
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

#### Kobrar44

• On Suspended Sentence
• 29
• Let me tilerape it for you!
##### Re: Default FoV
Why 107? Its 60 vertically. 60/2 = 30. tg30 = sqrt(3)/3. sqrt(3)/3*16/9 = 16sqrt(3)/27. arctg 16sqrt(3)/27 = 45.75 degrees. 2* 45.75 degrees = 91.5 degrees. 1.5 degree more than industry standard.

60 * 16/9 isn't really how trigonometry works. Unless FSO uses some crazy ass weird projection, but in that case, why would it. You need ~ 59 vertically to achieve 90 horizontally on 16:9.
Oh guys, use that [ url ][ img ][ /img ][ /url ] :/

• 211
• The Cthulhu programmer himself!
##### Re: Default FoV
Why 107?
That's because -fov 0.75 in Freespace isn't the same as setting FOV to 75 in other games. Most games have a direct correlation between their FOV settting and the actual Field of View in degrees. In Freespace the default 0.75 FOV is actually something else. It's the vertical angle of view, in radians, multiplied by 1.39626348. for some reason.

First, you'd have to convert 0.75 radians to degrees which would be ~43 degrees.
Next you multiply that by 1.39626348 to get ~60 AoV. How this converts to FoV depends on your monitor's aspect ratio, but let's assume you're using a 16:9 widescreen one. Multiply 60 by (16/9) and you get 106.666...

The default Freespace FOV for a 16:9 monitor is actually ~107 degrees, which is quite high and this is why it causes "fisheye" distortions and makes big ships less impressive.

For a 16:9 monitor you need to divide whatever FOV you actually want by 142.2222 to get the number you need to use with the -fov flag. So if you want a 90 degree FOV you need to use -fov 0.6328.

On an old school 4:3 monitor the default FoV would be only 80, something that's much more natural.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought.
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

#### FrikgFeek

• 210
##### Re: Default FoV
I thought FSO just uses some weird ass scaling but it seems to use standard hor+, took some screenshots with different resolutions to compare.

Still, doesn't change the fact that the default FOV causes fisheye distortions with big ships or skyboxes near the edge of the screen and it's pretty noticable. Just look at how weirdly stretched that herc2 is with the default FOV  in Lykurgos' screenshot. And if you fly near a big ship and turn up/down the stretching is extremely obvious and just looks bad. So maybe the problem isn't that the default FOV is too high as a value but that FSO just doesn't play nice with a standard 90 FOV.

But yeah, the default FOV is indeed just above 90 for a 16:9 resolution, sorry for messing that up. If you target a fighter right near the edge of the screen and then turn the view 90 degrees with the view right/left commands that fighter will still be close to the edge of your screen, meaning it's ~45 degrees or so from the centre to the edge. Seems FSO uses the videogame standard rectilinear projection, which is slightly sub-optimal at higher FOVs as you'll be looking up/down as much as you will left/right.

I mean, just look at THIS

Also I really need to reconfigure my lighting settings, make them more appropriate for the new PBR builds.
« Last Edit: July 08, 2016, 07:23:30 am by FrikgFeek »
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

#### Flaser

• 210
• man/fish warsie
##### Re: Default FoV
Just a 5c: if fov could be changed on the fly, it'd be pretty much a "zoom"  feature. For default FS this isn't important, but would be useful for more "simmy" TCs with virtual cockpits.
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan

• 211
• The Cthulhu programmer himself!
##### Re: Default FoV
Just a 5c: if fov could be changed on the fly, it'd be pretty much a "zoom"  feature. For default FS this isn't important, but would be useful for more "simmy" TCs with virtual cockpits.
This can already be done, both with SEXPs and with Lua scripting.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought.
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

#### Yarn

• 210
##### Re: Default FoV
In light of what Kobrar44 has said, here's my revised formula:

atan(sqrt( tan(FOV * Z)^2 * (4/3) / AR )) / Z

where:

FOV = the uncorrected requested vertical field of view in radians (default is 0.75)
AR = aspect ratio, represented as the result of width / height
Z = half of 1.39626348 (0.69813174)

Assuming FOV is 0.75, this new formula is equivalent to -fov 0.75 for 4:3, about -fov 0.69 for 16:10, and about -fov 0.66 for 16:9.

My previous notes apply to this formula too.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178