mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 03:39:55 +00:00
improved composite map, now adapts to the ambient/diffuse light
This commit is contained in:
parent
f2c3616638
commit
be5555956c
@ -232,17 +232,17 @@ void RenderingManager::setAmbientMode()
|
||||
{
|
||||
case 0:
|
||||
|
||||
mRendering.getScene()->setAmbientLight(mAmbientColor);
|
||||
setAmbientColour(mAmbientColor);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
mRendering.getScene()->setAmbientLight(0.7f*mAmbientColor + 0.3f*ColourValue(1,1,1));
|
||||
setAmbientColour(0.7f*mAmbientColor + 0.3f*ColourValue(1,1,1));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
mRendering.getScene()->setAmbientLight(ColourValue(1,1,1));
|
||||
setAmbientColour(ColourValue(1,1,1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -297,11 +297,13 @@ void RenderingManager::skipAnimation (const MWWorld::Ptr& ptr)
|
||||
void RenderingManager::setSunColour(const Ogre::ColourValue& colour)
|
||||
{
|
||||
mSun->setDiffuseColour(colour);
|
||||
mTerrainManager->setDiffuse(colour);
|
||||
}
|
||||
|
||||
void RenderingManager::setAmbientColour(const Ogre::ColourValue& colour)
|
||||
{
|
||||
mRendering.getScene()->setAmbientLight(colour);
|
||||
mTerrainManager->setAmbient(colour);
|
||||
}
|
||||
|
||||
void RenderingManager::sunEnable()
|
||||
|
@ -73,6 +73,20 @@ namespace MWRender
|
||||
OGRE_DELETE mTerrainGroup;
|
||||
OGRE_DELETE mTerrainGlobals;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
void TerrainManager::setDiffuse(const Ogre::ColourValue& diffuse)
|
||||
{
|
||||
mTerrainGlobals->setCompositeMapDiffuse(diffuse);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
void TerrainManager::setAmbient(const Ogre::ColourValue& ambient)
|
||||
{
|
||||
mTerrainGlobals->setCompositeMapAmbient(ambient);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -31,6 +31,9 @@ namespace MWRender{
|
||||
TerrainManager(Ogre::SceneManager*);
|
||||
virtual ~TerrainManager();
|
||||
|
||||
void setDiffuse(const Ogre::ColourValue& diffuse);
|
||||
void setAmbient(const Ogre::ColourValue& ambient);
|
||||
|
||||
void cellAdded(MWWorld::Ptr::CellStore* store);
|
||||
void cellRemoved(MWWorld::Ptr::CellStore* store);
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user