BlendFunction.js 2.45 KB
Newer Older
Manggar Mahardhika's avatar
Manggar Mahardhika committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
import WebGLConstants from "../Core/WebGLConstants.js";

/**
 * Determines how blending factors are computed.
 *
 * @enum {Number}
 */
var BlendFunction = {
  /**
   * The blend factor is zero.
   *
   * @type {Number}
   * @constant
   */
  ZERO: WebGLConstants.ZERO,

  /**
   * The blend factor is one.
   *
   * @type {Number}
   * @constant
   */
  ONE: WebGLConstants.ONE,

  /**
   * The blend factor is the source color.
   *
   * @type {Number}
   * @constant
   */
  SOURCE_COLOR: WebGLConstants.SRC_COLOR,

  /**
   * The blend factor is one minus the source color.
   *
   * @type {Number}
   * @constant
   */
  ONE_MINUS_SOURCE_COLOR: WebGLConstants.ONE_MINUS_SRC_COLOR,

  /**
   * The blend factor is the destination color.
   *
   * @type {Number}
   * @constant
   */
  DESTINATION_COLOR: WebGLConstants.DST_COLOR,

  /**
   * The blend factor is one minus the destination color.
   *
   * @type {Number}
   * @constant
   */
  ONE_MINUS_DESTINATION_COLOR: WebGLConstants.ONE_MINUS_DST_COLOR,

  /**
   * The blend factor is the source alpha.
   *
   * @type {Number}
   * @constant
   */
  SOURCE_ALPHA: WebGLConstants.SRC_ALPHA,

  /**
   * The blend factor is one minus the source alpha.
   *
   * @type {Number}
   * @constant
   */
  ONE_MINUS_SOURCE_ALPHA: WebGLConstants.ONE_MINUS_SRC_ALPHA,

  /**
   * The blend factor is the destination alpha.
   *
   * @type {Number}
   * @constant
   */
  DESTINATION_ALPHA: WebGLConstants.DST_ALPHA,

  /**
   * The blend factor is one minus the destination alpha.
   *
   * @type {Number}
   * @constant
   */
  ONE_MINUS_DESTINATION_ALPHA: WebGLConstants.ONE_MINUS_DST_ALPHA,

  /**
   * The blend factor is the constant color.
   *
   * @type {Number}
   * @constant
   */
  CONSTANT_COLOR: WebGLConstants.CONSTANT_COLOR,

  /**
   * The blend factor is one minus the constant color.
   *
   * @type {Number}
   * @constant
   */
  ONE_MINUS_CONSTANT_COLOR: WebGLConstants.ONE_MINUS_CONSTANT_COLOR,

  /**
   * The blend factor is the constant alpha.
   *
   * @type {Number}
   * @constant
   */
  CONSTANT_ALPHA: WebGLConstants.CONSTANT_ALPHA,

  /**
   * The blend factor is one minus the constant alpha.
   *
   * @type {Number}
   * @constant
   */
  ONE_MINUS_CONSTANT_ALPHA: WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,

  /**
   * The blend factor is the saturated source alpha.
   *
   * @type {Number}
   * @constant
   */
  SOURCE_ALPHA_SATURATE: WebGLConstants.SRC_ALPHA_SATURATE,
};
export default Object.freeze(BlendFunction);