@cesium/engine 25.0.0 → 26.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/Build/Workers/{chunk-3VDDRF2E.js → chunk-2EFYUSUY.js} +14 -14
  2. package/Build/Workers/{chunk-4GF4MVPY.js → chunk-5LSOO2KD.js} +7 -7
  3. package/Build/Workers/{chunk-I3A6DXYZ.js → chunk-6HK6IXK2.js} +4 -4
  4. package/Build/Workers/{chunk-CZ23Y3RM.js → chunk-6YR6JBMY.js} +2 -2
  5. package/Build/Workers/{chunk-J7KQEKPK.js → chunk-76FDC45O.js} +13 -13
  6. package/Build/Workers/{chunk-ZCCIIBZT.js → chunk-7D2HZKH7.js} +6 -6
  7. package/Build/Workers/{chunk-HSVQATK2.js → chunk-7KVKHY7O.js} +6 -6
  8. package/Build/Workers/{chunk-ITD2IN7N.js → chunk-A3O6EDBK.js} +2 -2
  9. package/Build/Workers/{chunk-ND3NTTOF.js → chunk-A6X24AZI.js} +6 -6
  10. package/Build/Workers/{chunk-DH26SNAB.js → chunk-AHWAZRBV.js} +6 -2
  11. package/Build/Workers/{chunk-3XY3MVPG.js → chunk-B4CQSLZJ.js} +4 -4
  12. package/Build/Workers/{chunk-DYT5NR6P.js → chunk-C7JQVRLM.js} +3 -3
  13. package/Build/Workers/{chunk-WC57YYBN.js → chunk-CDJDJ5LK.js} +2 -2
  14. package/Build/Workers/{chunk-VQKLRBIK.js → chunk-CEEZE3YZ.js} +7 -7
  15. package/Build/Workers/{chunk-4QQXGTCE.js → chunk-CLCTQVVL.js} +8 -8
  16. package/Build/Workers/{chunk-WNN5D4W3.js → chunk-DBD5WWG2.js} +10 -10
  17. package/Build/Workers/{chunk-URUCCIPS.js → chunk-DIGUUD6G.js} +6 -6
  18. package/Build/Workers/{chunk-BTX2NL3P.js → chunk-E7NZJOK7.js} +196 -22
  19. package/Build/Workers/{chunk-3LSD7OOA.js → chunk-EHTS2YPT.js} +16 -16
  20. package/Build/Workers/{chunk-35H3UBIO.js → chunk-ENNFMWDW.js} +11 -11
  21. package/Build/Workers/{chunk-GL7DNVUS.js → chunk-FCP2QY4G.js} +5 -5
  22. package/Build/Workers/{chunk-3RFFPH4M.js → chunk-FDK4K5IA.js} +1 -1
  23. package/Build/Workers/{chunk-WTQGE7Q6.js → chunk-FGQFQHN5.js} +17 -17
  24. package/Build/Workers/{chunk-WUBKZFF6.js → chunk-GSWMAFTE.js} +9 -9
  25. package/Build/Workers/{chunk-3TKLDHV3.js → chunk-GXWQZBAI.js} +2 -2
  26. package/Build/Workers/{chunk-A7A433MD.js → chunk-HHV3MCGV.js} +5 -5
  27. package/Build/Workers/{chunk-A7ZBMVFS.js → chunk-HS6AD4P2.js} +14 -14
  28. package/Build/Workers/{chunk-QXNQQYPV.js → chunk-IGAZBTFZ.js} +8 -8
  29. package/Build/Workers/{chunk-ZAPOS52G.js → chunk-ILME5BXA.js} +8 -8
  30. package/Build/Workers/{chunk-4MTRQFJP.js → chunk-JKXV6PG5.js} +1 -1
  31. package/Build/Workers/{chunk-FVLVVOBQ.js → chunk-JW6OZT4R.js} +10 -10
  32. package/Build/Workers/{chunk-EZARA5FJ.js → chunk-KGXSYGBG.js} +13 -13
  33. package/Build/Workers/{chunk-J3OFS2RD.js → chunk-LD64RPYV.js} +12 -12
  34. package/Build/Workers/{chunk-AWFZHD2B.js → chunk-LGNDTZVX.js} +4 -4
  35. package/Build/Workers/{chunk-AEAVLYPS.js → chunk-LNSQVXFH.js} +2 -2
  36. package/Build/Workers/{chunk-TA777BGS.js → chunk-N7CCOFLX.js} +1 -1
  37. package/Build/Workers/{chunk-7LSFAEWF.js → chunk-NIWITKQK.js} +10 -10
  38. package/Build/Workers/{chunk-4XXHJI6Y.js → chunk-OBEU25PI.js} +17 -17
  39. package/Build/Workers/{chunk-5T6QQAJW.js → chunk-QVLAFFJY.js} +1 -1
  40. package/Build/Workers/{chunk-J647NNZW.js → chunk-R4FPNAZ2.js} +6 -6
  41. package/Build/Workers/{chunk-HVMG6AG4.js → chunk-RG4F5R57.js} +9 -9
  42. package/Build/Workers/{chunk-ST2UWDUU.js → chunk-SF6K72D7.js} +5 -5
  43. package/Build/Workers/{chunk-H2A4USJR.js → chunk-SGRGNDOD.js} +10 -10
  44. package/Build/Workers/{chunk-DFEI5MAV.js → chunk-SM2CDCYF.js} +7 -7
  45. package/Build/Workers/{chunk-TAI4HLII.js → chunk-SS5ABQGY.js} +4 -4
  46. package/Build/Workers/{chunk-ACFFCHHZ.js → chunk-T5QBPLE3.js} +11 -11
  47. package/Build/Workers/{chunk-BVAIWR7O.js → chunk-TVZD72WJ.js} +12 -12
  48. package/Build/Workers/{chunk-6SDGQI27.js → chunk-UEY73NRN.js} +1 -1
  49. package/Build/Workers/{chunk-K6NFIRFB.js → chunk-UVO6COT2.js} +5 -5
  50. package/Build/Workers/{chunk-77RL3MBD.js → chunk-VAL7DYNR.js} +25 -4
  51. package/Build/Workers/{chunk-WN6P5UDH.js → chunk-WBSY7HDY.js} +12 -12
  52. package/Build/Workers/{chunk-FIBS5S7R.js → chunk-XDWCTQCZ.js} +2 -2
  53. package/Build/Workers/{chunk-CKQP3DSS.js → chunk-XLXSDIP5.js} +6 -6
  54. package/Build/Workers/{chunk-LH5SF3XV.js → chunk-XQ3SKCMM.js} +5 -5
  55. package/Build/Workers/{chunk-QSDY4NS7.js → chunk-YKU2Q3A2.js} +9 -9
  56. package/Build/Workers/{chunk-GPIGURCG.js → chunk-ZMBHFYOX.js} +7 -7
  57. package/Build/Workers/{chunk-QO2CGXMP.js → chunk-ZSGUV73H.js} +6 -6
  58. package/Build/Workers/combineGeometry.js +24 -24
  59. package/Build/Workers/createBoxGeometry.js +18 -18
  60. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  61. package/Build/Workers/createCircleGeometry.js +26 -26
  62. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  65. package/Build/Workers/createCorridorGeometry.js +29 -29
  66. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  67. package/Build/Workers/createCylinderGeometry.js +20 -20
  68. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  69. package/Build/Workers/createEllipseGeometry.js +26 -26
  70. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  71. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  73. package/Build/Workers/createFrustumGeometry.js +18 -18
  74. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  75. package/Build/Workers/createGeometry.js +24 -24
  76. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  77. package/Build/Workers/createPlaneGeometry.js +16 -16
  78. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  79. package/Build/Workers/createPolygonGeometry.js +32 -32
  80. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  81. package/Build/Workers/createPolylineGeometry.js +25 -25
  82. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  84. package/Build/Workers/createRectangleGeometry.js +27 -27
  85. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  86. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  87. package/Build/Workers/createSphereGeometry.js +19 -19
  88. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  89. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  90. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  91. package/Build/Workers/createVectorTileGeometries.js +24 -24
  92. package/Build/Workers/createVectorTilePoints.js +13 -13
  93. package/Build/Workers/createVectorTilePolygons.js +22 -22
  94. package/Build/Workers/createVectorTilePolylines.js +14 -14
  95. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  96. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  97. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  98. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  99. package/Build/Workers/createWallGeometry.js +24 -24
  100. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +987 -2320
  103. package/Build/Workers/decodeI3S.js +10 -10
  104. package/Build/Workers/gaussianSplatSorter.js +4 -4
  105. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  106. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  107. package/Build/Workers/transcodeKTX2.js +6 -6
  108. package/Build/Workers/transferTypedArrayTest.js +1 -1
  109. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  110. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  111. package/Source/Core/BoundingRectangle.js +6 -8
  112. package/Source/Core/Cartesian2.js +1 -1
  113. package/Source/Core/Cartesian3.js +1 -1
  114. package/Source/Core/Cartesian4.js +1 -1
  115. package/Source/Core/Color.js +1 -0
  116. package/Source/Core/ComponentDatatype.js +35 -0
  117. package/Source/Core/InterpolationAlgorithm.js +57 -50
  118. package/Source/Core/Ion.js +1 -1
  119. package/Source/Core/MapProjection.js +1 -0
  120. package/Source/Core/Matrix2.js +1 -1
  121. package/Source/Core/Matrix3.js +1 -1
  122. package/Source/Core/Matrix4.js +1 -1
  123. package/Source/Core/Resource.js +1 -1
  124. package/Source/Core/ScreenSpaceEventHandler.js +51 -41
  125. package/Source/Core/TerrainMesh.js +3 -3
  126. package/Source/Core/TerrainPicker.js +1 -0
  127. package/Source/Core/createColorRamp.js +37 -0
  128. package/Source/Core/globalTypes.js +25 -0
  129. package/Source/Core/writeTextToCanvas.js +1 -0
  130. package/Source/DataSources/CzmlDataSource.js +12 -0
  131. package/Source/DataSources/KmlDataSource.js +528 -555
  132. package/Source/DataSources/PathGraphics.js +8 -1
  133. package/Source/DataSources/PathMode.js +27 -0
  134. package/Source/DataSources/PathVisualizer.js +298 -1
  135. package/Source/Renderer/Pass.js +3 -2
  136. package/Source/Renderer/Texture.js +1 -1
  137. package/Source/Renderer/VertexArray.js +1 -0
  138. package/Source/Renderer/createUniform.js +346 -239
  139. package/Source/Renderer/createUniformArray.js +494 -381
  140. package/Source/Scene/ArcGisMapService.js +1 -1
  141. package/Source/Scene/BillboardTexture.js +5 -3
  142. package/Source/Scene/BufferPoint.js +1 -0
  143. package/Source/Scene/BufferPointCollection.js +14 -1
  144. package/Source/Scene/BufferPolygon.js +3 -2
  145. package/Source/Scene/BufferPolygonCollection.js +10 -0
  146. package/Source/Scene/BufferPolyline.js +1 -0
  147. package/Source/Scene/BufferPolylineCollection.js +2 -0
  148. package/Source/Scene/BufferPrimitiveCollection.js +79 -28
  149. package/Source/Scene/CameraEventAggregator.js +30 -18
  150. package/Source/Scene/Cesium3DTile.js +54 -1
  151. package/Source/Scene/Cesium3DTileContent.js +195 -254
  152. package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
  153. package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
  154. package/Source/Scene/Cesium3DTileset.js +45 -5
  155. package/Source/Scene/ClippingPlaneCollection.js +2 -2
  156. package/Source/Scene/ClippingPolygon.js +2 -0
  157. package/Source/Scene/ClippingPolygonCollection.js +2 -2
  158. package/Source/Scene/Composite3DTileContent.js +254 -292
  159. package/Source/Scene/DerivedCommand.js +4 -0
  160. package/Source/Scene/EdgeDisplayMode.js +50 -0
  161. package/Source/Scene/Empty3DTileContent.js +100 -132
  162. package/Source/Scene/Expression.js +6 -8
  163. package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
  164. package/Source/Scene/GeoJsonPrimitive.js +874 -0
  165. package/Source/Scene/Geometry3DTileContent.js +151 -185
  166. package/Source/Scene/GlobeSurfaceShaderSet.js +501 -409
  167. package/Source/Scene/GlobeSurfaceTile.js +540 -401
  168. package/Source/Scene/GlobeSurfaceTileProvider.js +1259 -1146
  169. package/Source/Scene/GltfBufferViewLoader.js +3 -3
  170. package/Source/Scene/GltfLoader.js +110 -0
  171. package/Source/Scene/GltfLoaderUtil.js +20 -4
  172. package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
  173. package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
  174. package/Source/Scene/ImageryLayer.js +2 -2
  175. package/Source/Scene/ImageryLayerCollection.js +2 -2
  176. package/Source/Scene/Implicit3DTileContent.js +179 -214
  177. package/Source/Scene/MVTDataProvider.js +147 -0
  178. package/Source/Scene/Material.js +1 -0
  179. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +79 -311
  180. package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
  181. package/Source/Scene/Model/Model.js +37 -0
  182. package/Source/Scene/Model/Model3DTileContent.js +424 -458
  183. package/Source/Scene/Model/ModelDrawCommand.js +31 -3
  184. package/Source/Scene/Model/ModelUtility.js +5 -0
  185. package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +466 -150
  186. package/Source/Scene/ModelComponents.js +39 -1
  187. package/Source/Scene/Multiple3DTileContent.js +291 -334
  188. package/Source/Scene/Picking.js +5 -0
  189. package/Source/Scene/PntsParser.js +1 -0
  190. package/Source/Scene/QuadtreePrimitive.js +3 -2
  191. package/Source/Scene/ResourceCacheKey.js +5 -5
  192. package/Source/Scene/Scene.js +27 -0
  193. package/Source/Scene/Tileset3DTileContent.js +113 -146
  194. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
  195. package/Source/Scene/Vector3DTileContent.js +205 -234
  196. package/Source/Scene/VectorGltf3DTileContent.js +85 -36
  197. package/Source/Scene/VoxelPrimitive.js +159 -175
  198. package/Source/Scene/VoxelProvider.js +64 -91
  199. package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
  200. package/Source/Scene/buildVoxelCustomShader.js +199 -0
  201. package/Source/Scene/decodeMVT.js +634 -0
  202. package/Source/Scene/findMeshoptExtension.js +23 -0
  203. package/Source/Scene/renderBufferPointCollection.js +113 -62
  204. package/Source/Scene/renderBufferPolygonCollection.js +98 -55
  205. package/Source/Scene/renderBufferPolylineCollection.js +270 -143
  206. package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
  207. package/Source/Shaders/BufferPointMaterialFS.js +1 -0
  208. package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
  209. package/Source/Shaders/BufferPointMaterialVS.js +20 -10
  210. package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
  211. package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
  212. package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
  213. package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
  214. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
  215. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
  216. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
  217. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  218. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  219. package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
  220. package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
  221. package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
  222. package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
  223. package/index.d.ts +311 -288
  224. package/index.js +103 -92
  225. package/package.json +4 -4
