OgreCompositionPass.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 __CompositionPass_H__
29 #define __CompositionPass_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreMaterial.h"
33 #include "OgreRenderSystem.h"
34 #include "OgreRenderQueue.h"
35 #include "OgreHeaderPrefix.h"
36 
37 namespace Ogre {
48  {
49  public:
52 
55  enum PassType
56  {
61  PT_RENDERCUSTOM
62  };
63 
65  void setType(PassType type);
67  PassType getType() const;
68 
75 
79  void setMaterial(const MaterialPtr& mat);
83  void setMaterialName(const String &name);
87  const MaterialPtr& getMaterial() const;
104 
110  void setMaterialScheme(const String& schemeName);
116  const String& getMaterialScheme(void) const;
117 
140  const ColourValue &getClearColour() const;
144  void setClearDepth(Real depth);
152  void setClearStencil(uint32 value);
157 
161  void setStencilCheck(bool value);
165  bool getStencilCheck() const;
185  void setStencilMask(uint32 value);
217  void setStencilTwoSidedOperation(bool value);
222 
224  struct InputTex
225  {
229  size_t mrtIndex;
230  InputTex() : name(StringUtil::BLANK), mrtIndex(0) {}
231  InputTex(const String& _name, size_t _mrtIndex = 0)
232  : name(_name), mrtIndex(_mrtIndex) {}
233  };
234 
241  void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0);
242 
247  const InputTex &getInput(size_t id) const;
248 
252  size_t getNumInputs() const;
253 
258 
263 
266  bool _isSupported(void);
267 
271  void setQuadCorners(Real left,Real top,Real right,Real bottom);
272 
276  bool getQuadCorners(Real & left,Real & top,Real & right,Real & bottom) const;
277 
281  void setQuadFarCorners(bool farCorners, bool farCornersViewSpace);
282 
286  bool getQuadFarCorners() const;
287 
292 
297  void setCustomType(const String& customType);
298 
303  const String& getCustomType() const;
304 
305  private:
339 
347 
348  bool mQuadFarCorners, mQuadFarCornersViewSpace;
351  };
355 }
356 
357 #include "OgreHeaderSuffix.h"
358 
359 #endif
OgreHeaderSuffix.h
OgreRenderQueue.h
Ogre::CompositionPass::mClearDepth
Real mClearDepth
Clear depth (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:324
Ogre::CompositionPass::setMaterialScheme
void setMaterialScheme(const String &schemeName)
Set the material scheme used by this pass.
Ogre::CompositionPass::getStencilDepthFailOp
StencilOperation getStencilDepthFailOp() const
Get stencil depth fail operation.
Ogre::CompositionPass::InputTex::mrtIndex
size_t mrtIndex
MRT surface index if applicable.
Definition: OgreCompositionPass.h:229
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:59
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::CompositionPass::mStencilCheck
bool mStencilCheck
Stencil operation parameters.
Definition: OgreCompositionPass.h:331
Ogre::CompositionPass::setClearStencil
void setClearStencil(uint32 value)
Set the viewport clear stencil value (defaults to 0)
Ogre::CompositionPass::setMaterial
void setMaterial(const MaterialPtr &mat)
Set the material used by this pass.
Ogre::CompositionPass::mParent
CompositionTargetPass * mParent
Parent technique.
Definition: OgreCompositionPass.h:307
Ogre::CompositionPass::setMaterialName
void setMaterialName(const String &name)
Set the material used by this pass.
Ogre::CompositionPass::setStencilFunc
void setStencilFunc(CompareFunction value)
Set stencil compare function.
Ogre::CompositionPass::PassType
PassType
Enumeration that enumerates the various composition pass types.
Definition: OgreCompositionPass.h:56
Ogre::CompositionPass::getClearBuffers
uint32 getClearBuffers() const
Get the viewport clear buffers.
Ogre::CompositionPass::getNumInputs
size_t getNumInputs() const
Get the number of inputs used.
Ogre::CompositionPass
Object representing one pass or operation in a composition sequence.
Definition: OgreCompositionPass.h:48
Ogre::CompositionPass::mClearBuffers
uint32 mClearBuffers
Clear buffers (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:320
Ogre::CompositionPass::mStencilTwoSidedOperation
bool mStencilTwoSidedOperation
Definition: OgreCompositionPass.h:338
Ogre::CompositionPass::mClearStencil
uint32 mClearStencil
Clear stencil value (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:326
Ogre::CompositionPass::getStencilCheck
bool getStencilCheck() const
Get stencil check enable.
Ogre::CompositionPass::setStencilFailOp
void setStencilFailOp(StencilOperation value)
Set stencil fail operation.
Ogre::CompositionPass::mQuadBottom
Real mQuadBottom
Definition: OgreCompositionPass.h:346
Ogre::CompositionPass::setClearBuffers
void setClearBuffers(uint32 val)
Would be nice to have for RENDERSCENE: flags to: exclude transparents override material (at least – c...
Ogre::CompositionPass::setStencilPassOp
void setStencilPassOp(StencilOperation value)
Set stencil pass operation.
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::CompositionPass::getQuadCorners
bool getQuadCorners(Real &left, Real &top, Real &right, Real &bottom) const
Get quad normalised positions [-1;1]x[-1;1].
Ogre::CompositionPass::setStencilDepthFailOp
void setStencilDepthFailOp(StencilOperation value)
Set stencil depth fail operation.
Ogre::CompositionPass::InputTex::InputTex
InputTex()
Definition: OgreCompositionPass.h:230
Ogre::CompositionPass::setFirstRenderQueue
void setFirstRenderQueue(uint8 id)
Set the first render queue to be rendered in this pass (inclusive)
Ogre::CompositionPass::mQuadTop
Real mQuadTop
Definition: OgreCompositionPass.h:344
OgreMaterial.h
Ogre::CompositionPass::_isSupported
bool _isSupported(void)
Determine if this target pass is supported on the current rendering device.
Ogre::CompareFunction
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:65
Ogre::CompositionPass::mStencilPassOp
StencilOperation mStencilPassOp
Definition: OgreCompositionPass.h:337
Ogre::CompositionPass::getMaterial
const MaterialPtr & getMaterial() const
Get the material used by this pass.
Ogre::CompositionPass::mQuadLeft
Real mQuadLeft
quad positions in normalised coordinates [-1;1]x[-1;1] (in case of PT_RENDERQUAD)
Definition: OgreCompositionPass.h:343
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::StencilOperation
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Definition: OgreRenderSystem.h:82
Ogre::CompositionPass::getClearColour
const ColourValue & getClearColour() const
Get the viewport clear colour (defaults to 0,0,0,0)
Ogre::CompositionPass::mType
PassType mType
Type of composition pass.
Definition: OgreCompositionPass.h:309
OgreHeaderPrefix.h
Ogre::CompositionPass::getClearDepth
Real getClearDepth() const
Get the viewport clear depth (defaults to 1.0)
Ogre::CompositionPass::setQuadCorners
void setQuadCorners(Real left, Real top, Real right, Real bottom)
Set quad normalised positions [-1;1]x[-1;1].
Ogre::CompositionPass::getStencilFunc
CompareFunction getStencilFunc() const
Get stencil compare function.
Ogre::CompositionPass::mMaterialScheme
String mMaterialScheme
Material scheme name.
Definition: OgreCompositionPass.h:318
Ogre::CompositionTargetPass
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework.
Definition: OgreCompositionTargetPass.h:46
OgrePrerequisites.h
Ogre::CompositionPass::setQuadFarCorners
void setQuadFarCorners(bool farCorners, bool farCornersViewSpace)
Sets the use of camera frustum far corners provided in the quad's normals.
Ogre::CompositionPass::mStencilFailOp
StencilOperation mStencilFailOp
Definition: OgreCompositionPass.h:335
Ogre::CompositionPass::mQuadRight
Real mQuadRight
Definition: OgreCompositionPass.h:345
Ogre::CompositionPass::getStencilMask
uint32 getStencilMask() const
Get stencil mask.
Ogre::CompositionPass::clearAllInputs
void clearAllInputs()
Clear all inputs.
Ogre::CompositionPass::getStencilFailOp
StencilOperation getStencilFailOp() const
Get stencil fail operation.
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::CompositionPass::mStencilFunc
CompareFunction mStencilFunc
Definition: OgreCompositionPass.h:332
Ogre::CompositionPass::getQuadFarCorners
bool getQuadFarCorners() const
Returns true if camera frustum far corners are provided in the quad.
Ogre::CompositionPass::getStencilPassOp
StencilOperation getStencilPassOp() const
Get stencil pass operation.
Ogre::CompositionPass::getLastRenderQueue
uint8 getLastRenderQueue() const
Get the last render queue to be rendered in this pass (inclusive)
Ogre::CompositionPass::PT_STENCIL
@ PT_STENCIL
Clear target to one colour.
Definition: OgreCompositionPass.h:58
Ogre::CompositionPass::mCustomType
String mCustomType
The type name of the custom composition pass.
Definition: OgreCompositionPass.h:350
Ogre::CompositionPass::setClearColour
void setClearColour(ColourValue val)
Set the viewport clear colour (defaults to 0,0,0,0)
Ogre::CompositionPass::mStencilDepthFailOp
StencilOperation mStencilDepthFailOp
Definition: OgreCompositionPass.h:336
Ogre::CompositionPass::setType
void setType(PassType type)
Set the type of composition pass.
Ogre::CompositionPass::getMaterialScheme
const String & getMaterialScheme(void) const
Get the material scheme used by this pass.
Ogre::CompositionPass::mLastRenderQueue
uint8 mLastRenderQueue
Definition: OgreCompositionPass.h:316
Ogre::SharedPtr< Material >
Ogre::CompositionPass::getStencilRefValue
uint32 getStencilRefValue() const
Get stencil reference value.
Ogre::uint8
unsigned char uint8
Definition: OgrePlatform.h:361
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::ColourValue
Class representing colour.
Definition: OgreColourValue.h:58
Ogre::CompositionPass::mQuadCornerModified
bool mQuadCornerModified
True if quad should not cover whole screen.
Definition: OgreCompositionPass.h:341
Ogre::CompositionPass::~CompositionPass
~CompositionPass()
Ogre::CompositionPass::setLastRenderQueue
void setLastRenderQueue(uint8 id)
Set the last render queue to be rendered in this pass (inclusive)
Ogre::CompositionPass::getType
PassType getType() const
Get the type of composition pass.
Ogre::CompositionPass::setStencilTwoSidedOperation
void setStencilTwoSidedOperation(bool value)
Set two sided stencil operation.
Ogre::CompositionPass::setIdentifier
void setIdentifier(uint32 id)
Set an identifier for this pass.
Ogre::CompositionPass::mQuadFarCornersViewSpace
bool mQuadFarCornersViewSpace
Definition: OgreCompositionPass.h:348
Ogre::StringUtil
Utility class for manipulating Strings.
Definition: OgreString.h:76
Ogre::CompositionPass::mClearColour
ColourValue mClearColour
Clear colour (in case of PT_CLEAR)
Definition: OgreCompositionPass.h:322
Ogre::CompositionPass::mStencilRefValue
uint32 mStencilRefValue
Definition: OgreCompositionPass.h:333
Ogre::CompositionPass::InputTex
Inputs (for material used for rendering the quad)
Definition: OgreCompositionPass.h:225
Ogre::CompositionPass::PT_RENDERSCENE
@ PT_RENDERSCENE
Set stencil operation.
Definition: OgreCompositionPass.h:59
Ogre::CompositionPass::mIdentifier
uint32 mIdentifier
Identifier for this pass.
Definition: OgreCompositionPass.h:311
Ogre::CompositionPass::InputTex::InputTex
InputTex(const String &_name, size_t _mrtIndex=0)
Definition: OgreCompositionPass.h:231
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::CompositionPass::mMaterial
MaterialPtr mMaterial
Material used for rendering.
Definition: OgreCompositionPass.h:313
Ogre::CompositionPass::getClearStencil
uint32 getClearStencil() const
Get the viewport clear stencil value (defaults to 0)
Ogre::CompositionPass::getInput
const InputTex & getInput(size_t id) const
Get the value of an input.
Ogre::CompositionPass::getCustomType
const String & getCustomType() const
Get the type name of this custom composition pass.
Ogre::CompositionPass::InputTex::name
String name
Name (local) of the input texture (empty == no input)
Definition: OgreCompositionPass.h:227
Ogre::CompositionPass::setInput
void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0)
Set an input local texture.
Ogre::CompositionPass::CompositionPass
CompositionPass(CompositionTargetPass *parent)
Ogre::CompositionPass::setStencilCheck
void setStencilCheck(bool value)
Set stencil check on or off.
Ogre::CompositionPass::mStencilMask
uint32 mStencilMask
Definition: OgreCompositionPass.h:334
Ogre::CompositionPass::getParent
CompositionTargetPass * getParent()
Get parent object.
Ogre::CompositionPass::PT_CLEAR
@ PT_CLEAR
Definition: OgreCompositionPass.h:57
Ogre::CompositionPass::setStencilMask
void setStencilMask(uint32 value)
Set stencil mask.
Ogre::CompositionPass::PT_RENDERQUAD
@ PT_RENDERQUAD
Render the scene or part of it.
Definition: OgreCompositionPass.h:60
Ogre::CompositionPass::setCustomType
void setCustomType(const String &customType)
Set the type name of this custom composition pass.
Ogre::CompositionPass::mFirstRenderQueue
uint8 mFirstRenderQueue
[first,last] render queue to render this pass (in case of PT_RENDERSCENE)
Definition: OgreCompositionPass.h:315
Ogre::CompositionPass::getIdentifier
uint32 getIdentifier() const
Get the identifier for this pass.
Ogre::CompositionPass::getFirstRenderQueue
uint8 getFirstRenderQueue() const
Get the first render queue to be rendered in this pass (inclusive)
Ogre::CompositionPass::setClearDepth
void setClearDepth(Real depth)
Set the viewport clear depth (defaults to 1.0)
Ogre::CompositionPass::getStencilTwoSidedOperation
bool getStencilTwoSidedOperation() const
Get two sided stencil operation.
Ogre::CompositionPass::getQuadFarCornersViewSpace
bool getQuadFarCornersViewSpace() const
Returns true if the far corners provided in the quad are in view space.
Ogre::CompositionPass::setStencilRefValue
void setStencilRefValue(uint32 value)
Set stencil reference value.
OgreRenderSystem.h

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