OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCompositorManager2.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __CompositorManager2_H__
30 #define __CompositorManager2_H__
31 
32 #include "OgreHeaderPrefix.h"
33 #include "OgreCompositorCommon.h"
34 #include "OgreIdString.h"
35 
36 #include "OgreTexture.h"
37 
38 namespace Ogre
39 {
40  class Rectangle2D;
43 
96  {
97  public:
99 
100  protected:
102 
107 
110 
113 
114  size_t mFrameCount;
115 
117 
121 
124 
125  void validateNodes(void);
126 
127  public:
128  CompositorManager2( RenderSystem *renderSystem );
130 
134  void connectOutput( CompositorNode *finalNode, size_t inputChannel );
135 
137  bool hasNodeDefinition( IdString nodeDefName ) const;
138 
140  const CompositorNodeDef* getNodeDefinition( IdString nodeDefName ) const;
141 
146  CompositorNodeDef* getNodeDefinitionNonConst( IdString nodeDefName ) const;
147 
149  const CompositorNodeDefMap& getNodeDefinitions(void) const { return mNodeDefinitions; }
150 
152  CompositorNodeDef* addNodeDefinition( const String &name );
153 
155  const CompositorShadowNodeDef* getShadowNodeDefinition( IdString nodeDefName ) const;
156 
158  CompositorShadowNodeDef* addShadowNodeDefinition( const String &name );
159 
161  bool hasWorkspaceDefinition( IdString name ) const;
162 
164  CompositorWorkspaceDef* getWorkspaceDefinition( IdString name ) const;
165 
171  CompositorWorkspaceDef* addWorkspaceDefinition( IdString name );
172 
174  size_t getFrameCount(void) const { return mFrameCount; }
175 
179  TexturePtr getNullShadowTexture( PixelFormat format );
180 
185  Rectangle2D* getSharedFullscreenTriangle(void) const { return mSharedTriangleFS; }
187  Rectangle2D* getSharedFullscreenQuad(void) const { return mSharedQuadFS; }
188 
222  CompositorWorkspace* addWorkspace( SceneManager *sceneManager, RenderTarget *finalRenderTarget,
223  Camera *defaultCam, IdString definitionName, bool bEnabled,
224  int position=-1 );
225 
227  CompositorWorkspace* addWorkspace( SceneManager *sceneManager, const CompositorChannel &finalRenderTarget,
228  Camera *defaultCam, IdString definitionName, bool bEnabled,
229  int position=-1 );
230 
232  void removeWorkspace( CompositorWorkspace *workspace );
233 
235  void removeAllWorkspaces(void);
236  void removeAllWorkspaceDefinitions(void);
237 
238  size_t getNumWorkspaces(void) const { return mWorkspaces.size(); }
239 
244  void removeAllShadowNodeDefinitions(void);
245 
250  void removeAllNodeDefinitions(void);
251 
253  void validateAllNodes();
254 
255  void _update(void);
256  void _swapAllFinalTargets(void);
257 
269  void createBasicWorkspaceDef( const IdString &workspaceDefName,
270  const ColourValue &backgroundColour,
271  IdString shadowNodeName=IdString() );
272 
275  void setCompositorPassProvider( CompositorPassProvider *passProvider );
276  CompositorPassProvider* getCompositorPassProvider(void) const;
277  };
278 
281 }
282 
283 #include "OgreHeaderSuffix.h"
284 
285 #endif
CompositorShadowNodeDefMap mShadowNodeDefs
A 'canvas' which can receive the results of a rendering operation.
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
#define _OgreExport
Definition: OgrePlatform.h:255
Compositor nodes are the core subject of compositing.
CompositorNodeDefMap mNodeDefinitions
size_t getNumWorkspaces(void) const
Class representing colour.
A compositor workspace is the main interface to render into an RT, be it a RenderWindow or an RTT (Re...
Manages the organisation and rendering of a 'scene' i.e.
map< IdString, CompositorShadowNodeDef * >::type CompositorShadowNodeDefMap
map< IdString, CompositorNodeDef * >::type CompositorNodeDefMap
const CompositorNodeDefMap & getNodeDefinitions(void) const
Returns a const iterator to all existing definitions.
CompositorPassProvider * mCompositorPassProvider
For custom passes.
Rectangle2D * getSharedFullscreenTriangle(void) const
Returns a shared fullscreen rectangle/triangle useful for PASS_QUAD passes.
vector< CompositorShadowNodeDef * >::type CompositorShadowNodeDefVec
Allows the rendering of a simple 2D rectangle This class renders a simple 2D rectangle; this rectangl...
Compositor nodes are the core subject of compositing.
PixelFormat
The pixel format used for images, textures, and render surfaces.
CompositorShadowNodeDefVec mUnfinishedShadowNodes
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
vector< CompositorWorkspace * >::type WorkspaceVec
Hashed string.
Definition: OgreIdString.h:94
Shadow Nodes are special nodes (not to be confused with.
map< IdString, CompositorWorkspaceDef * >::type CompositorWorkspaceDefMap
Rectangle2D * getSharedFullscreenQuad(void) const
Returns a shared fullscreen rectangle/triangle useful for PASS_QUAD passes.
size_t getFrameCount(void) const
Returns how many times _update has been called.
Base class that users can derive from in order to implement custom passes for the compositor...
A channel in the compositor transports textures between nodes.
_StringBase String
Definition: OgreCommon.h:53
vector< TexturePtr >::type TextureVec
Defines the functionality of a 3D API.
Main system for managing Render Targets through the use of nodes.
CompositorWorkspaceDefMap mWorkspaceDefs