# 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
    00095     };
    00096
    00101     enum LayerBlendSource
    00102     {
    00104         LBS_CURRENT,
    00106         LBS_TEXTURE,
    00108         LBS_DIFFUSE,
    00110         LBS_SPECULAR,
    00112         LBS_MANUAL
    00113     };
    00128     class _OgreExport LayerBlendModeEx
    00129     {
    00130     public:
    00132         LayerBlendType blendType;
    00134         LayerBlendOperationEx operation;
    00136         LayerBlendSource source1;
    00138         LayerBlendSource source2;
    00139
    00141         ColourValue colourArg1;
    00143         ColourValue colourArg2;
    00145         Real alphaArg1;
    00147         Real alphaArg2;
    00149         Real factor;
    00150
    00151         bool operator==(const LayerBlendModeEx& rhs) const
    00152         {
    00153             if (blendType != rhs.blendType) return false;
    00154
    00155             if (blendType == LBT_COLOUR)
    00156             {
    00157
    00158                 if (operation == rhs.operation &&
    00159                     source1 == rhs.source1 &&
    00160                     source2 == rhs.source2 &&
    00161                     colourArg1 == rhs.colourArg1 &&
    00162                     colourArg2 == rhs.colourArg2 &&
    00163                     factor == rhs.factor)
    00164                 {
    00165                     return true;
    00166                 }
    00167             }
    00168             else // if (blendType == LBT_ALPHA)
    00169             {
    00170                 if (operation == rhs.operation &&
    00171                     source1 == rhs.source1 &&
    00172                     source2 == rhs.source2 &&
    00173                     alphaArg1 == rhs.alphaArg1 &&
    00174                     alphaArg2 == rhs.alphaArg2 &&
    00175                     factor == rhs.factor)
    00176                 {
    00177                     return true;
    00178                 }
    00179             }
    00180             return false;
    00181         }
    00182
    00183         bool operator!=(const LayerBlendModeEx& rhs) const
    00184         {
    00185             return !(*this == rhs);
    00186         }
    00187
    00188
    00189
    00190     };
    00191
    00204     enum SceneBlendType
    00205     {
    00207         SBT_TRANSPARENT_ALPHA,
    00209         SBT_TRANSPARENT_COLOUR,
    00211         SBT_ADD,
    00213         SBT_MODULATE
    00214         // TODO : more
    00215     };
    00216
    00221     enum SceneBlendFactor
    00222     {
    00223         SBF_ONE,
    00224         SBF_ZERO,
    00225         SBF_DEST_COLOUR,
    00226         SBF_SOURCE_COLOUR,
    00227         SBF_ONE_MINUS_DEST_COLOUR,
    00228         SBF_ONE_MINUS_SOURCE_COLOUR,
    00229         SBF_DEST_ALPHA,
    00230         SBF_SOURCE_ALPHA,
    00231         SBF_ONE_MINUS_DEST_ALPHA,
    00232         SBF_ONE_MINUS_SOURCE_ALPHA
    00233
    00234     };
    00235 }
    00236
    00237 #endif

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