Cesium3DTileColorBlendMode.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import freezeObject from '../Core/freezeObject.js';
  2. /**
  3. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  4. * the original feature, e.g. glTF material or per-point color in the tile.
  5. * <p>
  6. * When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the
  7. * <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.
  8. * </p>
  9. * <p>
  10. * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the
  11. * tileset's color blend mode.
  12. * </p>
  13. * <pre><code>
  14. * "techniques": {
  15. * "technique0": {
  16. * "parameters": {
  17. * "diffuse": {
  18. * "semantic": "_3DTILESDIFFUSE",
  19. * "type": 35666
  20. * }
  21. * }
  22. * }
  23. * }
  24. * </code></pre>
  25. *
  26. * @exports Cesium3DTileColorBlendMode
  27. */
  28. var Cesium3DTileColorBlendMode = {
  29. /**
  30. * Multiplies the source color by the feature color.
  31. *
  32. * @type {Number}
  33. * @constant
  34. */
  35. HIGHLIGHT : 0,
  36. /**
  37. * Replaces the source color with the feature color.
  38. *
  39. * @type {Number}
  40. * @constant
  41. */
  42. REPLACE : 1,
  43. /**
  44. * Blends the source color and feature color together.
  45. *
  46. * @type {Number}
  47. * @constant
  48. */
  49. MIX : 2
  50. };
  51. export default freezeObject(Cesium3DTileColorBlendMode);