@@ -22,6 +22,7 @@ import AttributeCompression from "../Core/AttributeCompression.js";
22
22
  import IndexDatatype from "../Core/IndexDatatype.js";
23
23
  import PolylineCommon from "../Shaders/PolylineCommon.js";
24
24
  import BufferPolylineMaterial from "./BufferPolylineMaterial.js";
25
+ import BlendOption from "./BlendOption.js";
25
26
 
26
27
  /** @import FrameState from "./FrameState.js"; */
27
28
  /** @import BufferPolylineCollection from "./BufferPolylineCollection.js"; */
@@ -29,15 +30,16 @@ import BufferPolylineMaterial from "./BufferPolylineMaterial.js";
29
30
 
30
31
  /**
31
32
  * TODO(PR#13211): Need 'keyof' syntax to avoid duplicating attribute names.
32
- * @typedef {'positionHigh' | 'positionLow' | 'prevPositionHigh' | 'prevPositionLow' | 'nextPositionHigh' | 'nextPositionLow' | 'pickColor' | 'showColorWidthAndTexCoord'} BufferPolylineAttribute
33
+ * @typedef {'positionHigh' | 'positionLow' | 'prevPositionHigh' | 'prevPositionLow' | 'nextPositionHigh' | 'nextPositionLow' | 'pickColor' | 'showColorWidthAndTexCoord' | 'alpha'} BufferPolylineAttribute
33
34
  * @ignore
34
35
  */
