OGRE  1.9.0
OgreCompositionTechnique.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __CompositionTechnique_H__
29#define __CompositionTechnique_H__
30
31#include "OgrePrerequisites.h"
32#include "OgrePixelFormat.h"
34#include "OgreHeaderPrefix.h"
35
36namespace Ogre {
46 {
47 public:
50
51 //The scope of a texture defined by the compositor
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
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
81 fsaa(true), hwGammaWrite(false), depthBufferId(1), pooled(false), scope(TS_LOCAL) {}
82 };
83
88
93
96 void removeTextureDefinition(size_t idx);
97
101
105
109
113
116
120
123 void removeTargetPass(size_t idx);
124
128
132
136
139
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; }
161
163
166 private:
171
176
179
182
183 };
184
186
187}
188
189#include "OgreHeaderSuffix.h"
190
191#endif
#define _OgreExport
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework.
void removeAllTextureDefinitions()
Remove all Texture Definitions.
TextureDefinitionIterator getTextureDefinitionIterator(void)
Get an iterator over the TextureDefinitions in this Technique.
vector< CompositionTargetPass * >::type TargetPasses
Typedefs for several iterators.
void removeTargetPass(size_t idx)
Remove a target pass.
virtual void setSchemeName(const String &schemeName)
Assign a scheme name to this technique, used to switch between multiple techniques by choice rather t...
VectorIterator< TextureDefinitions > TextureDefinitionIterator
CompositionTargetPass * mOutputTarget
Output target pass (can be only one)
CompositionTargetPass * createTargetPass()
Create a new target pass, and return a pointer to it.
TargetPassIterator getTargetPassIterator(void)
Get an iterator over the TargetPasses in this Technique.
void removeAllTargetPasses()
Remove all target passes.
void removeTextureDefinition(size_t idx)
Remove and destroy a local texture definition.
TextureDefinition * getTextureDefinition(size_t idx)
Get a local texture definition.
VectorIterator< TargetPasses > TargetPassIterator
TextureDefinition * getTextureDefinition(const String &name)
Get a local texture definition with a specific name.
TextureDefinition * createTextureDefinition(const String &name)
Create a new local texture definition, and return a pointer to it.
const String & getSchemeName() const
Get the scheme name assigned to this technique.
virtual bool isSupported(bool allowTextureDegradation)
Determine if this technique is supported on the current rendering device.
CompositionTargetPass * getTargetPass(size_t idx)
Get a target pass.
Compositor * mParent
Parent compositor.
Compositor * getParent()
Get parent object.
size_t getNumTargetPasses()
Get the number of target passes.
TextureDefinitions mTextureDefinitions
Local texture definitions.
String mCompositorLogicName
Optional compositor logic name.
const String & getCompositorLogicName() const
Get the compositor logic name assigned to this technique.
CompositionTargetPass * getOutputTargetPass()
Get output (final) target pass.
TargetPasses mTargetPasses
Intermediate target passes.
String mSchemeName
Optional scheme name.
size_t getNumTextureDefinitions()
Get the number of local texture definitions.
CompositionTechnique(Compositor *parent)
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.
Concrete IteratorWrapper for nonconst access to the underlying container.
vector< PixelFormat >::type PixelFormatList
ResourceAllocatedObject CompositorInstAlloc
unsigned short uint16
_StringBase String
std::vector< T, A > type