StencilOperation.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import WebGLConstants from "../Core/WebGLConstants.js";
  2. /**
  3. * Determines the action taken based on the result of the stencil test.
  4. *
  5. * @enum {number}
  6. */
  7. const StencilOperation = {
  8. /**
  9. * Sets the stencil buffer value to zero.
  10. *
  11. * @type {number}
  12. * @constant
  13. */
  14. ZERO: WebGLConstants.ZERO,
  15. /**
  16. * Does not change the stencil buffer.
  17. *
  18. * @type {number}
  19. * @constant
  20. */
  21. KEEP: WebGLConstants.KEEP,
  22. /**
  23. * Replaces the stencil buffer value with the reference value.
  24. *
  25. * @type {number}
  26. * @constant
  27. */
  28. REPLACE: WebGLConstants.REPLACE,
  29. /**
  30. * Increments the stencil buffer value, clamping to unsigned byte.
  31. *
  32. * @type {number}
  33. * @constant
  34. */
  35. INCREMENT: WebGLConstants.INCR,
  36. /**
  37. * Decrements the stencil buffer value, clamping to zero.
  38. *
  39. * @type {number}
  40. * @constant
  41. */
  42. DECREMENT: WebGLConstants.DECR,
  43. /**
  44. * Bitwise inverts the existing stencil buffer value.
  45. *
  46. * @type {number}
  47. * @constant
  48. */
  49. INVERT: WebGLConstants.INVERT,
  50. /**
  51. * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  52. *
  53. * @type {number}
  54. * @constant
  55. */
  56. INCREMENT_WRAP: WebGLConstants.INCR_WRAP,
  57. /**
  58. * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  59. *
  60. * @type {number}
  61. * @constant
  62. */
  63. DECREMENT_WRAP: WebGLConstants.DECR_WRAP,
  64. };
  65. export default Object.freeze(StencilOperation);