35
36
 
36
37
  /**
38
+ * Attribute locations when using 64-bit position precision.
37
39
  * @type {Record<BufferPolylineAttribute, number>}
38
40
  * @ignore
39
41
  */
40
- const BufferPolylineAttributeLocations = {
42
+ const BufferPolylineAttributeLocationsFloat64 = {
41
43
  positionHigh: 0,
42
44
  positionLow: 1,
43
45
  prevPositionHigh: 2,
@@ -46,12 +48,27 @@ const BufferPolylineAttributeLocations = {
46
48
  nextPositionLow: 5,
47
49
  pickColor: 6,
48
50
  showColorWidthAndTexCoord: 7,
51
+ alpha: 8,
52
+ };
53
+
54
+ /**
55
+ * Attribute locations when using <= 32-bit position precision.
56
+ * @type {Record<string, number>}
57
+ * @ignore
58
+ */
59
+ const BufferPolylineAttributeLocations = {
60
+ position: 0,
61
+ prevPosition: 1,
62
+ nextPosition: 2,
63
+ pickColor: 3,
64
+ showColorWidthAndTexCoord: 4,
65
+ alpha: 5,
49
66
  };
50
67
 
51
68
  /**
52
69
  * @typedef {object} BufferPolylineRenderContext
53
70
  * @property {VertexArray} [vertexArray]
54
- * @property {Record<BufferPolylineAttribute, TypedArray>} [attributeArrays]
71
+ * @property {Record<string, TypedArray>} [attributeArrays]
55
72
  * @property {TypedArray} [indexArray]
56
73
  * @property {RenderState} [renderState]
57
74
  * @property {ShaderProgram} [shaderProgram]
@@ -67,9 +84,9 @@ const pickColor = new Color();
67
84
  const cartesian = new Cartesian3();
68
85
  const prevCartesian = new Cartesian3();
69
86
  const nextCartesian = new Cartesian3();
70
- const cartesianEnc = new EncodedCartesian3();
71
- const prevCartesianEnc = new EncodedCartesian3();
72
- const nextCartesianEnc = new EncodedCartesian3();
87
+ const encodedC = new EncodedCartesian3();
88
+ const encodedP = new EncodedCartesian3();
89
+ const encodedN = new EncodedCartesian3();
73
90
 
74
91
  /**
75
92
  * Renders line segments as quads, each composed of two triangles. Writes each
@@ -94,6 +111,10 @@ const nextCartesianEnc = new EncodedCartesian3();
94
111
  function renderBufferPolylineCollection(collection, frameState, renderContext) {
95
112
  const context = frameState.context;
96
113
  renderContext = renderContext || { destroy: destroyRenderContext };
114
+ const useFloat64 = collection._positionDatatype === ComponentDatatype.DOUBLE;
115
+ const attributeLocations = useFloat64
116
+ ? BufferPolylineAttributeLocationsFloat64
117
+ : BufferPolylineAttributeLocations;
97
118
 
98
119
  if (
99
120
  !defined(renderContext.attributeArrays) ||
@@ -112,31 +133,62 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
112
133
  );
113
134
 
114
135
  renderContext.attributeArrays = {
115
- positionHigh: new Float32Array(vertexCountMax * 3),
116
- positionLow: new Float32Array(vertexCountMax * 3),
117
- prevPositionHigh: new Float32Array(vertexCountMax * 3),
118
- prevPositionLow: new Float32Array(vertexCountMax * 3),
119
- nextPositionHigh: new Float32Array(vertexCountMax * 3),
120
- nextPositionLow: new Float32Array(vertexCountMax * 3),
136
+ ...(!useFloat64
137
+ ? {
138
+ // @ts-expect-error https://github.com/CesiumGS/cesium/issues/13420
139
+ position: ComponentDatatype.createTypedArray(
140
+ collection._positionDatatype,
141
+ vertexCountMax * 3,
142
+ ),
143
+ // @ts-expect-error https://github.com/CesiumGS/cesium/issues/13420
144
+ prevPosition: ComponentDatatype.createTypedArray(
145
+ collection._positionDatatype,
146
+ vertexCountMax * 3,
147
+ ),
148
+ // @ts-expect-error https://github.com/CesiumGS/cesium/issues/13420
149
+ nextPosition: ComponentDatatype.createTypedArray(
150
+ collection._positionDatatype,
151
+ vertexCountMax * 3,
152
+ ),
153
+ }
154
+ : {
155
+ positionHigh: new Float32Array(vertexCountMax * 3),
156
+ positionLow: new Float32Array(vertexCountMax * 3),
157
+ prevPositionHigh: new Float32Array(vertexCountMax * 3),
158
+ prevPositionLow: new Float32Array(vertexCountMax * 3),
159
+ nextPositionHigh: new Float32Array(vertexCountMax * 3),
160
+ nextPositionLow: new Float32Array(vertexCountMax * 3),
161
+ }),
121
162
  pickColor: new Uint8Array(vertexCountMax * 4),
122
163
  showColorWidthAndTexCoord: new Float32Array(vertexCountMax * 4),
164
+ alpha: new Uint8Array(vertexCountMax),
123
165
  };
124
166
  }
125
167
 
126
168
  if (collection._dirtyCount > 0) {
127
169
  const { _dirtyOffset, _dirtyCount } = collection;
128
- const { attributeArrays } = renderContext;
129
170
 
130
171
  const indexArray = renderContext.indexArray;
131
- const positionHighArray = attributeArrays.positionHigh;
132
- const positionLowArray = attributeArrays.positionLow;
133
- const prevPositionHighArray = attributeArrays.prevPositionHigh;
134
- const prevPositionLowArray = attributeArrays.prevPositionLow;
135
- const nextPositionHighArray = attributeArrays.nextPositionHigh;
136
- const nextPositionLowArray = attributeArrays.nextPositionLow;
137
- const pickColorArray = attributeArrays.pickColor;
138
- const showColorWidthAndTexCoordArray =
139
- attributeArrays.showColorWidthAndTexCoord;
172
+
173
+ const {
174
+ // Common.
175
+ pickColor: pickColorArray,
176
+ showColorWidthAndTexCoord: showColorWidthAndTexCoordArray,
177
+ alpha: alphaArray,
178
+
179
+ // 8-32 bit.
180
+ position,
181
+ prevPosition,
182
+ nextPosition,
183
+
184
+ // 64 bit.
185
+ positionHigh,
186
+ positionLow,
187
+ prevPositionHigh,
188
+ prevPositionLow,
189
+ nextPositionHigh,
190
+ nextPositionLow,
191
+ } = renderContext.attributeArrays;
140
192
 
141
193
  for (let i = _dirtyOffset, il = _dirtyOffset + _dirtyCount; i < il; i++) {
142
194
  collection.get(i, polyline);
@@ -145,97 +197,119 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
145
197
  continue;
146
198
  }
147
199
 
148
- const cartesianArray = polyline.getPositions();
149
200
  polyline.getMaterial(material);
150
201
  const encodedColor = AttributeCompression.encodeRGB8(material.color);
202
+ const colorAlpha = material.color.alpha;
151
203
  Color.fromRgba(polyline._pickId, pickColor);
152
204
  const show = polyline.show;
153
205
 
154
206
  let vOffset = polyline.vertexOffset * 2; // vertex offset
155
207
  let iOffset = (polyline.vertexOffset - i) * 6; // index offset
156
208
 
209
+ const posView = collection._positionView;
210
+ const posStart = polyline.vertexOffset * 3;
211
+
157
212
  for (let j = 0, jl = polyline.vertexCount; j < jl; j++) {
158
213
  const isFirstSegment = j === 0;
159
214
  const isLastSegment = j === jl - 1;
160
215
 
161
- // For first/last vertices, infer missing vertices by mirroring the segment.
162
- // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
163
- Cartesian3.fromArray(cartesianArray, j * 3, cartesian);
216
+ // c=current, p=previous, n=next
217
+
218
+ const cx = posView[posStart + j * 3];
219
+ const cy = posView[posStart + j * 3 + 1];
220
+ const cz = posView[posStart + j * 3 + 2];
221
+
222
+ let px, py, pz, nx, ny, nz;
223
+
164
224
  if (isFirstSegment) {
165
- // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
166
- Cartesian3.fromArray(cartesianArray, (j + 1) * 3, nextCartesian);
167
- Cartesian3.subtract(cartesian, nextCartesian, prevCartesian);
168
- Cartesian3.add(cartesian, prevCartesian, prevCartesian);
225
+ nx = posView[posStart + 1 * 3];
226
+ ny = posView[posStart + 1 * 3 + 1];
227
+ nz = posView[posStart + 1 * 3 + 2];
228
+ // Mirror current over next to get synthetic prev.
229
+ px = 2 * cx - nx;
230
+ py = 2 * cy - ny;
231
+ pz = 2 * cz - nz;
169
232
  } else if (isLastSegment) {
170
- // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
171
- Cartesian3.fromArray(cartesianArray, (j - 1) * 3, prevCartesian);
172
- Cartesian3.subtract(cartesian, prevCartesian, nextCartesian);
173
- Cartesian3.add(cartesian, nextCartesian, nextCartesian);
233
+ px = posView[posStart + (j - 1) * 3];
234
+ py = posView[posStart + (j - 1) * 3 + 1];
235
+ pz = posView[posStart + (j - 1) * 3 + 2];
236
+ // Mirror current over prev to get synthetic next.
237
+ nx = 2 * cx - px;
238
+ ny = 2 * cy - py;
239
+ nz = 2 * cz - pz;
174
240
  } else {
175
- // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
176
- Cartesian3.fromArray(cartesianArray, (j - 1) * 3, prevCartesian);
177
- // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
178
- Cartesian3.fromArray(cartesianArray, (j + 1) * 3, nextCartesian);
241
+ px = posView[posStart + (j - 1) * 3];
242
+ py = posView[posStart + (j - 1) * 3 + 1];
243
+ pz = posView[posStart + (j - 1) * 3 + 2];
244
+ nx = posView[posStart + (j + 1) * 3];
245
+ ny = posView[posStart + (j + 1) * 3 + 1];
246
+ nz = posView[posStart + (j + 1) * 3 + 2];
179
247
  }
180
248
 
181
- // For each segment, draw two triangles.
182
249
  if (!isLastSegment) {
183
250
  indexArray[iOffset] = vOffset;
184
251
  indexArray[iOffset + 1] = vOffset + 1;
185
252
  indexArray[iOffset + 2] = vOffset + 2;
186
-
187
253
  indexArray[iOffset + 3] = vOffset + 2;
188
254
  indexArray[iOffset + 4] = vOffset + 1;
189
255
  indexArray[iOffset + 5] = vOffset + 3;
190
-
191
256
  iOffset += 6;
192
257
  }
193
258
 
194
- EncodedCartesian3.fromCartesian(cartesian, cartesianEnc);
195
- EncodedCartesian3.fromCartesian(prevCartesian, prevCartesianEnc);
196
- EncodedCartesian3.fromCartesian(nextCartesian, nextCartesianEnc);
259
+ if (useFloat64) {
260
+ Cartesian3.fromElements(cx, cy, cz, cartesian);
261
+ Cartesian3.fromElements(px, py, pz, prevCartesian);
262
+ Cartesian3.fromElements(nx, ny, nz, nextCartesian);
263
+ EncodedCartesian3.fromCartesian(cartesian, encodedC);
264
+ EncodedCartesian3.fromCartesian(prevCartesian, encodedP);
265
+ EncodedCartesian3.fromCartesian(nextCartesian, encodedN);
266
+ }
197
267
 
198
268
  // TODO(donmccurdy): Diverging from PolylineCollection.js, which writes
199
269
  // internal vertices to buffer 4x, not 2x. Not sure that's needed?
270
+
271
+ // Write each vertex twice for the quad.
200
272
  for (let k = 0; k < 2; k++) {
201
- // Position.
202
- positionHighArray[vOffset * 3] = cartesianEnc.high.x;
203
- positionHighArray[vOffset * 3 + 1] = cartesianEnc.high.y;
204
- positionHighArray[vOffset * 3 + 2] = cartesianEnc.high.z;
205
-
206
- positionLowArray[vOffset * 3] = cartesianEnc.low.x;
207
- positionLowArray[vOffset * 3 + 1] = cartesianEnc.low.y;
208
- positionLowArray[vOffset * 3 + 2] = cartesianEnc.low.z;
209
-
210
- // Previous position.
211
- prevPositionHighArray[vOffset * 3] = prevCartesianEnc.high.x;
212
- prevPositionHighArray[vOffset * 3 + 1] = prevCartesianEnc.high.y;
213
- prevPositionHighArray[vOffset * 3 + 2] = prevCartesianEnc.high.z;
214
-
215
- prevPositionLowArray[vOffset * 3] = prevCartesianEnc.low.x;
216
- prevPositionLowArray[vOffset * 3 + 1] = prevCartesianEnc.low.y;
217
- prevPositionLowArray[vOffset * 3 + 2] = prevCartesianEnc.low.z;
218
-
219
- // Next position.
220
- nextPositionHighArray[vOffset * 3] = nextCartesianEnc.high.x;
221
- nextPositionHighArray[vOffset * 3 + 1] = nextCartesianEnc.high.y;
222
- nextPositionHighArray[vOffset * 3 + 2] = nextCartesianEnc.high.z;
223
-
224
- nextPositionLowArray[vOffset * 3] = nextCartesianEnc.low.x;
225
- nextPositionLowArray[vOffset * 3 + 1] = nextCartesianEnc.low.y;
226
- nextPositionLowArray[vOffset * 3 + 2] = nextCartesianEnc.low.z;
227
-
228
- // Pick ID.
273
+ if (!useFloat64) {
274
+ position[vOffset * 3] = cx;
275
+ position[vOffset * 3 + 1] = cy;
276
+ position[vOffset * 3 + 2] = cz;
277
+
278
+ prevPosition[vOffset * 3] = px;
279
+ prevPosition[vOffset * 3 + 1] = py;
280
+ prevPosition[vOffset * 3 + 2] = pz;
281
+
282
+ nextPosition[vOffset * 3] = nx;
283
+ nextPosition[vOffset * 3 + 1] = ny;
284
+ nextPosition[vOffset * 3 + 2] = nz;
285
+ } else {
286
+ // @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
287
+ Cartesian3.pack(encodedC.high, positionHigh, vOffset * 3);
288
+ // @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
289
+ Cartesian3.pack(encodedC.low, positionLow, vOffset * 3);
290
+
291
+ // @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
292
+ Cartesian3.pack(encodedP.high, prevPositionHigh, vOffset * 3);
293
+ // @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
294
+ Cartesian3.pack(encodedP.low, prevPositionLow, vOffset * 3);
295
+
296
+ // @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
297
+ Cartesian3.pack(encodedN.high, nextPositionHigh, vOffset * 3);
298
+ // @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
299
+ Cartesian3.pack(encodedN.low, nextPositionLow, vOffset * 3);
300
+ }
301
+
229
302
  pickColorArray[vOffset * 4] = Color.floatToByte(pickColor.red);
230
303
  pickColorArray[vOffset * 4 + 1] = Color.floatToByte(pickColor.green);
231
304
  pickColorArray[vOffset * 4 + 2] = Color.floatToByte(pickColor.blue);
232
305
  pickColorArray[vOffset * 4 + 3] = Color.floatToByte(pickColor.alpha);
233
306
 
234
- // Properties.
235
307
  showColorWidthAndTexCoordArray[vOffset * 4] = show ? 1 : 0;
236
308
  showColorWidthAndTexCoordArray[vOffset * 4 + 1] = encodedColor;
237
309
  showColorWidthAndTexCoordArray[vOffset * 4 + 2] = material.width;
238
- showColorWidthAndTexCoordArray[vOffset * 4 + 3] = j / (jl - 1); // texcoord.s
310
+ showColorWidthAndTexCoordArray[vOffset * 4 + 3] = j / (jl - 1);
311
+
312
+ alphaArray[vOffset] = colorAlpha * 255.0;
239
313
 
240
314
  vOffset++;
241
315
  }
@@ -260,84 +334,130 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
260
334
  }),
261
335
 
262
336
  attributes: [
337
+ ...(!useFloat64
338
+ ? [
339
+ {
340
+ index: BufferPolylineAttributeLocations.position,
341
+ componentDatatype: collection._positionDatatype,
342
+ componentsPerAttribute: 3,
343
+ normalize: collection._positionNormalized,
344
+ vertexBuffer: Buffer.createVertexBuffer({
345
+ typedArray: attributeArrays.position,
346
+ context,
347
+ usage: BufferUsage.STATIC_DRAW,
348
+ }),
349
+ },
350
+ {
351
+ index: BufferPolylineAttributeLocations.prevPosition,
352
+ componentDatatype: collection._positionDatatype,
353
+ componentsPerAttribute: 3,
354
+ normalize: collection._positionNormalized,
355
+ vertexBuffer: Buffer.createVertexBuffer({
356
+ typedArray: attributeArrays.prevPosition,
357
+ context,
358
+ usage: BufferUsage.STATIC_DRAW,
359
+ }),
360
+ },
361
+ {
362
+ index: BufferPolylineAttributeLocations.nextPosition,
363
+ componentDatatype: collection._positionDatatype,
364
+ componentsPerAttribute: 3,
365
+ normalize: collection._positionNormalized,
366
+ vertexBuffer: Buffer.createVertexBuffer({
367
+ typedArray: attributeArrays.nextPosition,
368
+ context,
369
+ usage: BufferUsage.STATIC_DRAW,
370
+ }),
371
+ },
372
+ ]
373
+ : [
374
+ {
375
+ index: BufferPolylineAttributeLocationsFloat64.positionHigh,
376
+ componentDatatype: ComponentDatatype.FLOAT,
377
+ componentsPerAttribute: 3,
378
+ vertexBuffer: Buffer.createVertexBuffer({
379
+ typedArray: attributeArrays.positionHigh,
380
+ context,
381
+ usage: BufferUsage.STATIC_DRAW,
382
+ }),
383
+ },
384
+ {
385
+ index: BufferPolylineAttributeLocationsFloat64.positionLow,
386
+ componentDatatype: ComponentDatatype.FLOAT,
387
+ componentsPerAttribute: 3,
388
+ vertexBuffer: Buffer.createVertexBuffer({
389
+ typedArray: attributeArrays.positionLow,
390
+ context,
391
+ usage: BufferUsage.STATIC_DRAW,
392
+ }),
393
+ },
394
+ {
395
+ index: BufferPolylineAttributeLocationsFloat64.prevPositionHigh,
396
+ componentDatatype: ComponentDatatype.FLOAT,
397
+ componentsPerAttribute: 3,
398
+ vertexBuffer: Buffer.createVertexBuffer({
399
+ typedArray: attributeArrays.prevPositionHigh,
400
+ context,
401
+ usage: BufferUsage.STATIC_DRAW,
402
+ }),
403
+ },
404
+ {
405
+ index: BufferPolylineAttributeLocationsFloat64.prevPositionLow,
406
+ componentDatatype: ComponentDatatype.FLOAT,
407
+ componentsPerAttribute: 3,
408
+ vertexBuffer: Buffer.createVertexBuffer({
409
+ typedArray: attributeArrays.prevPositionLow,
410
+ context,
411
+ usage: BufferUsage.STATIC_DRAW,
412
+ }),
413
+ },
414
+ {
415
+ index: BufferPolylineAttributeLocationsFloat64.nextPositionHigh,
416
+ componentDatatype: ComponentDatatype.FLOAT,
417
+ componentsPerAttribute: 3,
418
+ vertexBuffer: Buffer.createVertexBuffer({
419
+ typedArray: attributeArrays.nextPositionHigh,
420
+ context,
421
+ usage: BufferUsage.STATIC_DRAW,
422
+ }),
423
+ },
424
+ {
425
+ index: BufferPolylineAttributeLocationsFloat64.nextPositionLow,
426
+ componentDatatype: ComponentDatatype.FLOAT,
427
+ componentsPerAttribute: 3,
428
+ vertexBuffer: Buffer.createVertexBuffer({
429
+ typedArray: attributeArrays.nextPositionLow,
430
+ context,
431
+ usage: BufferUsage.STATIC_DRAW,
432
+ }),
433
+ },
434
+ ]),
263
435
  {
264
- index: BufferPolylineAttributeLocations.positionHigh,
265
- componentDatatype: ComponentDatatype.FLOAT,
266
- componentsPerAttribute: 3,
267
- vertexBuffer: Buffer.createVertexBuffer({
268
- typedArray: attributeArrays.positionHigh,
269
- context,
270
- usage: BufferUsage.STATIC_DRAW,
271
- }),
272
- },
273
- {
274
- index: BufferPolylineAttributeLocations.positionLow,
275
- componentDatatype: ComponentDatatype.FLOAT,
276
- componentsPerAttribute: 3,
277
- vertexBuffer: Buffer.createVertexBuffer({
278
- typedArray: attributeArrays.positionLow,
279
- context,
280
- usage: BufferUsage.STATIC_DRAW,
281
- }),
282
- },
283
-
284
- {
285
- index: BufferPolylineAttributeLocations.prevPositionHigh,
286
- componentDatatype: ComponentDatatype.FLOAT,
287
- componentsPerAttribute: 3,
288
- vertexBuffer: Buffer.createVertexBuffer({
289
- typedArray: attributeArrays.prevPositionHigh,
290
- context,
291
- usage: BufferUsage.STATIC_DRAW,
292
- }),
293
- },
294
- {
295
- index: BufferPolylineAttributeLocations.prevPositionLow,
296
- componentDatatype: ComponentDatatype.FLOAT,
297
- componentsPerAttribute: 3,
298
- vertexBuffer: Buffer.createVertexBuffer({
299
- typedArray: attributeArrays.prevPositionLow,
300
- context,
301
- usage: BufferUsage.STATIC_DRAW,
302
- }),
303
- },
304
-
305
- {
306
- index: BufferPolylineAttributeLocations.nextPositionHigh,
307
- componentDatatype: ComponentDatatype.FLOAT,
308
- componentsPerAttribute: 3,
436
+ index: attributeLocations.pickColor,
437
+ componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
438
+ componentsPerAttribute: 4,
309
439
  vertexBuffer: Buffer.createVertexBuffer({
310
- typedArray: attributeArrays.nextPositionHigh,
440
+ typedArray: attributeArrays.pickColor,
311
441
  context,
312
442
  usage: BufferUsage.STATIC_DRAW,
313
443
  }),
314
444
  },
315
445
  {
316
- index: BufferPolylineAttributeLocations.nextPositionLow,
446
+ index: attributeLocations.showColorWidthAndTexCoord,
317
447
  componentDatatype: ComponentDatatype.FLOAT,
318
- componentsPerAttribute: 3,
319
- vertexBuffer: Buffer.createVertexBuffer({
320
- typedArray: attributeArrays.nextPositionLow,
321
- context,
322
- usage: BufferUsage.STATIC_DRAW,
323
- }),
324
- },
325
- {
326
- index: BufferPolylineAttributeLocations.pickColor,
327
- componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
328
448
  componentsPerAttribute: 4,
329
449
  vertexBuffer: Buffer.createVertexBuffer({
330
- typedArray: attributeArrays.pickColor,
450
+ typedArray: attributeArrays.showColorWidthAndTexCoord,
331
451
  context,
332
452
  usage: BufferUsage.STATIC_DRAW,
333
453
  }),
334
454
  },
335
455
  {
336
- index: BufferPolylineAttributeLocations.showColorWidthAndTexCoord,
337
- componentDatatype: ComponentDatatype.FLOAT,
338
- componentsPerAttribute: 4,
456
+ index: attributeLocations.alpha,
457
+ componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
458
+ componentsPerAttribute: 1,
339
459
  vertexBuffer: Buffer.createVertexBuffer({
340
- typedArray: attributeArrays.showColorWidthAndTexCoord,
460
+ typedArray: attributeArrays.alpha,
341
461
  context,
342
462
  usage: BufferUsage.STATIC_DRAW,
343
463
  }),
@@ -354,11 +474,11 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
354
474
  indexCount,
355
475
  );
356
476
 
357
- for (const key in BufferPolylineAttributeLocations) {
358
- if (Object.hasOwn(BufferPolylineAttributeLocations, key)) {
477
+ for (const key in attributeLocations) {
478
+ if (Object.hasOwn(attributeLocations, key)) {
359
479
  const attribute = /** @type {BufferPolylineAttribute} */ (key);
360
480
  renderContext.vertexArray.copyAttributeFromRange(
361
- BufferPolylineAttributeLocations[attribute],
481
+ attributeLocations[attribute],
362
482
  renderContext.attributeArrays[attribute],
363
483
  vertexOffset,
364
484
  vertexCount,
@@ -369,7 +489,10 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
369
489
 
370
490
  if (!defined(renderContext.renderState)) {
371
491
  renderContext.renderState = RenderState.fromCache({
372
- blending: BlendingState.DISABLED,
492
+ blending:
493
+ collection._blendOption === BlendOption.OPAQUE
494
+ ? BlendingState.DISABLED
495
+ : BlendingState.ALPHA_BLEND,
373
496
  depthTest: { enabled: true },
374
497
  });
375
498
  }
@@ -379,11 +502,12 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
379
502
  context,
380
503
  vertexShaderSource: new ShaderSource({
381
504
  sources: [PolylineCommon, BufferPolylineMaterialVS],
505
+ defines: useFloat64 ? ["USE_FLOAT64"] : [],
382
506
  }),
383
507
  fragmentShaderSource: new ShaderSource({
384
508
  sources: [BufferPolylineMaterialFS],
385
509
  }),
386
- attributeLocations: BufferPolylineAttributeLocations,
510
+ attributeLocations,
387
511
  });
388
512
  }
