mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-05 19:19:44 +00:00
Fix a problem with statics disappearing sometimes on the map
Ogre::StaticGeometry doesn't seem to like materials being changed at runtime. It stores raw pointers to Ogre::Technique objects also, which conflicts with shiny's way of managing "unloaded" materials as having zero techniques. If a static geometry object is baked from an unloaded material, it won't find any techniques to use and can't render. By moving the unload call afterwards, it will be detected as in use by a renderable and won't be unloaded. Ideally this needs fixing of Ogre::StaticGeometry to not hold on to Technique objects (they also currently need to be rebuilt whenever user settings are changed, which also causes "unloading" of materials)
This commit is contained in:
parent
60563afc10
commit
4983d08fe4
2 changed files with 4 additions and 4 deletions
|
@ -197,11 +197,11 @@ void LocalMap::render(const float x, const float y,
|
|||
const float zlow, const float zhigh,
|
||||
const float xw, const float yw, const std::string& texture)
|
||||
{
|
||||
//mCellCamera->setFarClipDistance( (zhigh-zlow) * 1.1 );
|
||||
mCellCamera->setFarClipDistance(0); // infinite
|
||||
mCellCamera->setFarClipDistance( (zhigh-zlow) + 2000 );
|
||||
mCellCamera->setNearClipDistance(50);
|
||||
|
||||
mCellCamera->setOrthoWindow(xw, yw);
|
||||
mCameraNode->setPosition(Vector3(x, y, zhigh+100000));
|
||||
mCameraNode->setPosition(Vector3(x, y, zhigh+1000));
|
||||
|
||||
// disable fog (only necessary for fixed function, the shader based
|
||||
// materials already do this through local_map material configuration)
|
||||
|
|
|
@ -235,8 +235,8 @@ void RenderingManager::toggleWater()
|
|||
|
||||
void RenderingManager::cellAdded (MWWorld::Ptr::CellStore *store)
|
||||
{
|
||||
sh::Factory::getInstance().unloadUnreferencedMaterials();
|
||||
mObjects.buildStaticGeometry (*store);
|
||||
sh::Factory::getInstance().unloadUnreferencedMaterials();
|
||||
mDebugging->cellAdded(store);
|
||||
if (store->mCell->isExterior())
|
||||
mTerrainManager->cellAdded(store);
|
||||
|
|
Loading…
Reference in a new issue