OgreCompositionPass.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 __CompositionPass_H__
#define __CompositionPass_H__
#include "OgrePrerequisites.h"
#include "OgreMaterial.h"
#include "OgreRenderSystem.h"
#include "OgreRenderQueue.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport CompositionPass : public CompositorInstAlloc
{
public:
CompositionPass(CompositionTargetPass *parent);
~CompositionPass();
enum PassType
{
PT_CLEAR,
PT_STENCIL,
PT_RENDERSCENE,
PT_RENDERQUAD,
PT_RENDERCUSTOM
};
void setType(PassType type);
PassType getType() const;
void setIdentifier(uint32 id);
uint32 getIdentifier() const;
void setMaterial(const MaterialPtr& mat);
void setMaterialName(const String &name);
const MaterialPtr& getMaterial() const;
void setFirstRenderQueue(uint8 id);
uint8 getFirstRenderQueue() const;
void setLastRenderQueue(uint8 id);
uint8 getLastRenderQueue() const;
void setMaterialScheme(const String& schemeName);
const String& getMaterialScheme(void) const;
void setClearBuffers(uint32 val);
uint32 getClearBuffers() const;
void setClearColour(ColourValue val);
const ColourValue &getClearColour() const;
void setClearDepth(Real depth);
Real getClearDepth() const;
void setClearStencil(uint32 value);
uint32 getClearStencil() const;
void setStencilCheck(bool value);
bool getStencilCheck() const;
void setStencilFunc(CompareFunction value);
CompareFunction getStencilFunc() const;
void setStencilRefValue(uint32 value);
uint32 getStencilRefValue() const;
void setStencilMask(uint32 value);
uint32 getStencilMask() const;
void setStencilFailOp(StencilOperation value);
StencilOperation getStencilFailOp() const;
void setStencilDepthFailOp(StencilOperation value);
StencilOperation getStencilDepthFailOp() const;
void setStencilPassOp(StencilOperation value);
StencilOperation getStencilPassOp() const;
void setStencilTwoSidedOperation(bool value);
bool getStencilTwoSidedOperation() const;
struct InputTex
{
String name;
size_t mrtIndex;
InputTex() : name(StringUtil::BLANK), mrtIndex(0) {}
InputTex(const String& _name, size_t _mrtIndex = 0)
: name(_name), mrtIndex(_mrtIndex) {}
};
void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0);
const InputTex &getInput(size_t id) const;
size_t getNumInputs() const;
void clearAllInputs();
CompositionTargetPass *getParent();
bool _isSupported(void);
void setQuadCorners(Real left,Real top,Real right,Real bottom);
bool getQuadCorners(Real & left,Real & top,Real & right,Real & bottom) const;
void setQuadFarCorners(bool farCorners, bool farCornersViewSpace);
bool getQuadFarCorners() const;
bool getQuadFarCornersViewSpace() const;
void setCustomType(const String& customType);
const String& getCustomType() const;
private:
CompositionTargetPass *mParent;
PassType mType;
uint32 mIdentifier;
MaterialPtr mMaterial;
uint8 mFirstRenderQueue;
uint8 mLastRenderQueue;
String mMaterialScheme;
uint32 mClearBuffers;
ColourValue mClearColour;
Real mClearDepth;
uint32 mClearStencil;
InputTex mInputs[OGRE_MAX_TEXTURE_LAYERS];
bool mStencilCheck;
CompareFunction mStencilFunc;
uint32 mStencilRefValue;
uint32 mStencilMask;
StencilOperation mStencilFailOp;
StencilOperation mStencilDepthFailOp;
StencilOperation mStencilPassOp;
bool mStencilTwoSidedOperation;
bool mQuadCornerModified;
Real mQuadLeft;
Real mQuadTop;
Real mQuadRight;
Real mQuadBottom;
bool mQuadFarCorners, mQuadFarCornersViewSpace;
String mCustomType;
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::CompositionPass::mQuadTop
Real mQuadTop
Definition: OgreCompositionPass.h:344
Ogre::CompositionPass::mMaterial
MaterialPtr mMaterial
Material used for rendering.
Definition: OgreCompositionPass.h:313
OgreRenderQueue.h
Ogre::CompositionPass::InputTex::mrtIndex
size_t mrtIndex
MRT surface index if applicable.
Definition: OgreCompositionPass.h:229
Ogre::CompositionPass::mType
PassType mType
Type of composition pass.
Definition: OgreCompositionPass.h:309
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::CompositionPass::PT_STENCIL
Clear target to one colour.
Definition: OgreCompositionPass.h:58
Ogre::CompositionPass::mStencilDepthFailOp
StencilOperation mStencilDepthFailOp
Definition: OgreCompositionPass.h:336
Ogre::CompositionPass::mStencilPassOp
StencilOperation mStencilPassOp
Definition: OgreCompositionPass.h:337
Ogre::CompositionTargetPass
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework...
Definition: OgreCompositionTargetPass.h:45
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::CompositionPass::PT_RENDERSCENE
Set stencil operation.
Definition: OgreCompositionPass.h:59
Ogre::CompositionPass
Object representing one pass or operation in a composition sequence.
Definition: OgreCompositionPass.h:47
Ogre::CompositionPass::mStencilFunc
CompareFunction mStencilFunc
Definition: OgreCompositionPass.h:332
Ogre::CompositionPass::mQuadFarCornersViewSpace
bool mQuadFarCornersViewSpace
Definition: OgreCompositionPass.h:348
Ogre::CompositionPass::mQuadRight
Real mQuadRight
Definition: OgreCompositionPass.h:345
Ogre::CompositionPass::mQuadCornerModified
bool mQuadCornerModified
True if quad should not cover whole screen.
Definition: OgreCompositionPass.h:341
Ogre::CompositionPass::mClearDepth
Real mClearDepth
Clear depth (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:324
Ogre::StringUtil
Utility class for manipulating Strings.
Definition: OgreString.h:75
Ogre::CompositionPass::mStencilTwoSidedOperation
bool mStencilTwoSidedOperation
Definition: OgreCompositionPass.h:338
Ogre::CompositionPass::PassType
PassType
Enumeration that enumerates the various composition pass types.
Definition: OgreCompositionPass.h:55
OGRE_MAX_TEXTURE_LAYERS
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
Definition: OgreConfig.h:72
Ogre::CompositionPass::mClearColour
ColourValue mClearColour
Clear colour (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:322
Ogre::CompositionPass::PT_RENDERQUAD
Render the scene or part of it.
Definition: OgreCompositionPass.h:60
OgrePrerequisites.h
Ogre::CompositionPass::mParent
CompositionTargetPass * mParent
Parent technique.
Definition: OgreCompositionPass.h:307
Ogre::CompositionPass::PT_CLEAR
Definition: OgreCompositionPass.h:57
Ogre::uint8
unsigned char uint8
Definition: OgrePlatform.h:361
Ogre::CompositionPass::InputTex::InputTex
InputTex(const String &_name, size_t _mrtIndex=0)
Definition: OgreCompositionPass.h:231
Ogre::CompositionPass::mStencilRefValue
uint32 mStencilRefValue
Definition: OgreCompositionPass.h:333
Ogre::CompositionPass::mStencilCheck
bool mStencilCheck
Stencil operation parameters.
Definition: OgreCompositionPass.h:331
Ogre::CompareFunction
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:64
OgreRenderSystem.h
Ogre::CompositionPass::InputTex::name
String name
Name (local) of the input texture (empty == no input)
Definition: OgreCompositionPass.h:227
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::CompositionPass::mQuadBottom
Real mQuadBottom
Definition: OgreCompositionPass.h:346
Ogre::CompositionPass::mStencilMask
uint32 mStencilMask
Definition: OgreCompositionPass.h:334
Ogre::CompositionPass::mFirstRenderQueue
uint8 mFirstRenderQueue
[first,last] render queue to render this pass (in case of PT_RENDERSCENE)
Definition: OgreCompositionPass.h:315
OgreHeaderSuffix.h
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
Ogre::CompositionPass::mStencilFailOp
StencilOperation mStencilFailOp
Definition: OgreCompositionPass.h:335
Ogre::CompositionPass::mClearBuffers
uint32 mClearBuffers
Clear buffers (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:320
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::SharedPtr< Material >
OgreHeaderPrefix.h
Ogre::CompositionPass::InputTex
Inputs (for material used for rendering the quad)
Definition: OgreCompositionPass.h:224
Ogre::StencilOperation
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Definition: OgreRenderSystem.h:81
Ogre::CompositionPass::mCustomType
String mCustomType
The type name of the custom composition pass.
Definition: OgreCompositionPass.h:350
Ogre::CompositionPass::mMaterialScheme
String mMaterialScheme
Material scheme name.
Definition: OgreCompositionPass.h:318
Ogre::CompositionPass::mLastRenderQueue
uint8 mLastRenderQueue
Definition: OgreCompositionPass.h:316
Ogre::CompositionPass::mClearStencil
uint32 mClearStencil
Clear stencil value (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:326
Ogre::CompositionPass::InputTex::InputTex
InputTex()
Definition: OgreCompositionPass.h:230
Ogre::CompositionPass::mQuadLeft
Real mQuadLeft
quad positions in normalised coordinates [-1;1]x[-1;1] (in case of PT_RENDERQUAD) ...
Definition: OgreCompositionPass.h:343
OgreMaterial.h
Ogre::StringUtil::BLANK
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::CompositionPass::mIdentifier
uint32 mIdentifier
Identifier for this pass.
Definition: OgreCompositionPass.h:311

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