BlendFunction.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*global define*/
  2. define([
  3. '../Core/freezeObject'
  4. ], function(
  5. freezeObject) {
  6. "use strict";
  7. /**
  8. * Determines how blending factors are computed.
  9. *
  10. * @namespace
  11. * @alias BlendFunction
  12. */
  13. var BlendFunction = {
  14. /**
  15. * 0. The blend factor is zero.
  16. *
  17. * @type {Number}
  18. * @constant
  19. */
  20. ZERO : 0,
  21. /**
  22. * 1. The blend factor is one.
  23. *
  24. * @type {Number}
  25. * @constant
  26. */
  27. ONE : 1,
  28. /**
  29. * 0x0300. The blend factor is the source color.
  30. *
  31. * @type {Number}
  32. * @constant
  33. */
  34. SOURCE_COLOR : 0x0300, // WebGL: SRC_COLOR
  35. /**
  36. * 0x0301. The blend factor is one minus the source color.
  37. *
  38. * @type {Number}
  39. * @constant
  40. */
  41. ONE_MINUS_SOURCE_COLOR : 0x0301, // WebGL: ONE_MINUS_SRC_COLOR
  42. /**
  43. * 0x0306. The blend factor is the destination color.
  44. *
  45. * @type {Number}
  46. * @constant
  47. */
  48. DESTINATION_COLOR : 0x0306, // WebGL: DEST_COLOR
  49. /**
  50. * 0x0307. The blend factor is one minus the destination color.
  51. *
  52. * @type {Number}
  53. * @constant
  54. */
  55. ONE_MINUS_DESTINATION_COLOR : 0x0307, // WebGL: ONE_MINUS_DEST_COLOR
  56. /**
  57. * 0x0302. The blend factor is the source alpha.
  58. *
  59. * @type {Number}
  60. * @constant
  61. */
  62. SOURCE_ALPHA : 0x0302, // WebGL: SRC_ALPHA
  63. /**
  64. * 0x0303. The blend factor is one minus the source alpha.
  65. *
  66. * @type {Number}
  67. * @constant
  68. */
  69. ONE_MINUS_SOURCE_ALPHA : 0x0303, // WebGL: ONE_MINUS_SRC_ALPHA
  70. /**
  71. * 0x0304. The blend factor is the destination alpha.
  72. *
  73. * @type {Number}
  74. * @constant
  75. */
  76. DESTINATION_ALPHA : 0x0304, // WebGL: DST_ALPHA
  77. /**
  78. * 0x0305. The blend factor is one minus the destination alpha.
  79. *
  80. * @type {Number}
  81. * @constant
  82. */
  83. ONE_MINUS_DESTINATION_ALPHA : 0x0305, // WebGL: ONE_MINUS_DST_ALPHA
  84. /**
  85. * 0x8001. The blend factor is the constant color.
  86. *
  87. * @type {Number}
  88. * @constant
  89. */
  90. CONSTANT_COLOR : 0x8001,
  91. /**
  92. * 0x8002. The blend factor is one minus the constant color.
  93. *
  94. * @type {Number}
  95. * @constant
  96. */
  97. ONE_MINUS_CONSTANT_COLOR : 0x8002,
  98. /**
  99. * 0x8003. The blend factor is the constant alpha.
  100. *
  101. * @type {Number}
  102. * @constant
  103. */
  104. CONSTANT_ALPHA : 0x8003,
  105. /**
  106. * 0x8004. The blend factor is one minus the constant alpha.
  107. *
  108. * @type {Number}
  109. * @constant
  110. */
  111. ONE_MINUS_CONSTANT_ALPHA : 0x8004,
  112. /**
  113. * 0x0308. The blend factor is the saturated source alpha.
  114. *
  115. * @type {Number}
  116. * @constant
  117. */
  118. SOURCE_ALPHA_SATURATE : 0x0308 // WebGL: SRC_ALPHA_SATURATE
  119. };
  120. return freezeObject(BlendFunction);
  121. });