mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-16 05:17:39 +08:00
ovis: handle bg material change after shader genration
This commit is contained in:
@@ -443,14 +443,21 @@ public:
|
||||
|
||||
_createTexture(name, image.getMat());
|
||||
|
||||
bgplane->setDefaultUVs();
|
||||
|
||||
Pass* rpass = bgplane->getMaterial()->getBestTechnique()->getPasses()[0];
|
||||
rpass->getTextureUnitStates()[0]->setTextureName(name);
|
||||
rpass->getTextureUnitStates()[0]->setTextureAddressingMode(TAM_CLAMP);
|
||||
|
||||
// ensure bgplane is visible
|
||||
bgplane->setVisible(true);
|
||||
bgplane->setDefaultUVs();
|
||||
|
||||
Pass* rpass = bgplane->getMaterial()->getTechnique(0)->getPasses()[0];
|
||||
auto tus = rpass->getTextureUnitStates()[0];
|
||||
|
||||
if(tus->getTextureName() != name)
|
||||
{
|
||||
RTShader::ShaderGenerator::getSingleton().invalidateMaterial(
|
||||
RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME, *bgplane->getMaterial());
|
||||
|
||||
tus->setTextureName(name);
|
||||
tus->setTextureAddressingMode(TAM_CLAMP);
|
||||
}
|
||||
}
|
||||
|
||||
void setCompositors(const std::vector<String>& names) CV_OVERRIDE
|
||||
|
Reference in New Issue
Block a user