@cesium/engine 25.0.0 → 26.0.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 (187) hide show
  1. package/Build/Workers/{chunk-GPIGURCG.js → chunk-3VFEWOBI.js} +7 -7
  2. package/Build/Workers/{chunk-BTX2NL3P.js → chunk-424RNO3D.js} +18 -18
  3. package/Build/Workers/{chunk-HSVQATK2.js → chunk-4MGMYHOO.js} +6 -6
  4. package/Build/Workers/{chunk-FIBS5S7R.js → chunk-4S7IE3LB.js} +2 -2
  5. package/Build/Workers/{chunk-A7ZBMVFS.js → chunk-52JDLOEM.js} +14 -14
  6. package/Build/Workers/{chunk-ZCCIIBZT.js → chunk-54I6Y66F.js} +6 -6
  7. package/Build/Workers/{chunk-J647NNZW.js → chunk-6YEE6JDR.js} +6 -6
  8. package/Build/Workers/{chunk-HVMG6AG4.js → chunk-7J2HKPRH.js} +9 -9
  9. package/Build/Workers/{chunk-K6NFIRFB.js → chunk-7WM2PX4V.js} +5 -5
  10. package/Build/Workers/{chunk-3LSD7OOA.js → chunk-ACXQXN46.js} +16 -16
  11. package/Build/Workers/{chunk-CZ23Y3RM.js → chunk-AYKR4VBR.js} +2 -2
  12. package/Build/Workers/{chunk-4MTRQFJP.js → chunk-C6J67V5A.js} +1 -1
  13. package/Build/Workers/{chunk-WTQGE7Q6.js → chunk-C6KNZ7T4.js} +17 -17
  14. package/Build/Workers/{chunk-AWFZHD2B.js → chunk-CFQP6LYM.js} +4 -4
  15. package/Build/Workers/{chunk-ST2UWDUU.js → chunk-CXOYE2WM.js} +5 -5
  16. package/Build/Workers/{chunk-H2A4USJR.js → chunk-CZEYZU4N.js} +10 -10
  17. package/Build/Workers/{chunk-DFEI5MAV.js → chunk-DBOEKL43.js} +7 -7
  18. package/Build/Workers/{chunk-A7A433MD.js → chunk-DDWSZVMY.js} +5 -5
  19. package/Build/Workers/{chunk-J7KQEKPK.js → chunk-DOBXCNC3.js} +13 -13
  20. package/Build/Workers/{chunk-URUCCIPS.js → chunk-E7VQ76KE.js} +6 -6
  21. package/Build/Workers/{chunk-ZAPOS52G.js → chunk-EBSIOBXY.js} +8 -8
  22. package/Build/Workers/{chunk-3VDDRF2E.js → chunk-EF2QYXGA.js} +14 -14
  23. package/Build/Workers/{chunk-WN6P5UDH.js → chunk-EPYXRCDB.js} +12 -12
  24. package/Build/Workers/{chunk-EZARA5FJ.js → chunk-F6QDY6HU.js} +13 -13
  25. package/Build/Workers/{chunk-GL7DNVUS.js → chunk-FRQZECAO.js} +5 -5
  26. package/Build/Workers/{chunk-VQKLRBIK.js → chunk-G7PXZRVF.js} +7 -7
  27. package/Build/Workers/{chunk-4QQXGTCE.js → chunk-INUEEEQA.js} +8 -8
  28. package/Build/Workers/{chunk-ITD2IN7N.js → chunk-IRBKFCEJ.js} +2 -2
  29. package/Build/Workers/{chunk-6SDGQI27.js → chunk-IYOUHCZB.js} +1 -1
  30. package/Build/Workers/{chunk-DYT5NR6P.js → chunk-J6BWOHUF.js} +3 -3
  31. package/Build/Workers/{chunk-4GF4MVPY.js → chunk-KFSTQKNM.js} +7 -7
  32. package/Build/Workers/{chunk-4XXHJI6Y.js → chunk-KKOSKAZB.js} +17 -17
  33. package/Build/Workers/{chunk-WC57YYBN.js → chunk-KSSWJIZW.js} +2 -2
  34. package/Build/Workers/{chunk-5T6QQAJW.js → chunk-M3B5JKSM.js} +1 -1
  35. package/Build/Workers/{chunk-QO2CGXMP.js → chunk-MPZHGZU6.js} +6 -6
  36. package/Build/Workers/{chunk-WUBKZFF6.js → chunk-MYP774IS.js} +9 -9
  37. package/Build/Workers/{chunk-WNN5D4W3.js → chunk-O3EA5HS7.js} +10 -10
  38. package/Build/Workers/{chunk-77RL3MBD.js → chunk-P3CK7MCY.js} +25 -4
  39. package/Build/Workers/{chunk-QXNQQYPV.js → chunk-Q3PY526V.js} +8 -8
  40. package/Build/Workers/{chunk-CKQP3DSS.js → chunk-QN67VG36.js} +6 -6
  41. package/Build/Workers/{chunk-ACFFCHHZ.js → chunk-QRWGUWI6.js} +11 -11
  42. package/Build/Workers/{chunk-LH5SF3XV.js → chunk-S4MCOY6I.js} +5 -5
  43. package/Build/Workers/{chunk-FVLVVOBQ.js → chunk-SMQZZOW6.js} +10 -10
  44. package/Build/Workers/{chunk-TA777BGS.js → chunk-TKKIREQ6.js} +1 -1
  45. package/Build/Workers/{chunk-AEAVLYPS.js → chunk-U3ZA64U7.js} +2 -2
  46. package/Build/Workers/{chunk-7LSFAEWF.js → chunk-UA25D5MX.js} +10 -10
  47. package/Build/Workers/{chunk-J3OFS2RD.js → chunk-UOOIQ3KX.js} +12 -12
  48. package/Build/Workers/{chunk-ND3NTTOF.js → chunk-V7VQKN6N.js} +6 -6
  49. package/Build/Workers/{chunk-I3A6DXYZ.js → chunk-VQYETPWC.js} +4 -4
  50. package/Build/Workers/{chunk-35H3UBIO.js → chunk-VWV2IJRB.js} +11 -11
  51. package/Build/Workers/{chunk-QSDY4NS7.js → chunk-XZMBNNDX.js} +9 -9
  52. package/Build/Workers/{chunk-TAI4HLII.js → chunk-Y57HREW5.js} +4 -4
  53. package/Build/Workers/{chunk-3TKLDHV3.js → chunk-Y5BF6AFU.js} +2 -2
  54. package/Build/Workers/{chunk-3XY3MVPG.js → chunk-YLY7NKAB.js} +4 -4
  55. package/Build/Workers/{chunk-BVAIWR7O.js → chunk-ZK3CF7ZD.js} +12 -12
  56. package/Build/Workers/{chunk-DH26SNAB.js → chunk-ZP7JMQV4.js} +1 -1
  57. package/Build/Workers/{chunk-3RFFPH4M.js → chunk-ZZ46LWL6.js} +1 -1
  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 +5 -5
  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/Cartesian2.js +1 -1
  112. package/Source/Core/Cartesian3.js +1 -1
  113. package/Source/Core/Cartesian4.js +1 -1
  114. package/Source/Core/ComponentDatatype.js +35 -0
  115. package/Source/Core/Ion.js +1 -1
  116. package/Source/Core/MapProjection.js +1 -0
  117. package/Source/Core/Matrix2.js +1 -1
  118. package/Source/Core/Matrix3.js +1 -1
  119. package/Source/Core/Matrix4.js +1 -1
  120. package/Source/Core/Resource.js +1 -1
  121. package/Source/Core/ScreenSpaceEventHandler.js +51 -41
  122. package/Source/Core/createColorRamp.js +37 -0
  123. package/Source/Core/globalTypes.js +25 -0
  124. package/Source/Renderer/Pass.js +3 -2
  125. package/Source/Renderer/createUniform.js +346 -239
  126. package/Source/Renderer/createUniformArray.js +494 -381
  127. package/Source/Scene/ArcGisMapService.js +1 -1
  128. package/Source/Scene/BufferPoint.js +1 -0
  129. package/Source/Scene/BufferPointCollection.js +14 -1
  130. package/Source/Scene/BufferPolygon.js +3 -2
  131. package/Source/Scene/BufferPolygonCollection.js +10 -0
  132. package/Source/Scene/BufferPolyline.js +1 -0
  133. package/Source/Scene/BufferPolylineCollection.js +2 -0
  134. package/Source/Scene/BufferPrimitiveCollection.js +79 -28
  135. package/Source/Scene/CameraEventAggregator.js +30 -18
  136. package/Source/Scene/Cesium3DTile.js +54 -1
  137. package/Source/Scene/Cesium3DTileContent.js +195 -254
  138. package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
  139. package/Source/Scene/Cesium3DTileset.js +45 -5
  140. package/Source/Scene/Composite3DTileContent.js +254 -292
  141. package/Source/Scene/EdgeDisplayMode.js +50 -0
  142. package/Source/Scene/Empty3DTileContent.js +100 -132
  143. package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
  144. package/Source/Scene/GeoJsonPrimitive.js +874 -0
  145. package/Source/Scene/Geometry3DTileContent.js +151 -185
  146. package/Source/Scene/GltfLoader.js +109 -0
  147. package/Source/Scene/Implicit3DTileContent.js +179 -214
  148. package/Source/Scene/MVTDataProvider.js +147 -0
  149. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +79 -311
  150. package/Source/Scene/Model/Model.js +34 -0
  151. package/Source/Scene/Model/Model3DTileContent.js +424 -458
  152. package/Source/Scene/Model/ModelDrawCommand.js +31 -3
  153. package/Source/Scene/Model/ModelUtility.js +4 -0
  154. package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +466 -150
  155. package/Source/Scene/ModelComponents.js +39 -1
  156. package/Source/Scene/Multiple3DTileContent.js +291 -334
  157. package/Source/Scene/Scene.js +26 -0
  158. package/Source/Scene/Tileset3DTileContent.js +113 -146
  159. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
  160. package/Source/Scene/Vector3DTileContent.js +205 -234
  161. package/Source/Scene/VectorGltf3DTileContent.js +85 -36
  162. package/Source/Scene/VoxelPrimitive.js +159 -175
  163. package/Source/Scene/VoxelProvider.js +64 -91
  164. package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
  165. package/Source/Scene/buildVoxelCustomShader.js +199 -0
  166. package/Source/Scene/decodeMVT.js +634 -0
  167. package/Source/Scene/renderBufferPointCollection.js +110 -64
  168. package/Source/Scene/renderBufferPolygonCollection.js +102 -55
  169. package/Source/Scene/renderBufferPolylineCollection.js +365 -166
  170. package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
  171. package/Source/Shaders/BufferPointMaterialFS.js +1 -0
  172. package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
  173. package/Source/Shaders/BufferPointMaterialVS.js +20 -10
  174. package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
  175. package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
  176. package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
  177. package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
  178. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
  179. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
  180. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
  181. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  182. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  183. package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
  184. package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
  185. package/index.d.ts +253 -35
  186. package/index.js +71 -62
  187. package/package.json +2 -2
