BlendEquation.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import freezeObject from '../Core/freezeObject.js';
  2. import WebGLConstants from '../Core/WebGLConstants.js';
  3. /**
  4. * Determines how two pixels' values are combined.
  5. *
  6. * @exports BlendEquation
  7. */
  8. var BlendEquation = {
  9. /**
  10. * Pixel values are added componentwise. This is used in additive blending for translucency.
  11. *
  12. * @type {Number}
  13. * @constant
  14. */
  15. ADD : WebGLConstants.FUNC_ADD,
  16. /**
  17. * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.
  18. *
  19. * @type {Number}
  20. * @constant
  21. */
  22. SUBTRACT : WebGLConstants.FUNC_SUBTRACT,
  23. /**
  24. * Pixel values are subtracted componentwise (destination - source).
  25. *
  26. * @type {Number}
  27. * @constant
  28. */
  29. REVERSE_SUBTRACT : WebGLConstants.FUNC_REVERSE_SUBTRACT,
  30. /**
  31. * Pixel values are given to the minimum function (min(source, destination)).
  32. *
  33. * This equation operates on each pixel color component.
  34. *
  35. * @type {Number}
  36. * @constant
  37. */
  38. MIN : WebGLConstants.MIN,
  39. /**
  40. * Pixel values are given to the maximum function (max(source, destination)).
  41. *
  42. * This equation operates on each pixel color component.
  43. *
  44. * @type {Number}
  45. * @constant
  46. */
  47. MAX : WebGLConstants.MAX
  48. };
  49. export default freezeObject(BlendEquation);