OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
36 namespace Ogre {
47  {
48  public:
50  ~CompositionPass();
51 
54  enum PassType
55  {
56  PT_CLEAR, // Clear target to one colour
57  PT_STENCIL, // Set stencil operation
58  PT_RENDERSCENE, // Render the scene or part of it
59  PT_RENDERQUAD, // Render a full screen quad
60  PT_RENDERCUSTOM // Render a custom sequence
61  };
62 
64  void setType(PassType type);
66  PassType getType() const;
67 
71  void setIdentifier(uint32 id);
73  uint32 getIdentifier() const;
74 
78  void setMaterial(const MaterialPtr& mat);
82  void setMaterialName(const String &name);
86  const MaterialPtr& getMaterial() const;
90  void setFirstRenderQueue(uint8 id);
94  uint8 getFirstRenderQueue() const;
98  void setLastRenderQueue(uint8 id);
102  uint8 getLastRenderQueue() const;
103 
109  void setMaterialScheme(const String& schemeName);
115  const String& getMaterialScheme(void) const;
116 
127  void setClearBuffers(uint32 val);
131  uint32 getClearBuffers() const;
135  void setClearColour(ColourValue val);
139  const ColourValue &getClearColour() const;
143  void setClearDepth(Real depth);
147  Real getClearDepth() const;
151  void setClearStencil(uint32 value);
155  uint32 getClearStencil() const;
156 
160  void setStencilCheck(bool value);
164  bool getStencilCheck() const;
168  void setStencilFunc(CompareFunction value);
172  CompareFunction getStencilFunc() const;
176  void setStencilRefValue(uint32 value);
180  uint32 getStencilRefValue() const;
184  void setStencilMask(uint32 value);
188  uint32 getStencilMask() const;
192  void setStencilFailOp(StencilOperation value);
196  StencilOperation getStencilFailOp() const;
200  void setStencilDepthFailOp(StencilOperation value);
204  StencilOperation getStencilDepthFailOp() const;
208  void setStencilPassOp(StencilOperation value);
212  StencilOperation getStencilPassOp() const;
216  void setStencilTwoSidedOperation(bool value);
220  bool getStencilTwoSidedOperation() const;
221 
223  struct InputTex
224  {
228  size_t mrtIndex;
229  InputTex() : name(StringUtil::BLANK), mrtIndex(0) {}
230  InputTex(const String& _name, size_t _mrtIndex = 0)
231  : name(_name), mrtIndex(_mrtIndex) {}
232  };
233 
240  void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0);
241 
246  const InputTex &getInput(size_t id) const;
247 
251  size_t getNumInputs() const;
252 
256  void clearAllInputs();
257 
261  CompositionTargetPass *getParent();
262 
265  bool _isSupported(void);
266 
270  void setQuadCorners(Real left,Real top,Real right,Real bottom);
271 
275  bool getQuadCorners(Real & left,Real & top,Real & right,Real & bottom) const;
276 
280  void setQuadFarCorners(bool farCorners, bool farCornersViewSpace);
281 
285  bool getQuadFarCorners() const;
286 
290  bool getQuadFarCornersViewSpace() const;
291 
296  void setCustomType(const String& customType);
297 
302  const String& getCustomType() const;
303 
304  private:
338 
346 
347  bool mQuadFarCorners, mQuadFarCornersViewSpace;
348  //The type name of the custom composition pass.
350  };
354 }
355 
356 #endif
Inputs (for material used for rendering the quad)
unsigned char uint8
Definition: OgrePlatform.h:272
MaterialPtr mMaterial
Material used for rendering.
float Real
Software floating point type.
unsigned int uint32
Definition: OgrePlatform.h:270
#define _OgreExport
Definition: OgrePlatform.h:233
uint32 mIdentifier
Identifier for this pass.
uint32 mClearStencil
Clear stencil value (in case of PT_CLEAR)
Class representing colour.
PassType mType
Type of composition pass.
CompareFunction mStencilFunc
Real mClearDepth
Clear depth (in case of PT_CLEAR)
String name
Name (local) of the input texture (empty == no input)
Object representing one pass or operation in a composition sequence.
bool mQuadCornerModified
true if quad should not cover whole screen
StencilOperation mStencilDepthFailOp
StencilOperation mStencilPassOp
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
Definition: OgreConfig.h:70
Real mQuadLeft
quad positions in normalised coordinates [-1;1]x[-1;1] (in case of PT_RENDERQUAD) ...
StencilOperation mStencilFailOp
uint32 mClearBuffers
Clear buffers (in case of PT_CLEAR)
size_t mrtIndex
MRT surface index if applicable.
bool mStencilCheck
Stencil operation parameters.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Utility class for manipulating Strings.
Definition: OgreString.h:75
PassType
Enumeration that enumerates the various composition pass types.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
CompositionTargetPass * mParent
Parent technique.
String mMaterialScheme
Material scheme name.
_StringBase String
Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr.
Definition: OgreMaterial.h:688
StencilOperation
Enum describing the various actions which can be taken onthe stencil buffer.
uint8 mFirstRenderQueue
[first,last] render queue to render this pass (in case of PT_RENDERSCENE)
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:67
InputTex(const String &_name, size_t _mrtIndex=0)
ColourValue mClearColour
Clear colour (in case of PT_CLEAR)
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework...