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-2013 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 #include "OgreHeaderPrefix.h" 00036 00037 namespace Ogre { 00047 class _OgreExport CompositionPass : public CompositorInstAlloc 00048 { 00049 public: 00050 CompositionPass(CompositionTargetPass *parent); 00051 ~CompositionPass(); 00052 00055 enum PassType 00056 { 00057 PT_CLEAR, 00058 PT_STENCIL, 00059 PT_RENDERSCENE, 00060 PT_RENDERQUAD, 00061 PT_RENDERCUSTOM 00062 }; 00063 00065 void setType(PassType type); 00067 PassType getType() const; 00068 00072 void setIdentifier(uint32 id); 00074 uint32 getIdentifier() const; 00075 00079 void setMaterial(const MaterialPtr& mat); 00083 void setMaterialName(const String &name); 00087 const MaterialPtr& getMaterial() const; 00091 void setFirstRenderQueue(uint8 id); 00095 uint8 getFirstRenderQueue() const; 00099 void setLastRenderQueue(uint8 id); 00103 uint8 getLastRenderQueue() const; 00104 00110 void setMaterialScheme(const String& schemeName); 00116 const String& getMaterialScheme(void) const; 00117 00128 void setClearBuffers(uint32 val); 00132 uint32 getClearBuffers() const; 00136 void setClearColour(ColourValue val); 00140 const ColourValue &getClearColour() const; 00144 void setClearDepth(Real depth); 00148 Real getClearDepth() const; 00152 void setClearStencil(uint32 value); 00156 uint32 getClearStencil() const; 00157 00161 void setStencilCheck(bool value); 00165 bool getStencilCheck() const; 00169 void setStencilFunc(CompareFunction value); 00173 CompareFunction getStencilFunc() const; 00177 void setStencilRefValue(uint32 value); 00181 uint32 getStencilRefValue() const; 00185 void setStencilMask(uint32 value); 00189 uint32 getStencilMask() const; 00193 void setStencilFailOp(StencilOperation value); 00197 StencilOperation getStencilFailOp() const; 00201 void setStencilDepthFailOp(StencilOperation value); 00205 StencilOperation getStencilDepthFailOp() const; 00209 void setStencilPassOp(StencilOperation value); 00213 StencilOperation getStencilPassOp() const; 00217 void setStencilTwoSidedOperation(bool value); 00221 bool getStencilTwoSidedOperation() const; 00222 00224 struct InputTex 00225 { 00227 String name; 00229 size_t mrtIndex; 00230 InputTex() : name(StringUtil::BLANK), mrtIndex(0) {} 00231 InputTex(const String& _name, size_t _mrtIndex = 0) 00232 : name(_name), mrtIndex(_mrtIndex) {} 00233 }; 00234 00241 void setInput(size_t id, const String &input=StringUtil::BLANK, size_t mrtIndex=0); 00242 00247 const InputTex &getInput(size_t id) const; 00248 00252 size_t getNumInputs() const; 00253 00257 void clearAllInputs(); 00258 00262 CompositionTargetPass *getParent(); 00263 00266 bool _isSupported(void); 00267 00271 void setQuadCorners(Real left,Real top,Real right,Real bottom); 00272 00276 bool getQuadCorners(Real & left,Real & top,Real & right,Real & bottom) const; 00277 00281 void setQuadFarCorners(bool farCorners, bool farCornersViewSpace); 00282 00286 bool getQuadFarCorners() const; 00287 00291 bool getQuadFarCornersViewSpace() const; 00292 00297 void setCustomType(const String& customType); 00298 00303 const String& getCustomType() const; 00304 00305 private: 00307 CompositionTargetPass *mParent; 00309 PassType mType; 00311 uint32 mIdentifier; 00313 MaterialPtr mMaterial; 00315 uint8 mFirstRenderQueue; 00316 uint8 mLastRenderQueue; 00318 String mMaterialScheme; 00320 uint32 mClearBuffers; 00322 ColourValue mClearColour; 00324 Real mClearDepth; 00326 uint32 mClearStencil; 00329 InputTex mInputs[OGRE_MAX_TEXTURE_LAYERS]; 00331 bool mStencilCheck; 00332 CompareFunction mStencilFunc; 00333 uint32 mStencilRefValue; 00334 uint32 mStencilMask; 00335 StencilOperation mStencilFailOp; 00336 StencilOperation mStencilDepthFailOp; 00337 StencilOperation mStencilPassOp; 00338 bool mStencilTwoSidedOperation; 00339 00341 bool mQuadCornerModified; 00343 Real mQuadLeft; 00344 Real mQuadTop; 00345 Real mQuadRight; 00346 Real mQuadBottom; 00347 00348 bool mQuadFarCorners, mQuadFarCornersViewSpace; 00350 String mCustomType; 00351 }; 00355 } 00356 00357 #include "OgreHeaderSuffix.h" 00358 00359 #endif
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:41