-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically adjust field of view for widescreen aspect ratios #1322
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I have pointed out an issue with the code, I don't know if this is generally a good idea.
Most people who change FOV are attempting to set specific values and this change results in behaviour which is fairly hidden from the user. Most people would probably be left wondering why the values they set aren't properly reflected.
That being said, it should be noted that FOV is already aspect-corrected in Cube 2 and family on the Y-axis, rather than the X-axis as is being done here. I don't know if this was ported to AC but I do know the change was done in the last decade or so, which is after AC forked from Cube 1.
I think if this were to be merged, it'd need to be an optional component, rather than a forced default, but I invite further discussion on the issue.
The FOV value is now always interpreted as being a 4:3 horizontal FOV value. It will be automatically scaled for different aspect ratios (which results in a horizontal FOV of ~106.26 degrees on 16:9, for example). This provides a better out of the box experience for most players, since 16:9 is the norm for gaming nowadays (or even wider on mobile). Default FOV values were changed to be less extreme at wider aspect ratios.
45b58f0
to
ba3c1cd
Compare
|
||
// automatic FOV adjustment for wide screens | ||
// (horizontal FOV value is always specified for 4:3, but scaled for different aspect ratios) | ||
return atan(tan(resultfov * M_PI / 360.0f) * 0.75f * aspect) * 360.0f / M_PI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a change that drastically changes the expected behavior of the FOV math, this should be behind an additional variable that enables/disables this. Gate it behind "fovaltaspectcorrect" variable and I think it'll be good to merge.
Inspired by assaultcube/AC#424.
The FOV value is now always interpreted as being a 4:3 horizontal FOV value. It will be automatically scaled for different aspect ratios (which results in a horizontal FOV of ~106.26 degrees on 16:9, for example).
This provides a better out of the box experience for most players, since 16:9 is the norm for gaming nowadays (or even wider on mobile).
Default FOV values were changed to be less extreme at wider aspect ratios.
Preview
/firstpersonfov 90
is used on both screenshots. Aspect ratio is 16:9.Before
After