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

Camera FOV rework #3139

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Mar 10, 2024

With this ticket I try to clear some confusion about adjusting FOV and the meaning of the slider(s) in Top Menubar UI.

The slider is actually context sensitive; We have multiple presets:

  • gfx_static_cam_fov_exp ~ (smooth) ~ A "zoom factor" of static camera (the actual FOV is dynamic based on distance); Adjust by 'Ctrl+mouse wheel' or TopMenubar/Settings.
  • gfx_fov_internal ~ (stepped) ~ FOV of cinecam; Adjust by hotkeys EV_COMMON_FOV_{LESS/MORE/RESET}.
  • gfx_fov_external ~ (stepped) ~ FOV of exterior cameras (3rd person, free cam, freefixed cam), adjustable by hotkeys. EV_COMMON_FOV_{LESS/MORE/RESET}.

To start this off, I clarified and commented the code in Top Menubar (as well as related CameraManager code), and I added a combobox to select camera mode:
obrazek

Note: having FOV stepped in whole numbers is sort of a convention; thing is, angle degrees aren't typical (base 10) numbers but base 60 numbers, meaning 1 Degree = 60 Angular Minutes. Using a float to represent FOV in degrees would be kind of bastardized, but I think I'll do it anyway.

@ohlidalp ohlidalp changed the title Danmackey fov rework Camera FOV rework Mar 10, 2024
Changes:
* cvar `gfx_camera_speed` replaces `CameraManager::m_cam_ratio` which was used/updated chaotically and didn't always account frame time. Default value is 4.0 like before.
* New `smoothXXX()` helpers to CameraManager, replacing copypasted smoothing code.
* Clarified staticcam fov exponent smoothing: Removed `Cameramanager::m_staticcam_fov_exponent` which just duplicated `gfx_static_cam_fov_exp`. Added `Cameramanager::m_staticcam_fov_exp_current` which replaces `static fovExp` (CameraManager.cpp, line 789). Comments clearly indicate what is what.
@ohlidalp
Copy link
Member Author

ohlidalp commented Mar 11, 2024

I analyzed how the smoothing works and added a slider for it. I didn't add smoothing anywhere, but all existing smoothed values were unified around this slider. Default value is 4.0 which is the same as before (although the code was finnicky so it may not be always in effect).

obrazek

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.

1 participant