|
|
@ -40,7 +40,8 @@ using namespace Ogre;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MWRender {
|
|
|
|
namespace MWRender {
|
|
|
|
|
|
|
|
|
|
|
|
RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine)
|
|
|
|
RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir,
|
|
|
|
|
|
|
|
const boost::filesystem::path& cacheDir, OEngine::Physic::PhysicEngine* engine)
|
|
|
|
:mRendering(_rend), mObjects(mRendering), mActors(mRendering), mAmbientMode(0), mSunEnabled(0), mPhysicsEngine(engine)
|
|
|
|
:mRendering(_rend), mObjects(mRendering), mActors(mRendering), mAmbientMode(0), mSunEnabled(0), mPhysicsEngine(engine)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// select best shader mode
|
|
|
|
// select best shader mode
|
|
|
@ -63,7 +64,9 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
|
|
|
|
|
|
|
|
|
|
|
// material system
|
|
|
|
// material system
|
|
|
|
sh::OgrePlatform* platform = new sh::OgrePlatform("General", (resDir / "materials").string());
|
|
|
|
sh::OgrePlatform* platform = new sh::OgrePlatform("General", (resDir / "materials").string());
|
|
|
|
platform->setCacheFolder ("./");
|
|
|
|
if (!boost::filesystem::exists (cacheDir))
|
|
|
|
|
|
|
|
boost::filesystem::create_directory (cacheDir);
|
|
|
|
|
|
|
|
platform->setCacheFolder (cacheDir.string());
|
|
|
|
mFactory = new sh::Factory(platform);
|
|
|
|
mFactory = new sh::Factory(platform);
|
|
|
|
|
|
|
|
|
|
|
|
sh::Language lang;
|
|
|
|
sh::Language lang;
|
|
|
@ -75,6 +78,11 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
|
|
|
else
|
|
|
|
else
|
|
|
|
lang = sh::Language_CG;
|
|
|
|
lang = sh::Language_CG;
|
|
|
|
mFactory->setCurrentLanguage (lang);
|
|
|
|
mFactory->setCurrentLanguage (lang);
|
|
|
|
|
|
|
|
mFactory->setWriteSourceCache (true);
|
|
|
|
|
|
|
|
mFactory->setReadSourceCache (true);
|
|
|
|
|
|
|
|
mFactory->setReadMicrocodeCache (true);
|
|
|
|
|
|
|
|
mFactory->setWriteMicrocodeCache (true);
|
|
|
|
|
|
|
|
|
|
|
|
mFactory->loadAllFiles();
|
|
|
|
mFactory->loadAllFiles();
|
|
|
|
|
|
|
|
|
|
|
|
// Set default mipmap level (NB some APIs ignore this)
|
|
|
|
// Set default mipmap level (NB some APIs ignore this)
|
|
|
|