StencilFunction.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import WebGLConstants from "../Core/WebGLConstants.js";
  2. /**
  3. * Determines the function used to compare stencil values for the stencil test.
  4. *
  5. * @enum {number}
  6. */
  7. const StencilFunction = {
  8. /**
  9. * The stencil test never passes.
  10. *
  11. * @type {number}
  12. * @constant
  13. */
  14. NEVER: WebGLConstants.NEVER,
  15. /**
  16. * The stencil test passes when the masked reference value is less than the masked stencil value.
  17. *
  18. * @type {number}
  19. * @constant
  20. */
  21. LESS: WebGLConstants.LESS,
  22. /**
  23. * The stencil test passes when the masked reference value is equal to the masked stencil value.
  24. *
  25. * @type {number}
  26. * @constant
  27. */
  28. EQUAL: WebGLConstants.EQUAL,
  29. /**
  30. * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.
  31. *
  32. * @type {number}
  33. * @constant
  34. */
  35. LESS_OR_EQUAL: WebGLConstants.LEQUAL,
  36. /**
  37. * The stencil test passes when the masked reference value is greater than the masked stencil value.
  38. *
  39. * @type {number}
  40. * @constant
  41. */
  42. GREATER: WebGLConstants.GREATER,
  43. /**
  44. * The stencil test passes when the masked reference value is not equal to the masked stencil value.
  45. *
  46. * @type {number}
  47. * @constant
  48. */
  49. NOT_EQUAL: WebGLConstants.NOTEQUAL,
  50. /**
  51. * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.
  52. *
  53. * @type {number}
  54. * @constant
  55. */
  56. GREATER_OR_EQUAL: WebGLConstants.GEQUAL,
  57. /**
  58. * The stencil test always passes.
  59. *
  60. * @type {number}
  61. * @constant
  62. */
  63. ALWAYS: WebGLConstants.ALWAYS,
  64. };
  65. export default Object.freeze(StencilFunction);