StencilOperation.js 1.9 KB

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