Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreBlendMode.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-2005 The OGRE Team
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 */
00025 #ifndef __BLENDMODE_H__
00026 #define __BLENDMODE_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 #include "OgreColourValue.h"
00030 
00031 namespace Ogre {
00032 
00035     enum LayerBlendType
00036     {
00037         LBT_COLOUR,
00038         LBT_ALPHA
00039     };
00040 
00048     enum LayerBlendOperation {
00050         LBO_REPLACE,
00052         LBO_ADD,
00054         LBO_MODULATE,
00056         LBO_ALPHA_BLEND
00057 
00058     };
00059 
00066     enum LayerBlendOperationEx {
00068         LBX_SOURCE1,
00070         LBX_SOURCE2,
00072         LBX_MODULATE,
00074         LBX_MODULATE_X2,
00076         LBX_MODULATE_X4,
00078         LBX_ADD,
00080         LBX_ADD_SIGNED,
00082         LBX_ADD_SMOOTH,
00084         LBX_SUBTRACT,
00086         LBX_BLEND_DIFFUSE_ALPHA,
00088         LBX_BLEND_TEXTURE_ALPHA,
00090         LBX_BLEND_CURRENT_ALPHA,
00092         LBX_BLEND_MANUAL,
00094         LBX_DOTPRODUCT,
00096         LBX_BLEND_DIFFUSE_COLOUR
00097     };
00098 
00103     enum LayerBlendSource
00104     {
00106         LBS_CURRENT,
00108         LBS_TEXTURE,
00110         LBS_DIFFUSE,
00112         LBS_SPECULAR,
00114         LBS_MANUAL
00115     };
00130     class _OgreExport LayerBlendModeEx
00131     {
00132     public:
00134         LayerBlendType blendType;
00136         LayerBlendOperationEx operation;
00138         LayerBlendSource source1;
00140         LayerBlendSource source2;
00141 
00143         ColourValue colourArg1;
00145         ColourValue colourArg2;
00147         Real alphaArg1;
00149         Real alphaArg2;
00151         Real factor;
00152 
00153         bool operator==(const LayerBlendModeEx& rhs) const
00154         {
00155             if (blendType != rhs.blendType) return false;
00156 
00157             if (blendType == LBT_COLOUR)
00158             {
00159 
00160                 if (operation == rhs.operation &&
00161                     source1 == rhs.source1 &&
00162                     source2 == rhs.source2 &&
00163                     colourArg1 == rhs.colourArg1 &&
00164                     colourArg2 == rhs.colourArg2 &&
00165                     factor == rhs.factor)
00166                 {
00167                     return true;
00168                 }
00169             }
00170             else // if (blendType == LBT_ALPHA)
00171             {
00172                 if (operation == rhs.operation &&
00173                     source1 == rhs.source1 &&
00174                     source2 == rhs.source2 &&
00175                     alphaArg1 == rhs.alphaArg1 &&
00176                     alphaArg2 == rhs.alphaArg2 &&
00177                     factor == rhs.factor)
00178                 {
00179                     return true;
00180                 }
00181             }
00182             return false;
00183         }
00184 
00185         bool operator!=(const LayerBlendModeEx& rhs) const
00186         {
00187             return !(*this == rhs);
00188         }
00189 
00190 
00191 
00192     };
00193 
00206     enum SceneBlendType
00207     {
00209         SBT_TRANSPARENT_ALPHA,
00211         SBT_TRANSPARENT_COLOUR,
00213         SBT_ADD,
00215         SBT_MODULATE,
00217         SBT_REPLACE
00218         // TODO : more
00219     };
00220 
00225     enum SceneBlendFactor
00226     {
00227         SBF_ONE,
00228         SBF_ZERO,
00229         SBF_DEST_COLOUR,
00230         SBF_SOURCE_COLOUR,
00231         SBF_ONE_MINUS_DEST_COLOUR,
00232         SBF_ONE_MINUS_SOURCE_COLOUR,
00233         SBF_DEST_ALPHA,
00234         SBF_SOURCE_ALPHA,
00235         SBF_ONE_MINUS_DEST_ALPHA,
00236         SBF_ONE_MINUS_SOURCE_ALPHA
00237 
00238     };
00239 }
00240 
00241 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:37 2006