1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

fix batch lighting, removed the "bumping number of lights" hack

This commit is contained in:
scrawl 2012-03-04 23:18:40 +01:00
parent 332671b43d
commit ff8f95fcca
2 changed files with 9 additions and 2 deletions

View file

@ -101,6 +101,14 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
sg = mRenderer.getScene()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
//Create the scenenode and put it in the map
mStaticGeometry[ptr.getCell()] = sg;
// This specifies the size of a single batch region.
// If it is set too high:
// - there will be problems choosing the correct lights
// - the culling will be more inefficient
// If it is set too low:
// - there will be too many batches.
sg->setRegionDimensions(Ogre::Vector3(1000,1000,1000));
}
else
{
@ -108,7 +116,6 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
}
sg->addEntity(ent,insert->_getDerivedPosition(),insert->_getDerivedOrientation(),insert->_getDerivedScale());
sg->setRegionDimensions(Ogre::Vector3(100000,10000,100000));
mRenderer.getScene()->destroyEntity(ent);
}

View file

@ -350,7 +350,7 @@ void NIFLoader::createMaterial(const String &name,
float num_lights;
if (GpuProgramManager::getSingleton().isSyntaxSupported("fp40") ||
GpuProgramManager::getSingleton().isSyntaxSupported("ps_4_0"))
num_lights = 16 /* 32 */;
num_lights = 8 /* 32 */;
else
num_lights = 8;