OgreCompositionTechnique.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __CompositionTechnique_H__
#define __CompositionTechnique_H__
#include "OgrePrerequisites.h"
#include "OgrePixelFormat.h"
#include "OgreIteratorWrappers.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport CompositionTechnique : public CompositorInstAlloc
{
public:
CompositionTechnique(Compositor *parent);
virtual ~CompositionTechnique();
//The scope of a texture defined by the compositor
enum TextureScope {
//Local texture - only available to the compositor passes in this technique
TS_LOCAL,
//Chain texture - available to the other compositors in the chain
TS_CHAIN,
//Global texture - available to everyone in every scope
TS_GLOBAL
};
class TextureDefinition : public CompositorInstAlloc
{
public:
String name;
//Texture definition being a reference is determined by these two fields not being empty.
String refCompName; //If a reference, the name of the compositor being referenced
String refTexName; //If a reference, the name of the texture in the compositor being referenced
size_t width; // 0 means adapt to target width
size_t height; // 0 means adapt to target height
float widthFactor; // multiple of target width to use (if width = 0)
float heightFactor; // multiple of target height to use (if height = 0)
PixelFormatList formatList; // more than one means MRT
bool fsaa; // FSAA enabled; true = determine from main target (if render_scene), false = disable
bool hwGammaWrite; // Do sRGB gamma correction on write (only 8-bit per channel formats)
uint16 depthBufferId;//Depth Buffer's pool ID. (unrelated to "pool" variable below)
bool pooled; // whether to use pooled textures for this one
TextureScope scope; // Which scope has access to this texture
TextureDefinition() :width(0), height(0), widthFactor(1.0f), heightFactor(1.0f),
fsaa(true), hwGammaWrite(false), depthBufferId(1), pooled(false), scope(TS_LOCAL) {}
};
typedef vector<CompositionTargetPass *>::type TargetPasses;
typedef VectorIterator<TargetPasses> TargetPassIterator;
typedef vector<TextureDefinition*>::type TextureDefinitions;
typedef VectorIterator<TextureDefinitions> TextureDefinitionIterator;
TextureDefinition *createTextureDefinition(const String &name);
void removeTextureDefinition(size_t idx);
TextureDefinition *getTextureDefinition(size_t idx);
TextureDefinition *getTextureDefinition(const String& name);
size_t getNumTextureDefinitions();
void removeAllTextureDefinitions();
TextureDefinitionIterator getTextureDefinitionIterator(void);
CompositionTargetPass *createTargetPass();
void removeTargetPass(size_t idx);
CompositionTargetPass *getTargetPass(size_t idx);
size_t getNumTargetPasses();
void removeAllTargetPasses();
TargetPassIterator getTargetPassIterator(void);
CompositionTargetPass *getOutputTargetPass();
virtual bool isSupported(bool allowTextureDegradation);
virtual void setSchemeName(const String& schemeName);
const String& getSchemeName() const { return mSchemeName; }
void setCompositorLogicName(const String& compositorLogicName)
{ mCompositorLogicName = compositorLogicName; }
const String& getCompositorLogicName() const { return mCompositorLogicName; }
Compositor *getParent();
private:
Compositor *mParent;
TextureDefinitions mTextureDefinitions;
TargetPasses mTargetPasses;
CompositionTargetPass *mOutputTarget;
String mSchemeName;
String mCompositorLogicName;
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::CompositionTechnique::TextureDefinitionIterator
VectorIterator< TextureDefinitions > TextureDefinitionIterator
Definition: OgreCompositionTechnique.h:87
Ogre::VectorIterator
Concrete IteratorWrapper for nonconst access to the underlying container.
Definition: OgreIteratorWrapper.h:186
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
OgrePixelFormat.h
Ogre::CompositionTechnique::TextureDefinition::widthFactor
float widthFactor
Definition: OgreCompositionTechnique.h:71
Ogre::CompositionTechnique::mParent
Compositor * mParent
Parent compositor.
Definition: OgreCompositionTechnique.h:168
Ogre::PixelFormatList
vector< PixelFormat >::type PixelFormatList
Definition: OgrePixelFormat.h:262
Ogre::CompositionTechnique::TextureScope
TextureScope
Definition: OgreCompositionTechnique.h:52
Ogre::CompositionTechnique::getCompositorLogicName
const String & getCompositorLogicName() const
Get the compositor logic name assigned to this technique.
Definition: OgreCompositionTechnique.h:162
Ogre::CompositionTargetPass
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework...
Definition: OgreCompositionTargetPass.h:45
Ogre::CompositionTechnique::mCompositorLogicName
String mCompositorLogicName
Optional compositor logic name.
Definition: OgreCompositionTechnique.h:181
Ogre::CompositionTechnique::setCompositorLogicName
void setCompositorLogicName(const String &compositorLogicName)
Set the name of the compositor logic assigned to this technique.
Definition: OgreCompositionTechnique.h:159
Ogre::CompositionTechnique::TextureDefinition::heightFactor
float heightFactor
Definition: OgreCompositionTechnique.h:72
Ogre::CompositionTechnique::TextureDefinition::name
String name
Definition: OgreCompositionTechnique.h:65
Ogre::CompositionTechnique
Base composition technique, can be subclassed in plugins.
Definition: OgreCompositionTechnique.h:45
Ogre::Compositor
Class representing a Compositor object.
Definition: OgreCompositor.h:50
OgrePrerequisites.h
Ogre::CompositionTechnique::TextureDefinition::formatList
PixelFormatList formatList
Definition: OgreCompositionTechnique.h:73
Ogre::CompositionTechnique::TextureDefinition::scope
TextureScope scope
Definition: OgreCompositionTechnique.h:78
Ogre::CompositionTechnique::TextureDefinition::width
size_t width
Definition: OgreCompositionTechnique.h:69
Ogre::CompositionTechnique::TextureDefinition::hwGammaWrite
bool hwGammaWrite
Definition: OgreCompositionTechnique.h:75
Ogre::CompositionTechnique::mTextureDefinitions
TextureDefinitions mTextureDefinitions
Local texture definitions.
Definition: OgreCompositionTechnique.h:170
Ogre::CompositionTechnique::TextureDefinition::height
size_t height
Definition: OgreCompositionTechnique.h:70
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::CompositionTechnique::TextureDefinitions
vector< TextureDefinition * >::type TextureDefinitions
Definition: OgreCompositionTechnique.h:86
Ogre::CompositionTechnique::TextureDefinition::fsaa
bool fsaa
Definition: OgreCompositionTechnique.h:74
Ogre::CompositionTechnique::TextureDefinition::depthBufferId
uint16 depthBufferId
Definition: OgreCompositionTechnique.h:76
OgreHeaderSuffix.h
Ogre::CompositionTechnique::TextureDefinition::TextureDefinition
TextureDefinition()
Definition: OgreCompositionTechnique.h:80
OgreIteratorWrappers.h
Ogre::CompositionTechnique::TS_LOCAL
Definition: OgreCompositionTechnique.h:54
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::CompositionTechnique::TextureDefinition::pooled
bool pooled
Definition: OgreCompositionTechnique.h:77
Ogre::vector
Definition: OgrePrerequisites.h:491
Ogre::CompositionTechnique::mTargetPasses
TargetPasses mTargetPasses
Intermediate target passes.
Definition: OgreCompositionTechnique.h:173
OgreHeaderPrefix.h
Ogre::CompositionTechnique::TextureDefinition::refCompName
String refCompName
Definition: OgreCompositionTechnique.h:67
Ogre::CompositionTechnique::TextureDefinition::refTexName
String refTexName
Definition: OgreCompositionTechnique.h:68
Ogre::CompositionTechnique::TargetPassIterator
VectorIterator< TargetPasses > TargetPassIterator
Definition: OgreCompositionTechnique.h:85
Ogre::CompositionTechnique::getSchemeName
const String & getSchemeName() const
Get the scheme name assigned to this technique.
Definition: OgreCompositionTechnique.h:154
Ogre::CompositionTechnique::TextureDefinition
Local texture definition.
Definition: OgreCompositionTechnique.h:62
Ogre::CompositionTechnique::TS_CHAIN
Definition: OgreCompositionTechnique.h:56
Ogre::CompositionTechnique::TargetPasses
vector< CompositionTargetPass * >::type TargetPasses
Typedefs for several iterators.
Definition: OgreCompositionTechnique.h:84
Ogre::CompositionTechnique::mOutputTarget
CompositionTargetPass * mOutputTarget
Output target pass (can be only one)
Definition: OgreCompositionTechnique.h:175
Ogre::uint16
unsigned short uint16
Definition: OgrePlatform.h:360
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::CompositionTechnique::mSchemeName
String mSchemeName
Optional scheme name.
Definition: OgreCompositionTechnique.h:178

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.