# OgreCompositionPass.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004     (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org/
    00006
    00007 Copyright (c) 2000-2009 Torus Knot Software Ltd
    00008
    00009 Permission is hereby granted, free of charge, to any person obtaining a copy
    00010 of this software and associated documentation files (the "Software"), to deal
    00011 in the Software without restriction, including without limitation the rights
    00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00013 copies of the Software, and to permit persons to whom the Software is
    00014 furnished to do so, subject to the following conditions:
    00015
    00016 The above copyright notice and this permission notice shall be included in
    00017 all copies or substantial portions of the Software.
    00018
    00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    00025 THE SOFTWARE.
    00026 -----------------------------------------------------------------------------
    00027 */
    00028 #ifndef __CompositionPass_H__
    00029 #define __CompositionPass_H__
    00030
    00031 #include "OgrePrerequisites.h"
    00032 #include "OgreMaterial.h"
    00033 #include "OgreRenderSystem.h"
    00034 #include "OgreRenderQueue.h"
    00035
    00036 namespace Ogre {
    00046     class _OgreExport CompositionPass : public CompositorInstAlloc
    00047     {
    00048     public:
    00049         CompositionPass(CompositionTargetPass *parent);
    00050         ~CompositionPass();
    00051
    00054         enum PassType
    00055         {
    00056             PT_CLEAR,           // Clear target to one colour
    00057             PT_STENCIL,         // Set stencil operation
    00058             PT_RENDERSCENE,     // Render the scene or part of it
    00059             PT_RENDERQUAD,      // Render a full screen quad
    00060             PT_RENDERCUSTOM     // Render a custom sequence
    00061         };
    00062
    00064         void setType(PassType type);
    00066         PassType getType() const;
    00067
    00071         void setIdentifier(uint32 id);
    00073         uint32 getIdentifier() const;
    00074
    00078         void setMaterial(const MaterialPtr& mat);
    00082         void setMaterialName(const String &name);
    00086         const MaterialPtr& getMaterial() const;
    00090         void setFirstRenderQueue(uint8 id);
    00094         uint8 getFirstRenderQueue() const;
    00098         void setLastRenderQueue(uint8 id);
    00102         uint8 getLastRenderQueue() const;
    00103
    00109         void setMaterialScheme(const String& schemeName);
    00115         const String& getMaterialScheme(void) const;
    00116
    00127         void setClearBuffers(uint32 val);
    00131         uint32 getClearBuffers() const;
    00135         void setClearColour(ColourValue val);
    00139         const ColourValue &getClearColour() const;
    00143         void setClearDepth(Real depth);
    00147         Real getClearDepth() const;
    00151         void setClearStencil(uint32 value);
    00155         uint32 getClearStencil() const;
    00156
    00160         void setStencilCheck(bool value);
    00164         bool getStencilCheck() const;
    00168         void setStencilFunc(CompareFunction value);
    00172         CompareFunction getStencilFunc() const;
    00176         void setStencilRefValue(uint32 value);
    00180         uint32 getStencilRefValue() const;
    00184         void setStencilMask(uint32 value);
    00188         uint32 getStencilMask() const;
    00192         void setStencilFailOp(StencilOperation value);
    00196         StencilOperation getStencilFailOp() const;
    00200         void setStencilDepthFailOp(StencilOperation value);
    00204         StencilOperation getStencilDepthFailOp() const;
    00208         void setStencilPassOp(StencilOperation value);
    00212         StencilOperation getStencilPassOp() const;
    00216         void setStencilTwoSidedOperation(bool value);
    00220         bool getStencilTwoSidedOperation() const;
    00221
    00223         struct InputTex
    00224         {
    00226             String name;
    00228             size_t mrtIndex;
    00229             InputTex() : name(StringUtil::BLANK), mrtIndex(0) {}
    00230             InputTex(const String& _name, size_t _mrtIndex = 0)
    00231                 : name(_name), mrtIndex(_mrtIndex) {}
    00232         };
    00233
    00240         void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0);
    00241
    00246         const InputTex &getInput(size_t id) const;
    00247
    00251         size_t getNumInputs() const;
    00252
    00256         void clearAllInputs();
    00257
    00261         CompositionTargetPass *getParent();
    00262
    00265         bool _isSupported(void);
    00266
    00270         void setQuadCorners(Real left,Real top,Real right,Real bottom);
    00271
    00275         bool getQuadCorners(Real & left,Real & top,Real & right,Real & bottom) const;
    00276
    00280         void setQuadFarCorners(bool farCorners, bool farCornersViewSpace);
    00281
    00285         bool getQuadFarCorners() const;
    00286
    00290         bool getQuadFarCornersViewSpace() const;
    00291
    00296         void setCustomType(const String& customType);
    00297
    00302         const String& getCustomType() const;
    00303
    00304     private:
    00306         CompositionTargetPass *mParent;
    00308         PassType mType;
    00310         uint32 mIdentifier;
    00312         MaterialPtr mMaterial;
    00314         uint8 mFirstRenderQueue;
    00315         uint8 mLastRenderQueue;
    00317         String mMaterialScheme;
    00319         uint32 mClearBuffers;
    00321         ColourValue mClearColour;
    00323         Real mClearDepth;
    00325         uint32 mClearStencil;
    00328         InputTex mInputs[OGRE_MAX_TEXTURE_LAYERS];
    00330         bool mStencilCheck;
    00331         CompareFunction mStencilFunc;
    00332         uint32 mStencilRefValue;
    00333         uint32 mStencilMask;
    00334         StencilOperation mStencilFailOp;
    00335         StencilOperation mStencilDepthFailOp;
    00336         StencilOperation mStencilPassOp;
    00337         bool mStencilTwoSidedOperation;
    00338
    00340         bool mQuadCornerModified;
    00342         Real mQuadLeft;
    00343         Real mQuadTop;
    00344         Real mQuadRight;
    00345         Real mQuadBottom;
    00346
    00347         bool mQuadFarCorners, mQuadFarCornersViewSpace;
    00348         //The type name of the custom composition pass.
    00349         String mCustomType;
    00350     };
    00354 }
    00355
    00356 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun May 8 2011 20:28:08