diff options
| author | Tilka <tilkax@gmail.com> | 2020-06-27 18:00:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-27 18:00:48 +0100 |
| commit | b36ab8360ed17bd70ee7e1cec8db7d62a534b626 (patch) | |
| tree | 4a80dcd30b11440db769ba24eb18d8ba2883f316 /Source/Core/VideoCommon/VertexShaderManager.cpp | |
| parent | 1ab37990b12fd327f48786ab76daeda17feb7af2 (diff) | |
| parent | bb6582783bfefe6843a73d504690a1f1490fa9f1 (diff) | |
Merge pull request #8820 from iwubcode/freelook_field_of_view
Core / VideoCommon / DolphinQt - allow tweaking freelook camera's field of view
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderManager.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 6c65a86efa..8666e7b311 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -355,14 +355,17 @@ void VertexShaderManager::SetConstants() switch (xfmem.projection.type) { case GX_PERSPECTIVE: - g_fProjectionMatrix[0] = rawProjection[0] * g_ActiveConfig.fAspectRatioHackW; + { + const Common::Vec2 fov = + g_ActiveConfig.bFreeLook ? g_freelook_camera.GetFieldOfView() : Common::Vec2{1, 1}; + g_fProjectionMatrix[0] = rawProjection[0] * g_ActiveConfig.fAspectRatioHackW * fov.x; g_fProjectionMatrix[1] = 0.0f; - g_fProjectionMatrix[2] = rawProjection[1] * g_ActiveConfig.fAspectRatioHackW; + g_fProjectionMatrix[2] = rawProjection[1] * g_ActiveConfig.fAspectRatioHackW * fov.x; g_fProjectionMatrix[3] = 0.0f; g_fProjectionMatrix[4] = 0.0f; - g_fProjectionMatrix[5] = rawProjection[2] * g_ActiveConfig.fAspectRatioHackH; - g_fProjectionMatrix[6] = rawProjection[3] * g_ActiveConfig.fAspectRatioHackH; + g_fProjectionMatrix[5] = rawProjection[2] * g_ActiveConfig.fAspectRatioHackH * fov.y; + g_fProjectionMatrix[6] = rawProjection[3] * g_ActiveConfig.fAspectRatioHackH * fov.y; g_fProjectionMatrix[7] = 0.0f; g_fProjectionMatrix[8] = 0.0f; @@ -377,9 +380,11 @@ void VertexShaderManager::SetConstants() g_fProjectionMatrix[15] = 0.0f; g_stats.gproj = g_fProjectionMatrix; - break; + } + break; case GX_ORTHOGRAPHIC: + { g_fProjectionMatrix[0] = rawProjection[0]; g_fProjectionMatrix[1] = 0.0f; g_fProjectionMatrix[2] = 0.0f; @@ -403,7 +408,8 @@ void VertexShaderManager::SetConstants() g_stats.g2proj = g_fProjectionMatrix; g_stats.proj = rawProjection; - break; + } + break; default: ERROR_LOG(VIDEO, "Unknown projection type: %d", xfmem.projection.type); |
