diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 9b0fc4816..143f62792 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -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 diff --git a/apps/openmw/mwrender/interior.cpp b/apps/openmw/mwrender/interior.cpp index 8292888f0..e85d09722 100644 --- a/apps/openmw/mwrender/interior.cpp +++ b/apps/openmw/mwrender/interior.cpp @@ -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); } diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index 171bc108c..08172f885 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -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(); diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index ec3e8a1b7..bcd40457f 100755 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -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);