Enum Class RenderState.BlendMode
- All Implemented Interfaces:
Serializable
,Comparable<RenderState.BlendMode>
,Constable
- Enclosing class:
- RenderState
BlendMode
specifies the blending operation to use.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAdditive blending.Alpha blending, interpolates to source color from dest color using source alpha.Additive blending that is multiplied with source alpha.Alpha blending, interpolates to source color from dest color using source alpha.Color blending, blends in color from dest color using source color.Uses the blend equations and blend factors defined by the render state.Mixes the destination and source colors similar to a color-based XOR operation.Multiplies the source and dest colors.Multiplies the source and dest colors then doubles the result.No blending mode is used.Premultiplied alpha blending, for use with premult alpha textures.Opposite effect of Modulate/Multiply. -
Method Summary
Modifier and TypeMethodDescriptionstatic RenderState.BlendMode
Returns the enum constant of this class with the specified name.static RenderState.BlendMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Off
No blending mode is used. -
Additive
Additive blending. For use with glows and particle emitters.Result = Source Color + Destination Color -> (GL_ONE, GL_ONE)
-
PremultAlpha
Premultiplied alpha blending, for use with premult alpha textures.Result = Source Color + (Dest Color * (1 - Source Alpha) ) -> (GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
-
AlphaAdditive
Additive blending that is multiplied with source alpha. For use with glows and particle emitters.Result = (Source Alpha * Source Color) + Dest Color -> (GL_SRC_ALPHA, GL_ONE)
-
Color
Color blending, blends in color from dest color using source color.Result = Source Color + (1 - Source Color) * Dest Color -> (GL_ONE, GL_ONE_MINUS_SRC_COLOR)
-
Alpha
Alpha blending, interpolates to source color from dest color using source alpha.Result = Source Alpha * Source Color + (1 - Source Alpha) * Dest Color -> (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
-
AlphaSumA
Alpha blending, interpolates to source color from dest color using source alpha. The resulting alpha is the sum between the source alpha and the destination alpha.Result.rgb = Source Alpha * Source Color + (1 - Source Alpha) * Dest Color -> (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) Result.a = 1 * Source Alpha + 1 * Dest Alpha -> (GL_ONE, GL_ONE)
-
Modulate
Multiplies the source and dest colors.Result = Source Color * Dest Color -> (GL_DST_COLOR, GL_ZERO)
-
ModulateX2
Multiplies the source and dest colors then doubles the result.Result = 2 * Source Color * Dest Color -> (GL_DST_COLOR, GL_SRC_COLOR)
-
Screen
Opposite effect of Modulate/Multiply. Invert both colors, multiply and then invert the result.Result = 1 - (1 - Source Color) * (1 - Dest Color) -> (GL_ONE, GL_ONE_MINUS_SRC_COLOR)
-
Exclusion
Mixes the destination and source colors similar to a color-based XOR operation. This is directly equivalent to Photoshop's "Exclusion" blend.Result = (Source Color * (1 - Dest Color)) + (Dest Color * (1 - Source Color)) -> (GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR)
-
Custom
Uses the blend equations and blend factors defined by the render state.These attributes can be set by using the following methods:
RenderState.setBlendEquation(BlendEquation)
RenderState.setBlendEquationAlpha(BlendEquationAlpha)
RenderState.setCustomBlendFactors(BlendFunc, BlendFunc, BlendFunc, BlendFunc)
Result.RGB = BlendEquation( sfactorRGB * Source.RGB , dfactorRGB * Destination.RGB )
Result.A = BlendEquationAlpha( sfactorAlpha * Source.A , dfactorAlpha * Destination.A )
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-