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
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
Definition: OgreConfig.h:72
#define _OgreExport
Definition: OgrePlatform.h:257
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Class representing colour.
Object representing one pass or operation in a composition sequence.
const MaterialPtr & getMaterial() const
Get the material used by this pass.
void setStencilMask(uint32 value)
Set stencil mask.
void clearAllInputs()
Clear all inputs.
void setCustomType(const String &customType)
Set the type name of this custom composition pass.
bool getQuadCorners(Real &left, Real &top, Real &right, Real &bottom) const
Get quad normalised positions [-1;1]x[-1;1].
CompareFunction getStencilFunc() const
Get stencil compare function.
void setQuadCorners(Real left, Real top, Real right, Real bottom)
Set quad normalised positions [-1;1]x[-1;1].
void setLastRenderQueue(uint8 id)
Set the last render queue to be rendered in this pass (inclusive)
uint8 getLastRenderQueue() const
Get the last render queue to be rendered in this pass (inclusive)
void setStencilRefValue(uint32 value)
Set stencil reference value.
void setClearDepth(Real depth)
Set the viewport clear depth (defaults to 1.0)
void setMaterial(const MaterialPtr &mat)
Set the material used by this pass.
String mCustomType
The type name of the custom composition pass.
uint32 getStencilRefValue() const
Get stencil reference value.
uint32 mClearStencil
Clear stencil value (in case of PT_CLEAR)
bool getStencilCheck() const
Get stencil check enable.
StencilOperation mStencilDepthFailOp
StencilOperation getStencilFailOp() const
Get stencil fail operation.
uint32 mClearBuffers
Clear buffers (in case of PT_CLEAR)
Real getClearDepth() const
Get the viewport clear depth (defaults to 1.0)
void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0)
Set an input local texture.
const String & getCustomType() const
Get the type name of this custom composition pass.
void setMaterialName(const String &name)
Set the material used by this pass.
bool getStencilTwoSidedOperation() const
Get two sided stencil operation.
void setFirstRenderQueue(uint8 id)
Set the first render queue to be rendered in this pass (inclusive)
const ColourValue & getClearColour() const
Get the viewport clear colour (defaults to 0,0,0,0)
void setIdentifier(uint32 id)
Set an identifier for this pass.
CompositionTargetPass * getParent()
Get parent object.
CompositionPass(CompositionTargetPass *parent)
bool mQuadCornerModified
True if quad should not cover whole screen.
CompositionTargetPass * mParent
Parent technique.
PassType getType() const
Get the type of composition pass.
StencilOperation getStencilPassOp() const
Get stencil pass operation.
Real mQuadLeft
quad positions in normalised coordinates [-1;1]x[-1;1] (in case of PT_RENDERQUAD)
void setStencilFunc(CompareFunction value)
Set stencil compare function.
StencilOperation mStencilFailOp
PassType mType
Type of composition pass.
const String & getMaterialScheme(void) const
Get the material scheme used by this pass.
uint32 getClearBuffers() const
Get the viewport clear buffers.
size_t getNumInputs() const
Get the number of inputs used.
bool getQuadFarCornersViewSpace() const
Returns true if the far corners provided in the quad are in view space.
void setType(PassType type)
Set the type of composition pass.
bool mStencilCheck
Stencil operation parameters.
void setClearBuffers(uint32 val)
Would be nice to have for RENDERSCENE: flags to: exclude transparents override material (at least – c...
void setClearColour(ColourValue val)
Set the viewport clear colour (defaults to 0,0,0,0)
PassType
Enumeration that enumerates the various composition pass types.
@ PT_RENDERQUAD
Render the scene or part of it.
@ PT_STENCIL
Clear target to one colour.
@ PT_RENDERSCENE
Set stencil operation.
uint32 mIdentifier
Identifier for this pass.
uint32 getIdentifier() const
Get the identifier for this pass.
uint8 getFirstRenderQueue() const
Get the first render queue to be rendered in this pass (inclusive)
ColourValue mClearColour
Clear colour (in case of PT_CLEAR)
bool _isSupported(void)
Determine if this target pass is supported on the current rendering device.
uint8 mFirstRenderQueue
[first,last] render queue to render this pass (in case of PT_RENDERSCENE)
void setQuadFarCorners(bool farCorners, bool farCornersViewSpace)
Sets the use of camera frustum far corners provided in the quad's normals.
MaterialPtr mMaterial
Material used for rendering.
CompareFunction mStencilFunc
String mMaterialScheme
Material scheme name.
void setClearStencil(uint32 value)
Set the viewport clear stencil value (defaults to 0)
void setStencilFailOp(StencilOperation value)
Set stencil fail operation.
StencilOperation getStencilDepthFailOp() const
Get stencil depth fail operation.
uint32 getClearStencil() const
Get the viewport clear stencil value (defaults to 0)
bool getQuadFarCorners() const
Returns true if camera frustum far corners are provided in the quad.
void setStencilDepthFailOp(StencilOperation value)
Set stencil depth fail operation.
const InputTex & getInput(size_t id) const
Get the value of an input.
StencilOperation mStencilPassOp
Real mClearDepth
Clear depth (in case of PT_CLEAR)
void setStencilCheck(bool value)
Set stencil check on or off.
uint32 getStencilMask() const
Get stencil mask.
void setStencilTwoSidedOperation(bool value)
Set two sided stencil operation.
void setMaterialScheme(const String &schemeName)
Set the material scheme used by this pass.
void setStencilPassOp(StencilOperation value)
Set stencil pass operation.
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework.
Utility class for manipulating Strings.
Definition: OgreString.h:76
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:65
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
unsigned char uint8
Definition: OgrePlatform.h:361
float Real
Software floating point type.
unsigned int uint32
Definition: OgrePlatform.h:359
_StringBase String
Inputs (for material used for rendering the quad)
InputTex(const String &_name, size_t _mrtIndex=0)
String name
Name (local) of the input texture (empty == no input)
size_t mrtIndex
MRT surface index if applicable.

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