389
513
 
@@ -395,12 +519,15 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
395
519
  renderState: renderContext.renderState,
396
520
  shaderProgram: renderContext.shaderProgram,
397
521
  primitiveType: PrimitiveType.TRIANGLES,
398
- pass: Pass.OPAQUE,
522
+ pass:
523
+ collection._blendOption === BlendOption.OPAQUE
524
+ ? Pass.OPAQUE
525
+ : Pass.TRANSLUCENT,
399
526
  pickId: collection._allowPicking ? "v_pickColor" : undefined,
400
527
  owner: collection,
401
528
  count: drawCount,
402
529
  modelMatrix: collection.modelMatrix, // shared reference
403
- boundingVolume: collection.boundingVolumeWC, // shared reference
530
+ boundingVolume: collection.boundingVolume, // shared reference
404
531
  debugShowBoundingVolume: collection.debugShowBoundingVolume,
405
532
  });
406
533
  }
@@ -16,6 +16,7 @@ void main()
16
16
  float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter);
17
17
 
18
18
  vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha);
19
+ color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha);
19
20
 
20
21
  if (color.a < 0.005) // matches 0/255 and 1/255
21
22
  {
@@ -17,6 +17,7 @@ void main()\n\
17
17
  float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter);\n\
18
18
  \n\
