mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 18:45:34 +00:00
Use updated resolutions when setting projection matrix
This commit is contained in:
parent
0eed275b74
commit
a7166aa05c
1 changed files with 5 additions and 2 deletions
|
@ -1138,7 +1138,10 @@ namespace MWRender
|
||||||
|
|
||||||
void RenderingManager::updateProjectionMatrix()
|
void RenderingManager::updateProjectionMatrix()
|
||||||
{
|
{
|
||||||
double aspect = mViewer->getCamera()->getViewport()->aspectRatio();
|
double width = Settings::Manager::getInt("resolution x", "Video");
|
||||||
|
double height = Settings::Manager::getInt("resolution y", "Video");
|
||||||
|
|
||||||
|
double aspect = (height == 0.0) ? 1.0 : width / height;
|
||||||
float fov = mFieldOfView;
|
float fov = mFieldOfView;
|
||||||
if (mFieldOfViewOverridden)
|
if (mFieldOfViewOverridden)
|
||||||
fov = mFieldOfViewOverride;
|
fov = mFieldOfViewOverride;
|
||||||
|
@ -1155,7 +1158,7 @@ namespace MWRender
|
||||||
|
|
||||||
mSharedUniformStateUpdater->setNear(mNearClip);
|
mSharedUniformStateUpdater->setNear(mNearClip);
|
||||||
mSharedUniformStateUpdater->setFar(mViewDistance);
|
mSharedUniformStateUpdater->setFar(mViewDistance);
|
||||||
mSharedUniformStateUpdater->setScreenRes(mViewer->getCamera()->getViewport()->width(), mViewer->getCamera()->getViewport()->height());
|
mSharedUniformStateUpdater->setScreenRes(width, height);
|
||||||
|
|
||||||
// Since our fog is not radial yet, we should take FOV in account, otherwise terrain near viewing distance may disappear.
|
// Since our fog is not radial yet, we should take FOV in account, otherwise terrain near viewing distance may disappear.
|
||||||
// Limit FOV here just for sure, otherwise viewing distance can be too high.
|
// Limit FOV here just for sure, otherwise viewing distance can be too high.
|
||||||
|
|
Loading…
Reference in a new issue