File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,16 @@ class CV_EXPORTS_W WindowScene {
62
62
// / @overload
63
63
CV_WRAP_AS (setBackgroundColor) virtual void setBackground (const Scalar& color) = 0;
64
64
65
+ /* *
66
+ * enable an ordered chain of full-screen post processing effects
67
+ *
68
+ * this way you can add distortion or SSAO effects.
69
+ * The effects themselves must be defined inside Ogre .compositor scripts.
70
+ * @see addResourceLocation
71
+ * @param names compositor names that will be applied in order of appearance
72
+ */
73
+ CV_WRAP virtual void setCompositors (const std::vector<String>& names) = 0;
74
+
65
75
/* *
66
76
* place an entity of an mesh in the scene
67
77
*
Original file line number Diff line number Diff line change 7
7
#include < OgreApplicationContext.h>
8
8
#include < OgreCameraMan.h>
9
9
#include < OgreRectangle2D.h>
10
+ #include < OgreCompositorManager.h>
10
11
11
12
#include < opencv2/calib3d.hpp>
12
13
@@ -339,6 +340,23 @@ class WindowSceneImpl : public WindowScene
339
340
bgplane->setVisible (true );
340
341
}
341
342
343
+ void setCompositors (const std::vector<String>& names)
344
+ {
345
+ Viewport* vp = frameSrc->getViewport (0 );
346
+ CompositorManager& cm = CompositorManager::getSingleton ();
347
+
348
+ cm.removeCompositorChain (vp); // remove previous configuration
349
+
350
+ for (size_t i = 0 ; i < names.size (); i++)
351
+ {
352
+ if (!cm.addCompositor (vp, names[i])) {
353
+ LogManager::getSingleton ().logError (" Failed to add compositor: " + names[i]);
354
+ continue ;
355
+ }
356
+ cm.setCompositorEnabled (vp, names[i], true );
357
+ }
358
+ }
359
+
342
360
void setBackground (const Scalar& color)
343
361
{
344
362
// hide background plane
You can’t perform that action at this time.
0 commit comments