DepthFunction.js 1.9 KB

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