OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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-2011 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  bool pooled; // whether to use pooled textures for this one
76  TextureScope scope; // Which scope has access to this texture
77 
78  TextureDefinition() :width(0), height(0), widthFactor(1.0f), heightFactor(1.0f),
79  fsaa(true), hwGammaWrite(false), pooled(false), scope(TS_LOCAL) {}
80  };
86 
90  TextureDefinition *createTextureDefinition(const String &name);
91 
94  void removeTextureDefinition(size_t idx);
95 
98  TextureDefinition *getTextureDefinition(size_t idx);
99 
102  TextureDefinition *getTextureDefinition(const String& name);
103 
106  size_t getNumTextureDefinitions();
107 
110  void removeAllTextureDefinitions();
111 
113  TextureDefinitionIterator getTextureDefinitionIterator(void);
114 
117  CompositionTargetPass *createTargetPass();
118 
121  void removeTargetPass(size_t idx);
122 
125  CompositionTargetPass *getTargetPass(size_t idx);
126 
129  size_t getNumTargetPasses();
130 
133  void removeAllTargetPasses();
134 
136  TargetPassIterator getTargetPassIterator(void);
137 
140  CompositionTargetPass *getOutputTargetPass();
141 
145  virtual bool isSupported(bool allowTextureDegradation);
146 
150  virtual void setSchemeName(const String& schemeName);
152  const String& getSchemeName() const { return mSchemeName; }
153 
157  void setCompositorLogicName(const String& compositorLogicName)
158  { mCompositorLogicName = compositorLogicName; }
160  const String& getCompositorLogicName() const { return mCompositorLogicName; }
161 
163  Compositor *getParent();
164  private:
169 
174 
177 
180 
181  };
185 }
186 
187 #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:203
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
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.