OGRE  1.9
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-2014 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:
51  ~CompositionPass();
52 
55  enum PassType
56  {
61  PT_RENDERCUSTOM
62  };
63 
65  void setType(PassType type);
67  PassType getType() const;
68 
72  void setIdentifier(uint32 id);
74  uint32 getIdentifier() const;
75 
79  void setMaterial(const MaterialPtr& mat);
83  void setMaterialName(const String &name);
87  const MaterialPtr& getMaterial() const;
91  void setFirstRenderQueue(uint8 id);
95  uint8 getFirstRenderQueue() const;
99  void setLastRenderQueue(uint8 id);
103  uint8 getLastRenderQueue() const;
104 
110  void setMaterialScheme(const String& schemeName);
116  const String& getMaterialScheme(void) const;
117 
128  void setClearBuffers(uint32 val);
132  uint32 getClearBuffers() const;
136  void setClearColour(ColourValue val);
140  const ColourValue &getClearColour() const;
144  void setClearDepth(Real depth);
148  Real getClearDepth() const;
152  void setClearStencil(uint32 value);
156  uint32 getClearStencil() const;
157 
161  void setStencilCheck(bool value);
165  bool getStencilCheck() const;
169  void setStencilFunc(CompareFunction value);
173  CompareFunction getStencilFunc() const;
177  void setStencilRefValue(uint32 value);
181  uint32 getStencilRefValue() const;
185  void setStencilMask(uint32 value);
189  uint32 getStencilMask() const;
193  void setStencilFailOp(StencilOperation value);
197  StencilOperation getStencilFailOp() const;
201  void setStencilDepthFailOp(StencilOperation value);
205  StencilOperation getStencilDepthFailOp() const;
209  void setStencilPassOp(StencilOperation value);
213  StencilOperation getStencilPassOp() const;
217  void setStencilTwoSidedOperation(bool value);
221  bool getStencilTwoSidedOperation() const;
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 
257  void clearAllInputs();
258 
262  CompositionTargetPass *getParent();
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 
291  bool getQuadFarCornersViewSpace() const;
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
Inputs (for material used for rendering the quad)
unsigned char uint8
Definition: OgrePlatform.h:346
MaterialPtr mMaterial
Material used for rendering.
float Real
Software floating point type.
unsigned int uint32
Definition: OgrePlatform.h:344
#define _OgreExport
Definition: OgrePlatform.h:260
uint32 mIdentifier
Identifier for this pass.
uint32 mClearStencil
Clear stencil value (in case of PT_CLEAR)
Render the scene or part of it.
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:72
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.
String mCustomType
The type name of the custom composition pass.
_StringBase String
Clear target to one colour.
StencilOperation
Enum describing the various actions which can be taken on the 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:64
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...