OGRE  1.9.0
OgreBlendMode.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __BLENDMODE_H__
29#define __BLENDMODE_H__
30
31#include "OgrePrerequisites.h"
32#include "OgreColourValue.h"
33
34namespace Ogre {
41
49
68
107
125
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
229
248
261
263
264}
265
266#endif
#define _OgreExport
Class representing colour.
Class which manages blending of both colour and alpha components.
bool operator==(const LayerBlendModeEx &rhs) const
LayerBlendSource source1
The first source of colour/alpha.
ColourValue colourArg2
Manual colour value for manual source2.
Real factor
Manual blending factor.
Real alphaArg1
Manual alpha value for manual source1.
bool operator!=(const LayerBlendModeEx &rhs) const
LayerBlendSource source2
The second source of colour/alpha.
ColourValue colourArg1
Manual colour value for manual source1.
Real alphaArg2
Manual alpha value for manual source2.
LayerBlendType blendType
The type of blending (colour or alpha)
LayerBlendOperationEx operation
The operation to be applied.
LayerBlendType
Type of texture blend mode.
LayerBlendOperationEx
Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx...
SceneBlendFactor
Blending factors for manually blending objects with the scene.
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
LayerBlendOperation
List of valid texture blending operations, for use with TextureUnitState::setColourOperation.
SceneBlendType
Types of blending that you can specify between an object and the existing contents of the scene.
LayerBlendSource
List of valid sources of values for blending operations used in TextureUnitState::setColourOperation ...
@ LBT_ALPHA
@ LBT_COLOUR
@ LBX_MODULATE_X4
as LBX_MODULATE but brighten more afterwards (x4)
@ LBX_BLEND_TEXTURE_ALPHA
as LBX_BLEND_DIFFUSE_ALPHA, but use alpha from texture
@ LBX_BLEND_CURRENT_ALPHA
as LBX_BLEND_DIFFUSE_ALPHA, but use current alpha from previous stages
@ LBX_SOURCE2
use source2 without modification
@ LBX_DOTPRODUCT
dot product of color1 and color2
@ LBX_MODULATE_X2
as LBX_MODULATE but brighten afterwards (x2)
@ LBX_SOURCE1
use source1 without modification
@ LBX_ADD_SMOOTH
as LBX_ADD, but subtract product from the sum
@ LBX_MODULATE
multiply source1 and source2 together
@ LBX_ADD
add source1 and source2 together
@ LBX_BLEND_DIFFUSE_ALPHA
use interpolated alpha value from vertices to scale source1, then add source2 scaled by (1-alpha)
@ LBX_BLEND_MANUAL
as LBX_BLEND_DIFFUSE_ALPHA but use a constant manual blend value (0.0-1.0)
@ LBX_SUBTRACT
subtract source2 from source1
@ LBX_ADD_SIGNED
as LBX_ADD, but subtract 0.5 from the result
@ LBX_BLEND_DIFFUSE_COLOUR
use interpolated color values from vertices to scale source1, then add source2 scaled by (1-color)
@ SBF_ONE_MINUS_SOURCE_ALPHA
@ SBF_ONE_MINUS_DEST_ALPHA
@ SBF_DEST_ALPHA
@ SBF_SOURCE_ALPHA
@ SBF_ONE_MINUS_DEST_COLOUR
@ SBF_ONE_MINUS_SOURCE_COLOUR
@ SBF_SOURCE_COLOUR
@ SBF_DEST_COLOUR
@ SBO_SUBTRACT
@ SBO_REVERSE_SUBTRACT
@ LBO_ADD
Add colour components together.
@ LBO_MODULATE
Multiply colour components together.
@ LBO_ALPHA_BLEND
Blend based on texture alpha.
@ LBO_REPLACE
Replace all colour with texture with no adjustment.
@ SBT_MODULATE
Multiply the 2 colours together.
@ SBT_TRANSPARENT_ALPHA
Make the object transparent based on the final alpha values in the texture.
@ SBT_TRANSPARENT_COLOUR
Make the object transparent based on the colour values in the texture (brighter = more opaque)
@ SBT_REPLACE
The default blend mode where source replaces destination.
@ SBT_ADD
Add the texture values to the existing scene content.
@ LBS_DIFFUSE
the interpolated diffuse colour from the vertices
@ LBS_CURRENT
the colour as built up from previous stages
@ LBS_TEXTURE
the colour derived from the texture assigned to this layer
@ LBS_MANUAL
a colour supplied manually as a separate argument
@ LBS_SPECULAR
the interpolated specular colour from the vertices
float Real
Software floating point type.