mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
stop making new reflacttetures at intext change
This commit is contained in:
parent
7c46102f0c
commit
6c310c64d2
@ -336,14 +336,7 @@ public:
|
||||
setName("ReflectionCamera");
|
||||
setCullCallback(new InheritViewPointCallback);
|
||||
|
||||
int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water");
|
||||
reflectionDetail = std::min(4, std::max(isInterior ? 2 : 0, reflectionDetail));
|
||||
unsigned int extraMask = 0;
|
||||
if(reflectionDetail >= 1) extraMask |= Mask_Terrain;
|
||||
if(reflectionDetail >= 2) extraMask |= Mask_Static;
|
||||
if(reflectionDetail >= 3) extraMask |= Mask_Effect|Mask_ParticleSystem|Mask_Object;
|
||||
if(reflectionDetail >= 4) extraMask |= Mask_Player|Mask_Actor;
|
||||
setCullMask(Mask_Scene|Mask_Sky|Mask_Lighting|extraMask);
|
||||
setInterior(isInterior);
|
||||
setNodeMask(Mask_RenderToTexture);
|
||||
|
||||
unsigned int rttSize = Settings::Manager::getInt("rtt size", "Water");
|
||||
@ -374,6 +367,18 @@ public:
|
||||
SceneUtil::ShadowManager::disableShadowsForStateSet(getOrCreateStateSet());
|
||||
}
|
||||
|
||||
void setInterior(bool isInterior)
|
||||
{
|
||||
int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water");
|
||||
reflectionDetail = std::min(4, std::max(isInterior ? 2 : 0, reflectionDetail));
|
||||
unsigned int extraMask = 0;
|
||||
if(reflectionDetail >= 1) extraMask |= Mask_Terrain;
|
||||
if(reflectionDetail >= 2) extraMask |= Mask_Static;
|
||||
if(reflectionDetail >= 3) extraMask |= Mask_Effect|Mask_ParticleSystem|Mask_Object;
|
||||
if(reflectionDetail >= 4) extraMask |= Mask_Player|Mask_Actor;
|
||||
setCullMask(Mask_Scene|Mask_Sky|Mask_Lighting|extraMask);
|
||||
}
|
||||
|
||||
void setWaterLevel(float waterLevel)
|
||||
{
|
||||
setViewMatrix(osg::Matrix::scale(1,1,-1) * osg::Matrix::translate(0,0,2 * waterLevel));
|
||||
@ -668,8 +673,8 @@ void Water::changeCell(const MWWorld::CellStore* store)
|
||||
mWaterNode->setPosition(osg::Vec3f(0,0,mTop));
|
||||
mInterior = true;
|
||||
}
|
||||
if(mInterior != wasInterior)
|
||||
updateWaterMaterial();
|
||||
if(mInterior != wasInterior && mReflection)
|
||||
mReflection->setInterior(mInterior);
|
||||
|
||||
// create a new StateSet to prevent threading issues
|
||||
osg::ref_ptr<osg::StateSet> nodeStateSet (new osg::StateSet);
|
||||
|
Loading…
x
Reference in New Issue
Block a user