Only push the far clip plane out if the sky is enabled

actorid
athile 15 years ago
parent f1278232d2
commit 82bbc69453

@ -137,16 +137,16 @@ void OMW::Engine::go()
// Used to control the player camera and position
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.
MWRender::InteriorCellRender rend(cell, scene);
// Load the cell and insert it into the renderer
rend.show();
// Optionally enable the sky
if (mEnableSky)
mpSkyManager = MWRender::SkyManager::create(mOgre.getWindow(), scene.getCamera());
std::cout << "Setting up input system\n";
// Sets up the input system

@ -141,7 +141,7 @@ void InteriorCellRender::configureFog()
float low = 200;
scene.getMgr()->setFog (FOG_LINEAR, color, 0, low, high);
scene.getCamera()->setFarClipDistance (high + 10 * 1000);
scene.getCamera()->setFarClipDistance (high + 10);
scene.getViewport()->setBackgroundColour (color);
}

@ -23,7 +23,6 @@ MWScene::MWScene(Render::OgreRenderer &_rend)
// Create the camera
camera = sceneMgr->createCamera("PlayerCam");
camera->setNearClipDistance(5);
// Create one viewport, entire window
@ -36,8 +35,6 @@ MWScene::MWScene(Render::OgreRenderer &_rend)
// Set default mipmap level (NB some APIs ignore this)
TextureManager::getSingleton().setDefaultNumMipmaps(5);
// Load resources
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

@ -50,6 +50,9 @@ namespace MWRender
// Disable fog since OpenMW is handling OGRE fog elsewhere
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
pRenderWindow->addListener(mpCaelumSystem);
Root::getSingletonPtr()->addFrameListener(mpCaelumSystem);

Loading…
Cancel
Save