Skip to content
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

FOV: fix rare CalcFov+viewsize glitches #1004

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

hemostx
Copy link
Contributor

@hemostx hemostx commented Jan 21, 2025

3.0 added more math to mostly classic, GLQWCL CalcFov to try and derive FOV from a reference 4:3 ratio.
This accomodated everything above 4:3, which was becoming the norm at the time.
3.0.1 also added a letterbox option which somewhat "maintains" FOV for viewsize < 100 - for ratios 4:3+.

Viewport size is not always strictly proportional to the vid size, due to the varying margins that are added - i.e, the aspect ratios do not always match.
However, classic GLQWCL CalcFov always worked on viewport size, whether it was the screen size or not - so there was never a problem.

3.0.1+ passes the viewport size and the vid size and takes both into account for 4:3+, but still only works from vid size under 4:3.
Result: in some rare combinations at those narrow ratios, the viewport and screen ratios will go out of whack and Calcfov gives a horizontal fov too wide for the viewport (glitches!)

This patch adds the same 3.0.1 height/width vs view_height/width viewsize fix to the existing "anything under 4:3" clause.
Everything else remains unchanged.

3.0 added more math to mostly classic, GLQWCL CalcFov to try and derive FOV from a reference 4:3 ratio.
This accomodated everything above 4:3, which was becoming the norm at the time.
3.0.1 also added a letterbox option which somewhat "maintains" FOV for `viewsize < 100` - for ratios 4:3+.

Viewport size is not always strictly proportional to the vid size, due to the varying margins that are added - i.e, the aspect ratios do not always match.
However, classic GLQWCL CalcFov always worked on viewport size, whether it was the screen size or not - so there was never a problem.

3.0.1+ passes the viewport size *and* the vid size and takes both into account for 4:3+, but still only works from vid size under 4:3.
Result: in some rare combinations at those narrow ratios, the viewport and screen ratios will go out of whack and Calcfov gives a horizontal fov too wide for the viewport (glitches!)

This patch adds the same 3.0.1 `height/width` vs `view_height/width` viewsize fix to the existing "anything under 4:3" clause.
Everything else remains unchanged.
@hemostx hemostx changed the title H fovx fix FOV: fix rare CalcFov+viewsize glitches Jan 21, 2025
@tcsabina tcsabina merged commit 4093db5 into QW-Group:master Jan 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants