BlendFunction.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import WebGLConstants from "../Core/WebGLConstants.js";
  2. /**
  3. * Determines how blending factors are computed.
  4. *
  5. * @enum {Number}
  6. */
  7. const BlendFunction = {
  8. /**
  9. * The blend factor is zero.
  10. *
  11. * @type {Number}
  12. * @constant
  13. */
  14. ZERO: WebGLConstants.ZERO,
  15. /**
  16. * The blend factor is one.
  17. *
  18. * @type {Number}
  19. * @constant
  20. */
  21. ONE: WebGLConstants.ONE,
  22. /**
  23. * The blend factor is the source color.
  24. *
  25. * @type {Number}
  26. * @constant
  27. */
  28. SOURCE_COLOR: WebGLConstants.SRC_COLOR,
  29. /**
  30. * The blend factor is one minus the source color.
  31. *
  32. * @type {Number}
  33. * @constant
  34. */
  35. ONE_MINUS_SOURCE_COLOR: WebGLConstants.ONE_MINUS_SRC_COLOR,
  36. /**
  37. * The blend factor is the destination color.
  38. *
  39. * @type {Number}
  40. * @constant
  41. */
  42. DESTINATION_COLOR: WebGLConstants.DST_COLOR,
  43. /**
  44. * The blend factor is one minus the destination color.
  45. *
  46. * @type {Number}
  47. * @constant
  48. */
  49. ONE_MINUS_DESTINATION_COLOR: WebGLConstants.ONE_MINUS_DST_COLOR,
  50. /**
  51. * The blend factor is the source alpha.
  52. *
  53. * @type {Number}
  54. * @constant
  55. */
  56. SOURCE_ALPHA: WebGLConstants.SRC_ALPHA,
  57. /**
  58. * The blend factor is one minus the source alpha.
  59. *
  60. * @type {Number}
  61. * @constant
  62. */
  63. ONE_MINUS_SOURCE_ALPHA: WebGLConstants.ONE_MINUS_SRC_ALPHA,
  64. /**
  65. * The blend factor is the destination alpha.
  66. *
  67. * @type {Number}
  68. * @constant
  69. */
  70. DESTINATION_ALPHA: WebGLConstants.DST_ALPHA,
  71. /**
  72. * The blend factor is one minus the destination alpha.
  73. *
  74. * @type {Number}
  75. * @constant
  76. */
  77. ONE_MINUS_DESTINATION_ALPHA: WebGLConstants.ONE_MINUS_DST_ALPHA,
  78. /**
  79. * The blend factor is the constant color.
  80. *
  81. * @type {Number}
  82. * @constant
  83. */
  84. CONSTANT_COLOR: WebGLConstants.CONSTANT_COLOR,
  85. /**
  86. * The blend factor is one minus the constant color.
  87. *
  88. * @type {Number}
  89. * @constant
  90. */
  91. ONE_MINUS_CONSTANT_COLOR: WebGLConstants.ONE_MINUS_CONSTANT_COLOR,
  92. /**
  93. * The blend factor is the constant alpha.
  94. *
  95. * @type {Number}
  96. * @constant
  97. */
  98. CONSTANT_ALPHA: WebGLConstants.CONSTANT_ALPHA,
  99. /**
  100. * The blend factor is one minus the constant alpha.
  101. *
  102. * @type {Number}
  103. * @constant
  104. */
  105. ONE_MINUS_CONSTANT_ALPHA: WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,
  106. /**
  107. * The blend factor is the saturated source alpha.
  108. *
  109. * @type {Number}
  110. * @constant
  111. */
  112. SOURCE_ALPHA_SATURATE: WebGLConstants.SRC_ALPHA_SATURATE,
  113. };
  114. export default Object.freeze(BlendFunction);