StencilOperation.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*global define*/
  2. define([
  3. '../Core/freezeObject'
  4. ], function(
  5. freezeObject) {
  6. "use strict";
  7. /**
  8. * Determines the action taken based on the result of the stencil test.
  9. *
  10. * @namespace
  11. * @alias StencilOperation
  12. */
  13. var StencilOperation = {
  14. /**
  15. * 0. Sets the stencil buffer value to zero.
  16. *
  17. * @type {Number}
  18. * @constant
  19. */
  20. ZERO : 0,
  21. /**
  22. * 0x1E00. Does not change the stencil buffer.
  23. *
  24. * @type {Number}
  25. * @constant
  26. */
  27. KEEP : 0x1E00,
  28. /**
  29. * 0x1E01. Replaces the stencil buffer value with the reference value.
  30. *
  31. * @type {Number}
  32. * @constant
  33. */
  34. REPLACE : 0x1E01,
  35. /**
  36. * 0x1E02. Increments the stencil buffer value, clamping to unsigned byte.
  37. *
  38. * @type {Number}
  39. * @constant
  40. */
  41. INCREMENT : 0x1E02, // WebGL: INCR
  42. /**
  43. * 0x1E03. Decrements the stencil buffer value, clamping to zero.
  44. *
  45. * @type {Number}
  46. * @constant
  47. */
  48. DECREMENT : 0x1E03, // WebGL: DECR
  49. /**
  50. * 0x150A. Bitwise inverts the existing stencil buffer value.
  51. *
  52. * @type {Number}
  53. * @constant
  54. */
  55. INVERT : 0x150A,
  56. /**
  57. * 0x8507. Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  58. *
  59. * @type {Number}
  60. * @constant
  61. */
  62. INCREMENT_WRAP : 0x8507, // WebGL: INCR_WRAP
  63. /**
  64. * 0x8508. Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  65. *
  66. * @type {Number}
  67. * @constant
  68. */
  69. DECREMENT_WRAP : 0x8508 // WebGL: DECR_WRAP
  70. };
  71. return freezeObject(StencilOperation);
  72. });