StencilConstants.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import freezeObject from '../Core/freezeObject.js';
  2. import StencilFunction from './StencilFunction.js';
  3. import StencilOperation from './StencilOperation.js';
  4. /**
  5. * The most significant bit is used to identify whether the pixel is 3D Tiles.
  6. * The next three bits store selection depth for the skip LODs optimization.
  7. * The last four bits are for increment/decrement shadow volume operations for classification.
  8. *
  9. * @private
  10. */
  11. var StencilConstants = {
  12. CESIUM_3D_TILE_MASK : 0x80,
  13. SKIP_LOD_MASK : 0x70,
  14. SKIP_LOD_BIT_SHIFT : 4,
  15. CLASSIFICATION_MASK : 0x0F
  16. };
  17. StencilConstants.setCesium3DTileBit = function() {
  18. return {
  19. enabled : true,
  20. frontFunction : StencilFunction.ALWAYS,
  21. frontOperation : {
  22. fail : StencilOperation.KEEP,
  23. zFail : StencilOperation.KEEP,
  24. zPass : StencilOperation.REPLACE
  25. },
  26. backFunction : StencilFunction.ALWAYS,
  27. backOperation : {
  28. fail : StencilOperation.KEEP,
  29. zFail : StencilOperation.KEEP,
  30. zPass : StencilOperation.REPLACE
  31. },
  32. reference : StencilConstants.CESIUM_3D_TILE_MASK,
  33. mask : StencilConstants.CESIUM_3D_TILE_MASK
  34. };
  35. };
  36. export default freezeObject(StencilConstants);