@@ -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]
@@ -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,14 +133,35 @@ 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
 
@@ -128,15 +170,10 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
128
170
  const { attributeArrays } = renderContext;
129
171
 
130
172
  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
173
  const pickColorArray = attributeArrays.pickColor;
138
174
  const showColorWidthAndTexCoordArray =
139
175
  attributeArrays.showColorWidthAndTexCoord;
176
+ const alphaArray = attributeArrays.alpha;
140
177
 
141
178
  for (let i = _dirtyOffset, il = _dirtyOffset + _dirtyCount; i < il; i++) {
142
179
  collection.get(i, polyline);
@@ -145,99 +182,208 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
145
182
  continue;
146
183
  }
147
184
 
148
- const cartesianArray = polyline.getPositions();
149
185
  polyline.getMaterial(material);
150
186
  const encodedColor = AttributeCompression.encodeRGB8(material.color);
187
+ const colorAlpha = material.color.alpha;
151
188
  Color.fromRgba(polyline._pickId, pickColor);
152
189
  const show = polyline.show;
153
190
 
154
191
  let vOffset = polyline.vertexOffset * 2; // vertex offset
155
192
  let iOffset = (polyline.vertexOffset - i) * 6; // index offset
156
193
 
157
- for (let j = 0, jl = polyline.vertexCount; j < jl; j++) {
158
- const isFirstSegment = j === 0;
159
- const isLastSegment = j === jl - 1;
160
-
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);
164
- 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);
169
- } 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);
174
- } 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);
194
+ const jl = polyline.vertexCount;
195
+
196
+ if (!useFloat64) {
197
+ const posView = collection._positionView;
198
+ const posStart = polyline.vertexOffset * 3;
199
+ const posArray = attributeArrays.position;
200
+ const prevPosArray = attributeArrays.prevPosition;
201
+ const nextPosArray = attributeArrays.nextPosition;
202
+
203
+ for (let j = 0; j < jl; j++) {
204
+ const isFirstSegment = j === 0;
205
+ const isLastSegment = j === jl - 1;
206
+
207
+ const cx = posView[posStart + j * 3];
208
+ const cy = posView[posStart + j * 3 + 1];
209
+ const cz = posView[posStart + j * 3 + 2];
210
+
211
+ let px, py, pz, nx, ny, nz;
212
+
213
+ if (isFirstSegment) {
214
+ nx = posView[posStart + 1 * 3];
215
+ ny = posView[posStart + 1 * 3 + 1];
216
+ nz = posView[posStart + 1 * 3 + 2];
217
+ // Mirror current over next to get synthetic prev.
218
+ px = 2 * cx - nx;
219
+ py = 2 * cy - ny;
220
+ pz = 2 * cz - nz;
221
+ } else if (isLastSegment) {
222
+ px = posView[posStart + (j - 1) * 3];
223
+ py = posView[posStart + (j - 1) * 3 + 1];
224
+ pz = posView[posStart + (j - 1) * 3 + 2];
225
+ // Mirror current over prev to get synthetic next.
226
+ nx = 2 * cx - px;
227
+ ny = 2 * cy - py;
228
+ nz = 2 * cz - pz;
229
+ } else {
230
+ px = posView[posStart + (j - 1) * 3];
231
+ py = posView[posStart + (j - 1) * 3 + 1];
232
+ pz = posView[posStart + (j - 1) * 3 + 2];
233
+ nx = posView[posStart + (j + 1) * 3];
234
+ ny = posView[posStart + (j + 1) * 3 + 1];
235
+ nz = posView[posStart + (j + 1) * 3 + 2];
236
+ }
237
+
238
+ if (!isLastSegment) {
239
+ indexArray[iOffset] = vOffset;
240
+ indexArray[iOffset + 1] = vOffset + 1;
241
+ indexArray[iOffset + 2] = vOffset + 2;
242
+ indexArray[iOffset + 3] = vOffset + 2;
243
+ indexArray[iOffset + 4] = vOffset + 1;
244
+ indexArray[iOffset + 5] = vOffset + 3;
245
+ iOffset += 6;
246
+ }
247
+
248
+ // Write each vertex twice for the quad.
249
+ for (let k = 0; k < 2; k++) {
250
+ posArray[vOffset * 3] = cx;
251
+ posArray[vOffset * 3 + 1] = cy;
252
+ posArray[vOffset * 3 + 2] = cz;
253
+
254
+ prevPosArray[vOffset * 3] = px;
255
+ prevPosArray[vOffset * 3 + 1] = py;
256
+ prevPosArray[vOffset * 3 + 2] = pz;
257
+
258
+ nextPosArray[vOffset * 3] = nx;
259
+ nextPosArray[vOffset * 3 + 1] = ny;
260
+ nextPosArray[vOffset * 3 + 2] = nz;
261
+
262
+ pickColorArray[vOffset * 4] = Color.floatToByte(pickColor.red);
263
+ pickColorArray[vOffset * 4 + 1] = Color.floatToByte(
264
+ pickColor.green,
265
+ );
266
+ pickColorArray[vOffset * 4 + 2] = Color.floatToByte(pickColor.blue);
267
+ pickColorArray[vOffset * 4 + 3] = Color.floatToByte(
268
+ pickColor.alpha,
269
+ );
270
+
271
+ showColorWidthAndTexCoordArray[vOffset * 4] = show ? 1 : 0;
272
+ showColorWidthAndTexCoordArray[vOffset * 4 + 1] = encodedColor;
273
+ showColorWidthAndTexCoordArray[vOffset * 4 + 2] = material.width;
274
+ showColorWidthAndTexCoordArray[vOffset * 4 + 3] = j / (jl - 1);
275
+
276
+ alphaArray[vOffset] = colorAlpha * 255.0;
277
+
278
+ vOffset++;
279
+ }
179
280
  }
281
+ } else {
282
+ const cartesianArray = polyline.getPositions();
180
283
 
181
- // For each segment, draw two triangles.
182
- if (!isLastSegment) {
183
- indexArray[iOffset] = vOffset;
184
- indexArray[iOffset + 1] = vOffset + 1;
185
- indexArray[iOffset + 2] = vOffset + 2;
186
-
187
- indexArray[iOffset + 3] = vOffset + 2;
188
- indexArray[iOffset + 4] = vOffset + 1;
189
- indexArray[iOffset + 5] = vOffset + 3;
190
-
191
- iOffset += 6;
192
- }
284
+ for (let j = 0; j < jl; j++) {
285
+ const isFirstSegment = j === 0;
286
+ const isLastSegment = j === jl - 1;
193
287
 
194
- EncodedCartesian3.fromCartesian(cartesian, cartesianEnc);
195
- EncodedCartesian3.fromCartesian(prevCartesian, prevCartesianEnc);
196
- EncodedCartesian3.fromCartesian(nextCartesian, nextCartesianEnc);
197
-
198
- // TODO(donmccurdy): Diverging from PolylineCollection.js, which writes
199
- // internal vertices to buffer 4x, not 2x. Not sure that's needed?
200
- 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.
229
- pickColorArray[vOffset * 4] = Color.floatToByte(pickColor.red);
230
- pickColorArray[vOffset * 4 + 1] = Color.floatToByte(pickColor.green);
231
- pickColorArray[vOffset * 4 + 2] = Color.floatToByte(pickColor.blue);
232
- pickColorArray[vOffset * 4 + 3] = Color.floatToByte(pickColor.alpha);
233
-
234
- // Properties.
235
- showColorWidthAndTexCoordArray[vOffset * 4] = show ? 1 : 0;
236
- showColorWidthAndTexCoordArray[vOffset * 4 + 1] = encodedColor;
237
- showColorWidthAndTexCoordArray[vOffset * 4 + 2] = material.width;
238
- showColorWidthAndTexCoordArray[vOffset * 4 + 3] = j / (jl - 1); // texcoord.s
239
-
240
- vOffset++;
288
+ // For first/last vertices, infer missing vertices by mirroring the segment.
289
+ // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
290
+ Cartesian3.fromArray(cartesianArray, j * 3, cartesian);
291
+ if (isFirstSegment) {
292
+ // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
293
+ Cartesian3.fromArray(cartesianArray, (j + 1) * 3, nextCartesian);
294
+ Cartesian3.subtract(cartesian, nextCartesian, prevCartesian);
295
+ Cartesian3.add(cartesian, prevCartesian, prevCartesian);
296
+ } else if (isLastSegment) {
297
+ // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
298
+ Cartesian3.fromArray(cartesianArray, (j - 1) * 3, prevCartesian);
299
+ Cartesian3.subtract(cartesian, prevCartesian, nextCartesian);
300
+ Cartesian3.add(cartesian, nextCartesian, nextCartesian);
301
+ } else {
302
+ // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
303
+ Cartesian3.fromArray(cartesianArray, (j - 1) * 3, prevCartesian);
304
+ // @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
305
+ Cartesian3.fromArray(cartesianArray, (j + 1) * 3, nextCartesian);
306
+ }
307
+
308
+ // For each segment, draw two triangles.
309
+ if (!isLastSegment) {
310
+ indexArray[iOffset] = vOffset;
311
+ indexArray[iOffset + 1] = vOffset + 1;
312
+ indexArray[iOffset + 2] = vOffset + 2;
313
+
314
+ indexArray[iOffset + 3] = vOffset + 2;
315
+ indexArray[iOffset + 4] = vOffset + 1;
316
+ indexArray[iOffset + 5] = vOffset + 3;
317
+
318
+ iOffset += 6;
319
+ }
320
+
321
+ EncodedCartesian3.fromCartesian(cartesian, cartesianEnc);
322
+ EncodedCartesian3.fromCartesian(prevCartesian, prevCartesianEnc);
323
+ EncodedCartesian3.fromCartesian(nextCartesian, nextCartesianEnc);
324
+
325
+ // TODO(donmccurdy): Diverging from PolylineCollection.js, which writes
326
+ // internal vertices to buffer 4x, not 2x. Not sure that's needed?
327
+ for (let k = 0; k < 2; k++) {
328
+ // Position.
329
+ attributeArrays.positionHigh[vOffset * 3] = cartesianEnc.high.x;
330
+ attributeArrays.positionHigh[vOffset * 3 + 1] = cartesianEnc.high.y;
331
+ attributeArrays.positionHigh[vOffset * 3 + 2] = cartesianEnc.high.z;
332
+
333
+ attributeArrays.positionLow[vOffset * 3] = cartesianEnc.low.x;
334
+ attributeArrays.positionLow[vOffset * 3 + 1] = cartesianEnc.low.y;
335
+ attributeArrays.positionLow[vOffset * 3 + 2] = cartesianEnc.low.z;
336
+
337
+ // Previous position.
338
+ attributeArrays.prevPositionHigh[vOffset * 3] =
339
+ prevCartesianEnc.high.x;
340
+ attributeArrays.prevPositionHigh[vOffset * 3 + 1] =
341
+ prevCartesianEnc.high.y;
342
+ attributeArrays.prevPositionHigh[vOffset * 3 + 2] =
343
+ prevCartesianEnc.high.z;
344
+
345
+ attributeArrays.prevPositionLow[vOffset * 3] =
346
+ prevCartesianEnc.low.x;
347
+ attributeArrays.prevPositionLow[vOffset * 3 + 1] =
348
+ prevCartesianEnc.low.y;
349
+ attributeArrays.prevPositionLow[vOffset * 3 + 2] =
350
+ prevCartesianEnc.low.z;
351
+
352
+ // Next position.
353
+ attributeArrays.nextPositionHigh[vOffset * 3] =
354
+ nextCartesianEnc.high.x;
355
+ attributeArrays.nextPositionHigh[vOffset * 3 + 1] =
356
+ nextCartesianEnc.high.y;
357
+ attributeArrays.nextPositionHigh[vOffset * 3 + 2] =
358
+ nextCartesianEnc.high.z;
359
+
360
+ attributeArrays.nextPositionLow[vOffset * 3] =
361
+ nextCartesianEnc.low.x;
362
+ attributeArrays.nextPositionLow[vOffset * 3 + 1] =
363
+ nextCartesianEnc.low.y;
364
+ attributeArrays.nextPositionLow[vOffset * 3 + 2] =
365
+ nextCartesianEnc.low.z;
366
+
367
+ // Pick ID.
368
+ pickColorArray[vOffset * 4] = Color.floatToByte(pickColor.red);
369
+ pickColorArray[vOffset * 4 + 1] = Color.floatToByte(
370
+ pickColor.green,
371
+ );
372
+ pickColorArray[vOffset * 4 + 2] = Color.floatToByte(pickColor.blue);
373
+ pickColorArray[vOffset * 4 + 3] = Color.floatToByte(
374
+ pickColor.alpha,
375
+ );
376
+
377
+ // Properties.
378
+ showColorWidthAndTexCoordArray[vOffset * 4] = show ? 1 : 0;
379
+ showColorWidthAndTexCoordArray[vOffset * 4 + 1] = encodedColor;
380
+ showColorWidthAndTexCoordArray[vOffset * 4 + 2] = material.width;
381
+ showColorWidthAndTexCoordArray[vOffset * 4 + 3] = j / (jl - 1); // texcoord.s
382
+
383
+ alphaArray[vOffset] = colorAlpha * 255.0;
384
+
385
+ vOffset++;
386
+ }
241
387
  }
242
388
  }
