OGRE  1.8
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-2013 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 
35 namespace Ogre {
45  {
46  public:
48  virtual ~CompositionTechnique();
49 
50  //The scope of a texture defined by the compositor
51  enum TextureScope {
52  //Local texture - only available to the compositor passes in this technique
54  //Chain texture - available to the other compositors in the chain
56  //Global texture - available to everyone in every scope
57  TS_GLOBAL
58  };
59 
62  {
63  public:
65  //Texture definition being a reference is determined by these two fields not being empty.
66  String refCompName; //If a reference, the name of the compositor being referenced
67  String refTexName; //If a reference, the name of the texture in the compositor being referenced
68  size_t width; // 0 means adapt to target width
69  size_t height; // 0 means adapt to target height
70  float widthFactor; // multiple of target width to use (if width = 0)
71  float heightFactor; // multiple of target height to use (if height = 0)
72  PixelFormatList formatList; // more than one means MRT
73  bool fsaa; // FSAA enabled; true = determine from main target (if render_scene), false = disable
74  bool hwGammaWrite; // Do sRGB gamma correction on write (only 8-bit per channel formats)
75  uint16 depthBufferId;//Depth Buffer's pool ID. (unrelated to "pool" variable below)
76  bool pooled; // whether to use pooled textures for this one
77  TextureScope scope; // Which scope has access to this texture
78 
79  TextureDefinition() :width(0), height(0), widthFactor(1.0f), heightFactor(1.0f),
80  fsaa(true), hwGammaWrite(false), depthBufferId(1), pooled(false), scope(TS_LOCAL) {}
81  };
87 
91  TextureDefinition *createTextureDefinition(const String &name);
92 
95  void removeTextureDefinition(size_t idx);
96 
99  TextureDefinition *getTextureDefinition(size_t idx);
100 
103  TextureDefinition *getTextureDefinition(const String& name);
104 
107  size_t getNumTextureDefinitions();
108 
111  void removeAllTextureDefinitions();
112 
114  TextureDefinitionIterator getTextureDefinitionIterator(void);
115 
118  CompositionTargetPass *createTargetPass();
119 
122  void removeTargetPass(size_t idx);
123 
126  CompositionTargetPass *getTargetPass(size_t idx);
127 
130  size_t getNumTargetPasses();
131 
134  void removeAllTargetPasses();
135 
137  TargetPassIterator getTargetPassIterator(void);
138 
141  CompositionTargetPass *getOutputTargetPass();
142 
146  virtual bool isSupported(bool allowTextureDegradation);
147 
151  virtual void setSchemeName(const String& schemeName);
153  const String& getSchemeName() const { return mSchemeName; }
154 
158  void setCompositorLogicName(const String& compositorLogicName)
159  { mCompositorLogicName = compositorLogicName; }
161  const String& getCompositorLogicName() const { return mCompositorLogicName; }
162 
164  Compositor *getParent();
165  private:
170 
175 
178 
181 
182  };
186 }
187 
188 #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:233
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:271
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.