OGRE  1.9.0
OgreCompositionPass.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE 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
37namespace Ogre {
48 {
49 public:
52
63
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
123
144 void setClearDepth(Real depth);
157
161 void setStencilCheck(bool value);
165 bool getStencilCheck() 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
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
351 };
352
354
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
Class representing colour.
void setStencilMask(uint32 value)
Set stencil mask.
void clearAllInputs()
Clear all inputs.
InputTex mInputs[OGRE_MAX_TEXTURE_LAYERS]
Inputs (for material used for rendering the quad).
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.
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)
void setIdentifier(uint32 id)
Set an identifier for this pass.
CompositionPass(CompositionTargetPass *parent)
const MaterialPtr & getMaterial() const
Get the material used by this pass.
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.
uint32 getClearBuffers() const
Get the viewport clear buffers.
const String & getMaterialScheme(void) const
Get the material scheme used by this pass.
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.
CompositionTargetPass * getParent()
Get parent object.
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_RENDERCUSTOM
Render a full screen quad.
@ PT_RENDERSCENE
Set stencil operation.
uint32 mIdentifier
Identifier for this pass.
const InputTex & getInput(size_t id) const
Get the value of an input.
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.
String mMaterialScheme
Material scheme name.
const ColourValue & getClearColour() const
Get the viewport clear colour (defaults to 0,0,0,0)
void setClearStencil(uint32 value)
Set the viewport clear stencil value (defaults to 0)
void setStencilFailOp(StencilOperation value)
Set stencil fail operation.
const String & getCustomType() const
Get the type name of this custom composition pass.
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.
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
SharedPtr< Material > MaterialPtr
ResourceAllocatedObject CompositorInstAlloc
float Real
Software floating point type.
unsigned int uint32
_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.