mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 14:09:39 +00:00
Only push the far clip plane out if the sky is enabled
This commit is contained in:
parent
f1278232d2
commit
82bbc69453
4 changed files with 8 additions and 8 deletions
|
@ -137,16 +137,16 @@ void OMW::Engine::go()
|
||||||
// Used to control the player camera and position
|
// Used to control the player camera and position
|
||||||
MWRender::PlayerPos player(scene.getCamera());
|
MWRender::PlayerPos player(scene.getCamera());
|
||||||
|
|
||||||
// Optionally enable the sky
|
|
||||||
if (mEnableSky)
|
|
||||||
mpSkyManager = MWRender::SkyManager::create(mOgre.getWindow(), scene.getCamera());
|
|
||||||
|
|
||||||
// This connects the cell data with the rendering scene.
|
// This connects the cell data with the rendering scene.
|
||||||
MWRender::InteriorCellRender rend(cell, scene);
|
MWRender::InteriorCellRender rend(cell, scene);
|
||||||
|
|
||||||
// Load the cell and insert it into the renderer
|
// Load the cell and insert it into the renderer
|
||||||
rend.show();
|
rend.show();
|
||||||
|
|
||||||
|
// Optionally enable the sky
|
||||||
|
if (mEnableSky)
|
||||||
|
mpSkyManager = MWRender::SkyManager::create(mOgre.getWindow(), scene.getCamera());
|
||||||
|
|
||||||
std::cout << "Setting up input system\n";
|
std::cout << "Setting up input system\n";
|
||||||
|
|
||||||
// Sets up the input system
|
// Sets up the input system
|
||||||
|
|
|
@ -141,7 +141,7 @@ void InteriorCellRender::configureFog()
|
||||||
float low = 200;
|
float low = 200;
|
||||||
|
|
||||||
scene.getMgr()->setFog (FOG_LINEAR, color, 0, low, high);
|
scene.getMgr()->setFog (FOG_LINEAR, color, 0, low, high);
|
||||||
scene.getCamera()->setFarClipDistance (high + 10 * 1000);
|
scene.getCamera()->setFarClipDistance (high + 10);
|
||||||
scene.getViewport()->setBackgroundColour (color);
|
scene.getViewport()->setBackgroundColour (color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ MWScene::MWScene(Render::OgreRenderer &_rend)
|
||||||
|
|
||||||
// Create the camera
|
// Create the camera
|
||||||
camera = sceneMgr->createCamera("PlayerCam");
|
camera = sceneMgr->createCamera("PlayerCam");
|
||||||
|
|
||||||
camera->setNearClipDistance(5);
|
camera->setNearClipDistance(5);
|
||||||
|
|
||||||
// Create one viewport, entire window
|
// Create one viewport, entire window
|
||||||
|
@ -36,8 +35,6 @@ MWScene::MWScene(Render::OgreRenderer &_rend)
|
||||||
// Set default mipmap level (NB some APIs ignore this)
|
// Set default mipmap level (NB some APIs ignore this)
|
||||||
TextureManager::getSingleton().setDefaultNumMipmaps(5);
|
TextureManager::getSingleton().setDefaultNumMipmaps(5);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Load resources
|
// Load resources
|
||||||
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
|
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,9 @@ namespace MWRender
|
||||||
// Disable fog since OpenMW is handling OGRE fog elsewhere
|
// Disable fog since OpenMW is handling OGRE fog elsewhere
|
||||||
mpCaelumSystem->setManageSceneFog(false);
|
mpCaelumSystem->setManageSceneFog(false);
|
||||||
|
|
||||||
|
// Change the camera far distance to make sure the sky is not clipped
|
||||||
|
pCamera->setFarClipDistance(50000);
|
||||||
|
|
||||||
// Register Caelum as an OGRE listener
|
// Register Caelum as an OGRE listener
|
||||||
pRenderWindow->addListener(mpCaelumSystem);
|
pRenderWindow->addListener(mpCaelumSystem);
|
||||||
Root::getSingletonPtr()->addFrameListener(mpCaelumSystem);
|
Root::getSingletonPtr()->addFrameListener(mpCaelumSystem);
|
||||||
|
|
Loading…
Reference in a new issue