# 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-2006 Torus Knot Software Ltd
    00008 Also see acknowledgements in Readme.html
    00009
    00010 This program is free software; you can redistribute it and/or modify it under
    00011 the terms of the GNU Lesser General Public License as published by the Free Software
    00012 Foundation; either version 2 of the License, or (at your option) any later
    00013 version.
    00014
    00015 This program is distributed in the hope that it will be useful, but WITHOUT
    00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00018
    00019 You should have received a copy of the GNU Lesser General Public License along with
    00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00022 http://www.gnu.org/copyleft/lesser.txt.
    00023
    00024 You may alternatively use this source under the terms of a specific version of
    00025 the OGRE Unrestricted License provided you have obtained such a license from
    00026 Torus Knot Software Ltd.
    00027 -----------------------------------------------------------------------------
    00028 */
    00029 #ifndef __CompositionPass_H__
    00030 #define __CompositionPass_H__
    00031
    00032 #include "OgrePrerequisites.h"
    00033 #include "OgreMaterial.h"
    00034 #include "OgreRenderSystem.h"
    00035 #include "OgreRenderQueue.h"
    00036
    00037 namespace Ogre {
    00041     class _OgreExport CompositionPass : public CompositorInstAlloc
    00042     {
    00043     public:
    00044         CompositionPass(CompositionTargetPass *parent);
    00045         ~CompositionPass();
    00046
    00049         enum PassType
    00050         {
    00051             PT_CLEAR,           // Clear target to one colour
    00052             PT_STENCIL,         // Set stencil operation
    00053             PT_RENDERSCENE,     // Render the scene or part of it
    00054             PT_RENDERQUAD       // Render a full screen quad
    00055         };
    00056
    00058         void setType(PassType type);
    00060         PassType getType() const;
    00061
    00065         void setIdentifier(uint32 id);
    00067         uint32 getIdentifier() const;
    00068
    00072         void setMaterial(const MaterialPtr& mat);
    00076         void setMaterialName(const String &name);
    00080         const MaterialPtr& getMaterial() const;
    00084         void setFirstRenderQueue(uint8 id);
    00088         uint8 getFirstRenderQueue();
    00092         void setLastRenderQueue(uint8 id);
    00096         uint8 getLastRenderQueue();
    00097
    00108         void setClearBuffers(uint32 val);
    00112         uint32 getClearBuffers();
    00116         void setClearColour(ColourValue val);
    00120         const ColourValue &getClearColour();
    00124         void setClearDepth(Real depth);
    00128         Real getClearDepth();
    00132         void setClearStencil(uint32 value);
    00136         uint32 getClearStencil();
    00137
    00141         void setStencilCheck(bool value);
    00145         bool getStencilCheck();
    00149         void setStencilFunc(CompareFunction value);
    00153         CompareFunction getStencilFunc();
    00157         void setStencilRefValue(uint32 value);
    00161         uint32 getStencilRefValue();
    00165         void setStencilMask(uint32 value);
    00169         uint32 getStencilMask();
    00173         void setStencilFailOp(StencilOperation value);
    00177         StencilOperation getStencilFailOp();
    00181         void setStencilDepthFailOp(StencilOperation value);
    00185         StencilOperation getStencilDepthFailOp();
    00189         void setStencilPassOp(StencilOperation value);
    00193         StencilOperation getStencilPassOp();
    00197         void setStencilTwoSidedOperation(bool value);
    00201         bool getStencilTwoSidedOperation();
    00202
    00204         struct InputTex
    00205         {
    00207             String name;
    00209             size_t mrtIndex;
    00210             InputTex() : name(StringUtil::BLANK), mrtIndex(0) {}
    00211             InputTex(const String& _name, size_t _mrtIndex = 0)
    00212                 : name(_name), mrtIndex(_mrtIndex) {}
    00213         };
    00214
    00221         void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0);
    00222
    00227         const InputTex &getInput(size_t id);
    00228
    00232         size_t getNumInputs();
    00233
    00237         void clearAllInputs();
    00238
    00242         CompositionTargetPass *getParent();
    00243
    00246         bool _isSupported(void);
    00247
    00251         void setQuadCorners(Real left,Real top,Real right,Real bottom);
    00252
    00256         bool getQuadCorners(Real & left,Real & top,Real & right,Real & bottom) const;
    00257
    00258     private:
    00260         CompositionTargetPass *mParent;
    00262         PassType mType;
    00264         uint32 mIdentifier;
    00266         MaterialPtr mMaterial;
    00268         uint8 mFirstRenderQueue;
    00269         uint8 mLastRenderQueue;
    00271         uint32 mClearBuffers;
    00273         ColourValue mClearColour;
    00275         Real mClearDepth;
    00277         uint32 mClearStencil;
    00280         InputTex mInputs[OGRE_MAX_TEXTURE_LAYERS];
    00282         bool mStencilCheck;
    00283         CompareFunction mStencilFunc;
    00284         uint32 mStencilRefValue;
    00285         uint32 mStencilMask;
    00286         StencilOperation mStencilFailOp;
    00287         StencilOperation mStencilDepthFailOp;
    00288         StencilOperation mStencilPassOp;
    00289         bool mStencilTwoSidedOperation;
    00290
    00292         bool mQuadCornerModified;
    00294         Real mQuadLeft;
    00295         Real mQuadTop;
    00296         Real mQuadRight;
    00297         Real mQuadBottom;
    00298     };
    00299
    00300 }
    00301
    00302 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Dec 27 17:31:04 2009