OgreBlendMode.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __BLENDMODE_H__
29 #define __BLENDMODE_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreColourValue.h"
33 
34 namespace Ogre {
45  {
48  };
49 
66 
67  };
68 
106  };
107 
113  {
124  };
140  {
141  public:
150 
161 
162  bool operator==(const LayerBlendModeEx& rhs) const
163  {
164  if (blendType != rhs.blendType) return false;
165 
166  if (blendType == LBT_COLOUR)
167  {
168 
169  if (operation == rhs.operation &&
170  source1 == rhs.source1 &&
171  source2 == rhs.source2 &&
172  colourArg1 == rhs.colourArg1 &&
173  colourArg2 == rhs.colourArg2 &&
174  factor == rhs.factor)
175  {
176  return true;
177  }
178  }
179  else // if (blendType == LBT_ALPHA)
180  {
181  if (operation == rhs.operation &&
182  source1 == rhs.source1 &&
183  source2 == rhs.source2 &&
184  alphaArg1 == rhs.alphaArg1 &&
185  alphaArg2 == rhs.alphaArg2 &&
186  factor == rhs.factor)
187  {
188  return true;
189  }
190  }
191  return false;
192  }
193 
194  bool operator!=(const LayerBlendModeEx& rhs) const
195  {
196  return !(*this == rhs);
197  }
198 
199 
200 
201  };
202 
216  {
227  // TODO : more
228  };
229 
235  {
246 
247  };
248 
254  {
260  };
264 }
265 
266 #endif
The default blend mode where source replaces destination.
the colour as built up from previous stages
multiply source1 and source2 together
Definition: OgreBlendMode.h:81
Real alphaArg1
Manual alpha value for manual source1.
#define _OgreExport
Definition: OgrePlatform.h:257
LayerBlendSource
List of valid sources of values for blending operations used in TextureUnitState::setColourOperation ...
ColourValue colourArg2
Manual colour value for manual source2.
as LBX_ADD, but subtract product from the sum
Definition: OgreBlendMode.h:91
Add the texture values to the existing scene content.
ColourValue colourArg1
Manual colour value for manual source1.
Class representing colour.
float Real
Software floating point type.
LayerBlendSource source2
The second source of colour/alpha.
SceneBlendType
Types of blending that you can specify between an object and the existing contents of the scene...
Real factor
Manual blending factor.
Real alphaArg2
Manual alpha value for manual source2.
Replace all colour with texture with no adjustment.
Definition: OgreBlendMode.h:59
use interpolated color values from vertices to scale source1, then add source2 scaled by (1-color) ...
a colour supplied manually as a separate argument
use source2 without modification
Definition: OgreBlendMode.h:79
dot product of color1 and color2
as LBX_BLEND_DIFFUSE_ALPHA, but use alpha from texture
Definition: OgreBlendMode.h:97
LayerBlendType
Type of texture blend mode.
Definition: OgreBlendMode.h:44
Make the object transparent based on the colour values in the texture (brighter = more opaque) ...
bool operator!=(const LayerBlendModeEx &rhs) const
the interpolated diffuse colour from the vertices
Class which manages blending of both colour and alpha components.
Blend based on texture alpha.
Definition: OgreBlendMode.h:65
as LBX_ADD, but subtract 0.5 from the result
Definition: OgreBlendMode.h:89
as LBX_MODULATE but brighten more afterwards (x4)
Definition: OgreBlendMode.h:85
Add colour components together.
Definition: OgreBlendMode.h:61
use interpolated alpha value from vertices to scale source1, then add source2 scaled by (1-alpha) ...
Definition: OgreBlendMode.h:95
LayerBlendOperationEx operation
The operation to be applied.
use source1 without modification
Definition: OgreBlendMode.h:77
bool operator==(const LayerBlendModeEx &rhs) const
subtract source2 from source1
Definition: OgreBlendMode.h:93
LayerBlendOperationEx
Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx...
Definition: OgreBlendMode.h:75
Multiply the 2 colours together.
Multiply colour components together.
Definition: OgreBlendMode.h:63
the interpolated specular colour from the vertices
SceneBlendFactor
Blending factors for manually blending objects with the scene.
as LBX_BLEND_DIFFUSE_ALPHA, but use current alpha from previous stages
Definition: OgreBlendMode.h:99
add source1 and source2 together
Definition: OgreBlendMode.h:87
LayerBlendSource source1
The first source of colour/alpha.
as LBX_MODULATE but brighten afterwards (x2)
Definition: OgreBlendMode.h:83
LayerBlendType blendType
The type of blending (colour or alpha)
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
Make the object transparent based on the final alpha values in the texture.
the colour derived from the texture assigned to this layer
as LBX_BLEND_DIFFUSE_ALPHA but use a constant manual blend value (0.0-1.0)
LayerBlendOperation
List of valid texture blending operations, for use with TextureUnitState::setColourOperation.
Definition: OgreBlendMode.h:57

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sat Oct 25 2014 14:52:00