mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 21:40:03 +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");
|
setName("ReflectionCamera");
|
||||||
setCullCallback(new InheritViewPointCallback);
|
setCullCallback(new InheritViewPointCallback);
|
||||||
|
|
||||||
int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water");
|
setInterior(isInterior);
|
||||||
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);
|
|
||||||
setNodeMask(Mask_RenderToTexture);
|
setNodeMask(Mask_RenderToTexture);
|
||||||
|
|
||||||
unsigned int rttSize = Settings::Manager::getInt("rtt size", "Water");
|
unsigned int rttSize = Settings::Manager::getInt("rtt size", "Water");
|
||||||
@ -374,6 +367,18 @@ public:
|
|||||||
SceneUtil::ShadowManager::disableShadowsForStateSet(getOrCreateStateSet());
|
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)
|
void setWaterLevel(float waterLevel)
|
||||||
{
|
{
|
||||||
setViewMatrix(osg::Matrix::scale(1,1,-1) * osg::Matrix::translate(0,0,2 * 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));
|
mWaterNode->setPosition(osg::Vec3f(0,0,mTop));
|
||||||
mInterior = true;
|
mInterior = true;
|
||||||
}
|
}
|
||||||
if(mInterior != wasInterior)
|
if(mInterior != wasInterior && mReflection)
|
||||||
updateWaterMaterial();
|
mReflection->setInterior(mInterior);
|
||||||
|
|
||||||
// create a new StateSet to prevent threading issues
|
// create a new StateSet to prevent threading issues
|
||||||
osg::ref_ptr<osg::StateSet> nodeStateSet (new osg::StateSet);
|
osg::ref_ptr<osg::StateSet> nodeStateSet (new osg::StateSet);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user