Enum Class RenderState.BlendMode

java.lang.Object
java.lang.Enum<RenderState.BlendMode>
com.jme3.material.RenderState.BlendMode
All Implemented Interfaces:
Serializable, Comparable<RenderState.BlendMode>, Constable
Enclosing class:
RenderState

public static enum RenderState.BlendMode extends Enum<RenderState.BlendMode>
BlendMode specifies the blending operation to use.
See Also:
  • Enum Constant Details

    • Off

      public static final RenderState.BlendMode Off
      No blending mode is used.
    • Additive

      public static final RenderState.BlendMode Additive
      Additive blending. For use with glows and particle emitters.

      Result = Source Color + Destination Color -> (GL_ONE, GL_ONE)

    • PremultAlpha

      public static final RenderState.BlendMode 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

      public static final RenderState.BlendMode 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

      public static final RenderState.BlendMode 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

      public static final RenderState.BlendMode 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

      public static final RenderState.BlendMode 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

      public static final RenderState.BlendMode Modulate
      Multiplies the source and dest colors.

      Result = Source Color * Dest Color -> (GL_DST_COLOR, GL_ZERO)

    • ModulateX2

      public static final RenderState.BlendMode ModulateX2
      Multiplies the source and dest colors then doubles the result.

      Result = 2 * Source Color * Dest Color -> (GL_DST_COLOR, GL_SRC_COLOR)

    • Screen

      public static final RenderState.BlendMode 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

      public static final RenderState.BlendMode 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

      public static final RenderState.BlendMode Custom
      Uses the blend equations and blend factors defined by the render state.

      These attributes can be set by using the following methods:

      Result.RGB = BlendEquation( sfactorRGB * Source.RGB , dfactorRGB * Destination.RGB )
      Result.A = BlendEquationAlpha( sfactorAlpha * Source.A , dfactorAlpha * Destination.A )

  • Method Details

    • values

      public static RenderState.BlendMode[] 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

      public static RenderState.BlendMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null