New feature: Texture view Mask Source

Enable use of a source as mask for another source. Improved Mask mechanism in Source class, with various flags for update of source (avoid repeated mask update (GPU costly). Using SourceLink to link source to mask (improved robustness of SourceLink).
This commit is contained in:
Bruno Herbelin
2023-06-24 23:28:13 +02:00
parent cf16edceec
commit 64b2a18ff3
9 changed files with 183 additions and 86 deletions

View File

@@ -1014,7 +1014,12 @@ void SessionLoader::visit (Source& s)
if (xmlCurrent_) {
// read the mask shader attributes
s.maskShader()->accept(*this);
// set the mask from jpeg
// set id of source used as mask (if exists)
uint64_t id__ = 0;
xmlCurrent_->QueryUnsigned64Attribute("source", &id__);
s.maskSource()->connect(id__, session_);
s.touch(Source::SourceUpdate_Mask);
// set the mask from jpeg (if exists)
s.setMask( SessionLoader::XMLToImage(xmlCurrent_) );
}