Skip to content

Commit f9bef18

Browse files
committed
ovis: ensure that compositors are applied to all owned render targets
1 parent c655c31 commit f9bef18

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

modules/ovis/src/ovis.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,18 +359,26 @@ class WindowSceneImpl : public WindowScene
359359

360360
void setCompositors(const std::vector<String>& names)
361361
{
362-
Viewport* vp = frameSrc->getViewport(0);
363362
CompositorManager& cm = CompositorManager::getSingleton();
363+
// this should be applied to all owned render targets
364+
Ogre::RenderTarget* targets[] = {frameSrc, rWin, depthRTT};
364365

365-
cm.removeCompositorChain(vp); // remove previous configuration
366-
367-
for(size_t i = 0; i < names.size(); i++)
366+
for(int j = 0; j < 3; j++)
368367
{
369-
if (!cm.addCompositor(vp, names[i])) {
370-
LogManager::getSingleton().logError("Failed to add compositor: " + names[i]);
371-
continue;
368+
Ogre::RenderTarget* tgt = targets[j];
369+
if(!tgt || (frameSrc == rWin && tgt == rWin)) continue;
370+
371+
Viewport* vp = tgt->getViewport(0);
372+
cm.removeCompositorChain(vp); // remove previous configuration
373+
374+
for(size_t i = 0; i < names.size(); i++)
375+
{
376+
if (!cm.addCompositor(vp, names[i])) {
377+
LogManager::getSingleton().logError("Failed to add compositor: " + names[i]);
378+
continue;
379+
}
380+
cm.setCompositorEnabled(vp, names[i], true);
372381
}
373-
cm.setCompositorEnabled(vp, names[i], true);
374382
}
375383
}
376384

0 commit comments

Comments
 (0)