19
19
  vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha);\n\
20
+ color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha);\n\
20
21
  \n\
21
22
  if (color.a < 0.005) // matches 0/255 and 1/255\n\
22
23
  {\n\
@@ -1,8 +1,12 @@
1
+ #ifdef USE_FLOAT64
1
2
  in vec3 positionHigh;
2
3
  in vec3 positionLow;
4
+ #else
5
+ in vec3 position;
6
+ #endif
3
7
  in vec4 pickColor;
4
- in vec3 showPixelSizeAndColor;
5
- in vec2 outlineWidthAndOutlineColor;
8
+ in vec4 showPixelSizeColorAlpha;
9
+ in vec3 outlineWidthColorAlpha;
6
10
 
7
11
  out vec4 v_pickColor;
8
12
  out vec4 v_color;
@@ -12,11 +16,13 @@ out float v_innerRadiusFrac;
12
16
  void main()
13
17
  {
14
18
  // Unpack attributes.
15
- float show = showPixelSizeAndColor.x;
16
- float pixelSize = showPixelSizeAndColor.y;
17
- vec4 color = czm_decodeRGB8(showPixelSizeAndColor.z);
18
- float outlineWidth = outlineWidthAndOutlineColor.x;
19
- vec4 outlineColor = czm_decodeRGB8(outlineWidthAndOutlineColor.y);
19
+ float show = showPixelSizeColorAlpha.x;
20
+ float pixelSize = showPixelSizeColorAlpha.y;
21
+ vec4 color = czm_decodeRGB8(showPixelSizeColorAlpha.z);
22
+ float alpha = showPixelSizeColorAlpha.w;
23
+ float outlineWidth = outlineWidthColorAlpha.x;
24
+ vec4 outlineColor = czm_decodeRGB8(outlineWidthColorAlpha.y);
25
+ float outlineAlpha = outlineWidthColorAlpha.z;
20
26
 
21
27
  ///////////////////////////////////////////////////////////////////////////
22
28
 
@@ -25,8 +31,12 @@ void main()
25
31
 
26
32
  ///////////////////////////////////////////////////////////////////////////
27
33
 
34
+ #ifdef USE_FLOAT64
28
35
  vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
29
36
  vec4 positionEC = czm_modelViewRelativeToEye * p;
37
+ #else
38
+ vec4 positionEC = czm_modelView * vec4(position, 1.0);
39
+ #endif
30
40
 
31
41
  ///////////////////////////////////////////////////////////////////////////
32
42
 
@@ -36,10 +46,10 @@ void main()
36
46
  v_pickColor = pickColor / 255.0;
37
47
 
38
48
  v_color = color;
39
- v_color.a *= show;
49
+ v_color.a *= alpha * show;
40
50
 
41
51
  v_outlineColor = outlineColor;
42
- v_outlineColor.a *= show;
52
+ v_outlineColor.a *= outlineAlpha * show;
43
53
 
44
54
  v_innerRadiusFrac = innerRadius / outerRadius;
45
55