BlendEquation.js 1.2 KB

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