|
|
@ -359,18 +359,26 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
void setCompositors(const std::vector<String>& names) |
|
|
|
void setCompositors(const std::vector<String>& names) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Viewport* vp = frameSrc->getViewport(0); |
|
|
|
|
|
|
|
CompositorManager& cm = CompositorManager::getSingleton(); |
|
|
|
CompositorManager& cm = CompositorManager::getSingleton(); |
|
|
|
|
|
|
|
// this should be applied to all owned render targets
|
|
|
|
|
|
|
|
Ogre::RenderTarget* targets[] = {frameSrc, rWin, depthRTT}; |
|
|
|
|
|
|
|
|
|
|
|
cm.removeCompositorChain(vp); // remove previous configuration
|
|
|
|
for(int j = 0; j < 3; j++) |
|
|
|
|
|
|
|
|
|
|
|
for(size_t i = 0; i < names.size(); i++) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!cm.addCompositor(vp, names[i])) { |
|
|
|
Ogre::RenderTarget* tgt = targets[j]; |
|
|
|
LogManager::getSingleton().logError("Failed to add compositor: " + names[i]); |
|
|
|
if(!tgt || (frameSrc == rWin && tgt == rWin)) continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
Viewport* vp = tgt->getViewport(0); |
|
|
|
|
|
|
|
cm.removeCompositorChain(vp); // remove previous configuration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(size_t i = 0; i < names.size(); i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!cm.addCompositor(vp, names[i])) { |
|
|
|
|
|
|
|
LogManager::getSingleton().logError("Failed to add compositor: " + names[i]); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
cm.setCompositorEnabled(vp, names[i], true); |
|
|
|
} |
|
|
|
} |
|
|
|
cm.setCompositorEnabled(vp, names[i], true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|