243
389
 
@@ -260,84 +406,130 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
260
406
  }),
261
407
 
262
408
  attributes: [
409
+ ...(!useFloat64
410
+ ? [
411
+ {
412
+ index: BufferPolylineAttributeLocations.position,
413
+ componentDatatype: collection._positionDatatype,
414
+ componentsPerAttribute: 3,
415
+ normalize: collection._positionNormalized,
416
+ vertexBuffer: Buffer.createVertexBuffer({
417
+ typedArray: attributeArrays.position,
418
+ context,
419
+ usage: BufferUsage.STATIC_DRAW,
420
+ }),
421
+ },
422
+ {
423
+ index: BufferPolylineAttributeLocations.prevPosition,
424
+ componentDatatype: collection._positionDatatype,
425
+ componentsPerAttribute: 3,
426
+ normalize: collection._positionNormalized,
427
+ vertexBuffer: Buffer.createVertexBuffer({
428
+ typedArray: attributeArrays.prevPosition,
429
+ context,
430
+ usage: BufferUsage.STATIC_DRAW,
431
+ }),
432
+ },
433
+ {
434
+ index: BufferPolylineAttributeLocations.nextPosition,
435
+ componentDatatype: collection._positionDatatype,
436
+ componentsPerAttribute: 3,
437
+ normalize: collection._positionNormalized,
438
+ vertexBuffer: Buffer.createVertexBuffer({
439
+ typedArray: attributeArrays.nextPosition,
440
+ context,
441
+ usage: BufferUsage.STATIC_DRAW,
442
+ }),
443
+ },
444
+ ]
445
+ : [
446
+ {
447
+ index: BufferPolylineAttributeLocationsFloat64.positionHigh,
448
+ componentDatatype: ComponentDatatype.FLOAT,
449
+ componentsPerAttribute: 3,
450
+ vertexBuffer: Buffer.createVertexBuffer({
451
+ typedArray: attributeArrays.positionHigh,
452
+ context,
453
+ usage: BufferUsage.STATIC_DRAW,
454
+ }),
455
+ },
456
+ {
457
+ index: BufferPolylineAttributeLocationsFloat64.positionLow,
458
+ componentDatatype: ComponentDatatype.FLOAT,
459
+ componentsPerAttribute: 3,
460
+ vertexBuffer: Buffer.createVertexBuffer({
461
+ typedArray: attributeArrays.positionLow,
462
+ context,
463
+ usage: BufferUsage.STATIC_DRAW,
464
+ }),
465
+ },
466
+ {
467
+ index: BufferPolylineAttributeLocationsFloat64.prevPositionHigh,
468
+ componentDatatype: ComponentDatatype.FLOAT,
469
+ componentsPerAttribute: 3,
470
+ vertexBuffer: Buffer.createVertexBuffer({
471
+ typedArray: attributeArrays.prevPositionHigh,
472
+ context,
473
+ usage: BufferUsage.STATIC_DRAW,
474
+ }),
475
+ },
476
+ {
477
+ index: BufferPolylineAttributeLocationsFloat64.prevPositionLow,
478
+ componentDatatype: ComponentDatatype.FLOAT,
479
+ componentsPerAttribute: 3,
480
+ vertexBuffer: Buffer.createVertexBuffer({
481
+ typedArray: attributeArrays.prevPositionLow,
482
+ context,
483
+ usage: BufferUsage.STATIC_DRAW,
484
+ }),
485
+ },
486
+ {
487
+ index: BufferPolylineAttributeLocationsFloat64.nextPositionHigh,
488
+ componentDatatype: ComponentDatatype.FLOAT,
489
+ componentsPerAttribute: 3,
490
+ vertexBuffer: Buffer.createVertexBuffer({
491
+ typedArray: attributeArrays.nextPositionHigh,
492
+ context,
493
+ usage: BufferUsage.STATIC_DRAW,
494
+ }),
495
+ },
496
+ {
497
+ index: BufferPolylineAttributeLocationsFloat64.nextPositionLow,
498
+ componentDatatype: ComponentDatatype.FLOAT,
499
+ componentsPerAttribute: 3,
500
+ vertexBuffer: Buffer.createVertexBuffer({
501
+ typedArray: attributeArrays.nextPositionLow,
502
+ context,
503
+ usage: BufferUsage.STATIC_DRAW,
504
+ }),
505
+ },
506
+ ]),
263
507
  {
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,
508
+ index: attributeLocations.pickColor,
509
+ componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
510
+ componentsPerAttribute: 4,
309
511
  vertexBuffer: Buffer.createVertexBuffer({
310
- typedArray: attributeArrays.nextPositionHigh,
512
+ typedArray: attributeArrays.pickColor,
311
513
  context,
312
514
  usage: BufferUsage.STATIC_DRAW,
313
515
  }),
314
516
  },
315
517
  {
316
- index: BufferPolylineAttributeLocations.nextPositionLow,
518
+ index: attributeLocations.showColorWidthAndTexCoord,
317
519
  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
520
  componentsPerAttribute: 4,
329
521
  vertexBuffer: Buffer.createVertexBuffer({
330
- typedArray: attributeArrays.pickColor,
522
+ typedArray: attributeArrays.showColorWidthAndTexCoord,
331
523
  context,
332
524
  usage: BufferUsage.STATIC_DRAW,
333
525
  }),
334
526
  },
335
527
  {
336
- index: BufferPolylineAttributeLocations.showColorWidthAndTexCoord,
337
- componentDatatype: ComponentDatatype.FLOAT,
338
- componentsPerAttribute: 4,
528
+ index: attributeLocations.alpha,
529
+ componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
530
+ componentsPerAttribute: 1,
339
531
  vertexBuffer: Buffer.createVertexBuffer({
340
- typedArray: attributeArrays.showColorWidthAndTexCoord,
532
+ typedArray: attributeArrays.alpha,
341
533
  context,
342
534
  usage: BufferUsage.STATIC_DRAW,
343
535
  }),
@@ -354,11 +546,11 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
354
546
  indexCount,
355
547
  );
356
548
 
357
- for (const key in BufferPolylineAttributeLocations) {
358
- if (Object.hasOwn(BufferPolylineAttributeLocations, key)) {
549
+ for (const key in attributeLocations) {
550
+ if (Object.hasOwn(attributeLocations, key)) {
359
551
  const attribute = /** @type {BufferPolylineAttribute} */ (key);
360
552
  renderContext.vertexArray.copyAttributeFromRange(
361
- BufferPolylineAttributeLocations[attribute],
553
+ attributeLocations[attribute],
362
554
  renderContext.attributeArrays[attribute],
363
555
  vertexOffset,
364
556
  vertexCount,
@@ -369,7 +561,10 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
369
561
 
370
562
  if (!defined(renderContext.renderState)) {
371
563
  renderContext.renderState = RenderState.fromCache({
372
- blending: BlendingState.DISABLED,
564
+ blending:
565
+ collection._blendOption === BlendOption.OPAQUE
566
+ ? BlendingState.DISABLED
567
+ : BlendingState.ALPHA_BLEND,
373
568
  depthTest: { enabled: true },
374
569
  });
375
570
  }
@@ -379,11 +574,12 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
379
574
  context,
380
575
  vertexShaderSource: new ShaderSource({
381
576
  sources: [PolylineCommon, BufferPolylineMaterialVS],
577
+ defines: useFloat64 ? ["USE_FLOAT64"] : [],
382
578
  }),
383
579
  fragmentShaderSource: new ShaderSource({
384
580
  sources: [BufferPolylineMaterialFS],
385
581
  }),
386
- attributeLocations: BufferPolylineAttributeLocations,
582
+ attributeLocations,
387
583
  });
388
584
  }
389
585
 
@@ -395,12 +591,15 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
395
591
  renderState: renderContext.renderState,
396
592
  shaderProgram: renderContext.shaderProgram,
397
593
  primitiveType: PrimitiveType.TRIANGLES,
398
- pass: Pass.OPAQUE,
594
+ pass:
595
+ collection._blendOption === BlendOption.OPAQUE
596
+ ? Pass.OPAQUE
597
+ : Pass.TRANSLUCENT,
399
598
  pickId: collection._allowPicking ? "v_pickColor" : undefined,
400
599
  owner: collection,
401
600
  count: drawCount,
402
601
  modelMatrix: collection.modelMatrix, // shared reference
403
- boundingVolume: collection.boundingVolumeWC, // shared reference
602
+ boundingVolume: collection.boundingVolume, // shared reference
404
603
  debugShowBoundingVolume: collection.debugShowBoundingVolume,
405
604
  });
406
605
  }