OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCompositionTechnique.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 #ifndef __CompositionTechnique_H__
29 #define __CompositionTechnique_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgrePixelFormat.h"
33 #include "OgreIteratorWrappers.h"
34 #include "OgreHeaderPrefix.h"
35 
36 namespace Ogre {
46  {
47  public:
49  virtual ~CompositionTechnique();
50 
51  //The scope of a texture defined by the compositor
52  enum TextureScope {
53  //Local texture - only available to the compositor passes in this technique
55  //Chain texture - available to the other compositors in the chain
57  //Global texture - available to everyone in every scope
58  TS_GLOBAL
59  };
60 
63  {
64  public:
66  //Texture definition being a reference is determined by these two fields not being empty.
67  String refCompName; //If a reference, the name of the compositor being referenced
68  String refTexName; //If a reference, the name of the texture in the compositor being referenced
69  size_t width; // 0 means adapt to target width
70  size_t height; // 0 means adapt to target height
71  float widthFactor; // multiple of target width to use (if width = 0)
72  float heightFactor; // multiple of target height to use (if height = 0)
73  PixelFormatList formatList; // more than one means MRT
74  bool fsaa; // FSAA enabled; true = determine from main target (if render_scene), false = disable
75  bool hwGammaWrite; // Do sRGB gamma correction on write (only 8-bit per channel formats)
76  uint16 depthBufferId;//Depth Buffer's pool ID. (unrelated to "pool" variable below)
77  bool pooled; // whether to use pooled textures for this one
78  TextureScope scope; // Which scope has access to this texture
79 
80  TextureDefinition() :width(0), height(0), widthFactor(1.0f), heightFactor(1.0f),
81  fsaa(true), hwGammaWrite(false), depthBufferId(1), pooled(false), scope(TS_LOCAL) {}
82  };
88 
92  TextureDefinition *createTextureDefinition(const String &name);
93 
96  void removeTextureDefinition(size_t idx);
97 
100  TextureDefinition *getTextureDefinition(size_t idx);
101 
104  TextureDefinition *getTextureDefinition(const String& name);
105 
108  size_t getNumTextureDefinitions();
109 
112  void removeAllTextureDefinitions();
113 
115  TextureDefinitionIterator getTextureDefinitionIterator(void);
116 
119  CompositionTargetPass *createTargetPass();
120 
123  void removeTargetPass(size_t idx);
124 
127  CompositionTargetPass *getTargetPass(size_t idx);
128 
131  size_t getNumTargetPasses();
132 
135  void removeAllTargetPasses();
136 
138  TargetPassIterator getTargetPassIterator(void);
139 
142  CompositionTargetPass *getOutputTargetPass();
143 
147  virtual bool isSupported(bool allowTextureDegradation);
148 
152  virtual void setSchemeName(const String& schemeName);
154  const String& getSchemeName() const { return mSchemeName; }
155 
159  void setCompositorLogicName(const String& compositorLogicName)
160  { mCompositorLogicName = compositorLogicName; }
162  const String& getCompositorLogicName() const { return mCompositorLogicName; }
163 
165  Compositor *getParent();
166  private:
171 
176 
179 
182 
183  };
187 }
188 
189 #include "OgreHeaderSuffix.h"
190 
191 #endif
String mCompositorLogicName
Optional compositor logic name.
Compositor * mParent
Parent compositor.
const String & getCompositorLogicName() const
Get the compositor logic name assigned to this technique.
#define _OgreExport
Definition: OgrePlatform.h:260
CompositionTargetPass * mOutputTarget
Output target pass (can be only one)
void setCompositorLogicName(const String &compositorLogicName)
Set the name of the compositor logic assigned to this technique.
vector< TextureDefinition * >::type TextureDefinitions
Class representing a Compositor object.
String mSchemeName
Optional scheme name.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
TargetPasses mTargetPasses
Intermediate target passes.
VectorIterator< TextureDefinitions > TextureDefinitionIterator
vector< PixelFormat >::type PixelFormatList
Base composition technique, can be subclassed in plugins.
const String & getSchemeName() const
Get the scheme name assigned to this technique.
vector< CompositionTargetPass * >::type TargetPasses
Typedefs for several iterators.
VectorIterator< TargetPasses > TargetPassIterator
_StringBase String
unsigned short uint16
Definition: OgrePlatform.h:345
Concrete IteratorWrapper for nonconst access to the underlying container.
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework...
TextureDefinitions mTextureDefinitions
Local texture definitions.