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  };
139  class _OgreExport LayerBlendModeEx
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
Ogre::LBX_BLEND_DIFFUSE_ALPHA
@ LBX_BLEND_DIFFUSE_ALPHA
use interpolated alpha value from vertices to scale source1, then add source2 scaled by (1-alpha)
Definition: OgreBlendMode.h:95
Ogre::LBO_REPLACE
@ LBO_REPLACE
Replace all colour with texture with no adjustment.
Definition: OgreBlendMode.h:59
Ogre::LayerBlendModeEx::operator!=
bool operator!=(const LayerBlendModeEx &rhs) const
Definition: OgreBlendMode.h:194
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::LayerBlendModeEx::factor
Real factor
Manual blending factor.
Definition: OgreBlendMode.h:160
Ogre::SBT_MODULATE
@ SBT_MODULATE
Multiply the 2 colours together.
Definition: OgreBlendMode.h:224
Ogre::LBS_MANUAL
@ LBS_MANUAL
a colour supplied manually as a separate argument
Definition: OgreBlendMode.h:123
Ogre::LayerBlendModeEx::operator==
bool operator==(const LayerBlendModeEx &rhs) const
Definition: OgreBlendMode.h:162
Ogre::LBX_DOTPRODUCT
@ LBX_DOTPRODUCT
dot product of color1 and color2
Definition: OgreBlendMode.h:103
Ogre::SBO_REVERSE_SUBTRACT
@ SBO_REVERSE_SUBTRACT
Definition: OgreBlendMode.h:257
Ogre::LayerBlendSource
LayerBlendSource
List of valid sources of values for blending operations used in TextureUnitState::setColourOperation ...
Definition: OgreBlendMode.h:112
Ogre::SBF_ONE_MINUS_DEST_ALPHA
@ SBF_ONE_MINUS_DEST_ALPHA
Definition: OgreBlendMode.h:244
Ogre::LBX_ADD
@ LBX_ADD
add source1 and source2 together
Definition: OgreBlendMode.h:87
Ogre::SBT_TRANSPARENT_COLOUR
@ SBT_TRANSPARENT_COLOUR
Make the object transparent based on the colour values in the texture (brighter = more opaque)
Definition: OgreBlendMode.h:220
Ogre::LayerBlendModeEx::colourArg1
ColourValue colourArg1
Manual colour value for manual source1.
Definition: OgreBlendMode.h:152
Ogre::LayerBlendModeEx::source1
LayerBlendSource source1
The first source of colour/alpha.
Definition: OgreBlendMode.h:147
Ogre::LBX_SOURCE2
@ LBX_SOURCE2
use source2 without modification
Definition: OgreBlendMode.h:79
Ogre::LBT_ALPHA
@ LBT_ALPHA
Definition: OgreBlendMode.h:47
Ogre::SBT_TRANSPARENT_ALPHA
@ SBT_TRANSPARENT_ALPHA
Make the object transparent based on the final alpha values in the texture.
Definition: OgreBlendMode.h:218
Ogre::LBS_TEXTURE
@ LBS_TEXTURE
the colour derived from the texture assigned to this layer
Definition: OgreBlendMode.h:117
Ogre::SBF_DEST_COLOUR
@ SBF_DEST_COLOUR
Definition: OgreBlendMode.h:238
Ogre::LBO_MODULATE
@ LBO_MODULATE
Multiply colour components together.
Definition: OgreBlendMode.h:63
Ogre::LBS_DIFFUSE
@ LBS_DIFFUSE
the interpolated diffuse colour from the vertices
Definition: OgreBlendMode.h:119
Ogre::SBT_ADD
@ SBT_ADD
Add the texture values to the existing scene content.
Definition: OgreBlendMode.h:222
Ogre::LayerBlendModeEx
Class which manages blending of both colour and alpha components.
Definition: OgreBlendMode.h:139
Ogre::SBF_SOURCE_COLOUR
@ SBF_SOURCE_COLOUR
Definition: OgreBlendMode.h:239
Ogre::SBT_REPLACE
@ SBT_REPLACE
The default blend mode where source replaces destination.
Definition: OgreBlendMode.h:226
Ogre::LayerBlendType
LayerBlendType
Type of texture blend mode.
Definition: OgreBlendMode.h:44
Ogre::SBO_SUBTRACT
@ SBO_SUBTRACT
Definition: OgreBlendMode.h:256
Ogre::SBF_ONE_MINUS_SOURCE_ALPHA
@ SBF_ONE_MINUS_SOURCE_ALPHA
Definition: OgreBlendMode.h:245
Ogre::LBX_SUBTRACT
@ LBX_SUBTRACT
subtract source2 from source1
Definition: OgreBlendMode.h:93
Ogre::SBO_MIN
@ SBO_MIN
Definition: OgreBlendMode.h:258
Ogre::LBX_BLEND_MANUAL
@ LBX_BLEND_MANUAL
as LBX_BLEND_DIFFUSE_ALPHA but use a constant manual blend value (0.0-1.0)
Definition: OgreBlendMode.h:101
Ogre::LayerBlendModeEx::operation
LayerBlendOperationEx operation
The operation to be applied.
Definition: OgreBlendMode.h:145
Ogre::LBS_SPECULAR
@ LBS_SPECULAR
the interpolated specular colour from the vertices
Definition: OgreBlendMode.h:121
Ogre::SBF_ZERO
@ SBF_ZERO
Definition: OgreBlendMode.h:237
Ogre::SceneBlendFactor
SceneBlendFactor
Blending factors for manually blending objects with the scene.
Definition: OgreBlendMode.h:234
Ogre::SBF_ONE_MINUS_SOURCE_COLOUR
@ SBF_ONE_MINUS_SOURCE_COLOUR
Definition: OgreBlendMode.h:241
OgrePrerequisites.h
Ogre::LayerBlendModeEx::colourArg2
ColourValue colourArg2
Manual colour value for manual source2.
Definition: OgreBlendMode.h:154
Ogre::LayerBlendModeEx::source2
LayerBlendSource source2
The second source of colour/alpha.
Definition: OgreBlendMode.h:149
Ogre::LBX_ADD_SMOOTH
@ LBX_ADD_SMOOTH
as LBX_ADD, but subtract product from the sum
Definition: OgreBlendMode.h:91
Ogre::LayerBlendModeEx::blendType
LayerBlendType blendType
The type of blending (colour or alpha)
Definition: OgreBlendMode.h:143
Ogre::LayerBlendModeEx::alphaArg2
Real alphaArg2
Manual alpha value for manual source2.
Definition: OgreBlendMode.h:158
Ogre::LBT_COLOUR
@ LBT_COLOUR
Definition: OgreBlendMode.h:46
Ogre::LBX_MODULATE_X2
@ LBX_MODULATE_X2
as LBX_MODULATE but brighten afterwards (x2)
Definition: OgreBlendMode.h:83
Ogre::SBO_ADD
@ SBO_ADD
Definition: OgreBlendMode.h:255
Ogre::LBX_BLEND_CURRENT_ALPHA
@ LBX_BLEND_CURRENT_ALPHA
as LBX_BLEND_DIFFUSE_ALPHA, but use current alpha from previous stages
Definition: OgreBlendMode.h:99
Ogre::LBX_BLEND_TEXTURE_ALPHA
@ LBX_BLEND_TEXTURE_ALPHA
as LBX_BLEND_DIFFUSE_ALPHA, but use alpha from texture
Definition: OgreBlendMode.h:97
Ogre::SBF_ONE
@ SBF_ONE
Definition: OgreBlendMode.h:236
Ogre::LayerBlendOperation
LayerBlendOperation
List of valid texture blending operations, for use with TextureUnitState::setColourOperation.
Definition: OgreBlendMode.h:57
Ogre::LBX_ADD_SIGNED
@ LBX_ADD_SIGNED
as LBX_ADD, but subtract 0.5 from the result
Definition: OgreBlendMode.h:89
Ogre::LBO_ALPHA_BLEND
@ LBO_ALPHA_BLEND
Blend based on texture alpha.
Definition: OgreBlendMode.h:65
Ogre::LBX_BLEND_DIFFUSE_COLOUR
@ LBX_BLEND_DIFFUSE_COLOUR
use interpolated color values from vertices to scale source1, then add source2 scaled by (1-color)
Definition: OgreBlendMode.h:105
OgreColourValue.h
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::LBO_ADD
@ LBO_ADD
Add colour components together.
Definition: OgreBlendMode.h:61
Ogre::LBS_CURRENT
@ LBS_CURRENT
the colour as built up from previous stages
Definition: OgreBlendMode.h:115
Ogre::LBX_MODULATE_X4
@ LBX_MODULATE_X4
as LBX_MODULATE but brighten more afterwards (x4)
Definition: OgreBlendMode.h:85
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::SBF_SOURCE_ALPHA
@ SBF_SOURCE_ALPHA
Definition: OgreBlendMode.h:243
Ogre::LayerBlendOperationEx
LayerBlendOperationEx
Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx...
Definition: OgreBlendMode.h:75
Ogre::SBF_ONE_MINUS_DEST_COLOUR
@ SBF_ONE_MINUS_DEST_COLOUR
Definition: OgreBlendMode.h:240
Ogre::LBX_MODULATE
@ LBX_MODULATE
multiply source1 and source2 together
Definition: OgreBlendMode.h:81
Ogre::SBO_MAX
@ SBO_MAX
Definition: OgreBlendMode.h:259
Ogre::SBF_DEST_ALPHA
@ SBF_DEST_ALPHA
Definition: OgreBlendMode.h:242
Ogre::LBX_SOURCE1
@ LBX_SOURCE1
use source1 without modification
Definition: OgreBlendMode.h:77
Ogre::LayerBlendModeEx::alphaArg1
Real alphaArg1
Manual alpha value for manual source1.
Definition: OgreBlendMode.h:156
Ogre::SceneBlendType
SceneBlendType
Types of blending that you can specify between an object and the existing contents of the scene.
Definition: OgreBlendMode.h:215
Ogre::SceneBlendOperation
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
Definition: OgreBlendMode.h:253

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 Tue Apr 13 2021 08:53:15