@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.
- package/Build/Workers/{chunk-3VDDRF2E.js → chunk-2EFYUSUY.js} +14 -14
- package/Build/Workers/{chunk-4GF4MVPY.js → chunk-5LSOO2KD.js} +7 -7
- package/Build/Workers/{chunk-I3A6DXYZ.js → chunk-6HK6IXK2.js} +4 -4
- package/Build/Workers/{chunk-CZ23Y3RM.js → chunk-6YR6JBMY.js} +2 -2
- package/Build/Workers/{chunk-J7KQEKPK.js → chunk-76FDC45O.js} +13 -13
- package/Build/Workers/{chunk-ZCCIIBZT.js → chunk-7D2HZKH7.js} +6 -6
- package/Build/Workers/{chunk-HSVQATK2.js → chunk-7KVKHY7O.js} +6 -6
- package/Build/Workers/{chunk-ITD2IN7N.js → chunk-A3O6EDBK.js} +2 -2
- package/Build/Workers/{chunk-ND3NTTOF.js → chunk-A6X24AZI.js} +6 -6
- package/Build/Workers/{chunk-DH26SNAB.js → chunk-AHWAZRBV.js} +6 -2
- package/Build/Workers/{chunk-3XY3MVPG.js → chunk-B4CQSLZJ.js} +4 -4
- package/Build/Workers/{chunk-DYT5NR6P.js → chunk-C7JQVRLM.js} +3 -3
- package/Build/Workers/{chunk-WC57YYBN.js → chunk-CDJDJ5LK.js} +2 -2
- package/Build/Workers/{chunk-VQKLRBIK.js → chunk-CEEZE3YZ.js} +7 -7
- package/Build/Workers/{chunk-4QQXGTCE.js → chunk-CLCTQVVL.js} +8 -8
- package/Build/Workers/{chunk-WNN5D4W3.js → chunk-DBD5WWG2.js} +10 -10
- package/Build/Workers/{chunk-URUCCIPS.js → chunk-DIGUUD6G.js} +6 -6
- package/Build/Workers/{chunk-BTX2NL3P.js → chunk-E7NZJOK7.js} +196 -22
- package/Build/Workers/{chunk-3LSD7OOA.js → chunk-EHTS2YPT.js} +16 -16
- package/Build/Workers/{chunk-35H3UBIO.js → chunk-ENNFMWDW.js} +11 -11
- package/Build/Workers/{chunk-GL7DNVUS.js → chunk-FCP2QY4G.js} +5 -5
- package/Build/Workers/{chunk-3RFFPH4M.js → chunk-FDK4K5IA.js} +1 -1
- package/Build/Workers/{chunk-WTQGE7Q6.js → chunk-FGQFQHN5.js} +17 -17
- package/Build/Workers/{chunk-WUBKZFF6.js → chunk-GSWMAFTE.js} +9 -9
- package/Build/Workers/{chunk-3TKLDHV3.js → chunk-GXWQZBAI.js} +2 -2
- package/Build/Workers/{chunk-A7A433MD.js → chunk-HHV3MCGV.js} +5 -5
- package/Build/Workers/{chunk-A7ZBMVFS.js → chunk-HS6AD4P2.js} +14 -14
- package/Build/Workers/{chunk-QXNQQYPV.js → chunk-IGAZBTFZ.js} +8 -8
- package/Build/Workers/{chunk-ZAPOS52G.js → chunk-ILME5BXA.js} +8 -8
- package/Build/Workers/{chunk-4MTRQFJP.js → chunk-JKXV6PG5.js} +1 -1
- package/Build/Workers/{chunk-FVLVVOBQ.js → chunk-JW6OZT4R.js} +10 -10
- package/Build/Workers/{chunk-EZARA5FJ.js → chunk-KGXSYGBG.js} +13 -13
- package/Build/Workers/{chunk-J3OFS2RD.js → chunk-LD64RPYV.js} +12 -12
- package/Build/Workers/{chunk-AWFZHD2B.js → chunk-LGNDTZVX.js} +4 -4
- package/Build/Workers/{chunk-AEAVLYPS.js → chunk-LNSQVXFH.js} +2 -2
- package/Build/Workers/{chunk-TA777BGS.js → chunk-N7CCOFLX.js} +1 -1
- package/Build/Workers/{chunk-7LSFAEWF.js → chunk-NIWITKQK.js} +10 -10
- package/Build/Workers/{chunk-4XXHJI6Y.js → chunk-OBEU25PI.js} +17 -17
- package/Build/Workers/{chunk-5T6QQAJW.js → chunk-QVLAFFJY.js} +1 -1
- package/Build/Workers/{chunk-J647NNZW.js → chunk-R4FPNAZ2.js} +6 -6
- package/Build/Workers/{chunk-HVMG6AG4.js → chunk-RG4F5R57.js} +9 -9
- package/Build/Workers/{chunk-ST2UWDUU.js → chunk-SF6K72D7.js} +5 -5
- package/Build/Workers/{chunk-H2A4USJR.js → chunk-SGRGNDOD.js} +10 -10
- package/Build/Workers/{chunk-DFEI5MAV.js → chunk-SM2CDCYF.js} +7 -7
- package/Build/Workers/{chunk-TAI4HLII.js → chunk-SS5ABQGY.js} +4 -4
- package/Build/Workers/{chunk-ACFFCHHZ.js → chunk-T5QBPLE3.js} +11 -11
- package/Build/Workers/{chunk-BVAIWR7O.js → chunk-TVZD72WJ.js} +12 -12
- package/Build/Workers/{chunk-6SDGQI27.js → chunk-UEY73NRN.js} +1 -1
- package/Build/Workers/{chunk-K6NFIRFB.js → chunk-UVO6COT2.js} +5 -5
- package/Build/Workers/{chunk-77RL3MBD.js → chunk-VAL7DYNR.js} +25 -4
- package/Build/Workers/{chunk-WN6P5UDH.js → chunk-WBSY7HDY.js} +12 -12
- package/Build/Workers/{chunk-FIBS5S7R.js → chunk-XDWCTQCZ.js} +2 -2
- package/Build/Workers/{chunk-CKQP3DSS.js → chunk-XLXSDIP5.js} +6 -6
- package/Build/Workers/{chunk-LH5SF3XV.js → chunk-XQ3SKCMM.js} +5 -5
- package/Build/Workers/{chunk-QSDY4NS7.js → chunk-YKU2Q3A2.js} +9 -9
- package/Build/Workers/{chunk-GPIGURCG.js → chunk-ZMBHFYOX.js} +7 -7
- package/Build/Workers/{chunk-QO2CGXMP.js → chunk-ZSGUV73H.js} +6 -6
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +987 -2320
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/BoundingRectangle.js +6 -8
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/Color.js +1 -0
- package/Source/Core/ComponentDatatype.js +35 -0
- package/Source/Core/InterpolationAlgorithm.js +57 -50
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/MapProjection.js +1 -0
- package/Source/Core/Matrix2.js +1 -1
- package/Source/Core/Matrix3.js +1 -1
- package/Source/Core/Matrix4.js +1 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/TerrainMesh.js +3 -3
- package/Source/Core/TerrainPicker.js +1 -0
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Core/writeTextToCanvas.js +1 -0
- package/Source/DataSources/CzmlDataSource.js +12 -0
- package/Source/DataSources/KmlDataSource.js +528 -555
- package/Source/DataSources/PathGraphics.js +8 -1
- package/Source/DataSources/PathMode.js +27 -0
- package/Source/DataSources/PathVisualizer.js +298 -1
- package/Source/Renderer/Pass.js +3 -2
- package/Source/Renderer/Texture.js +1 -1
- package/Source/Renderer/VertexArray.js +1 -0
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BillboardTexture.js +5 -3
- package/Source/Scene/BufferPoint.js +1 -0
- package/Source/Scene/BufferPointCollection.js +14 -1
- package/Source/Scene/BufferPolygon.js +3 -2
- package/Source/Scene/BufferPolygonCollection.js +10 -0
- package/Source/Scene/BufferPolyline.js +1 -0
- package/Source/Scene/BufferPolylineCollection.js +2 -0
- package/Source/Scene/BufferPrimitiveCollection.js +79 -28
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/Cesium3DTile.js +54 -1
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
- package/Source/Scene/Cesium3DTileset.js +45 -5
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/ClippingPolygon.js +2 -0
- package/Source/Scene/ClippingPolygonCollection.js +2 -2
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/DerivedCommand.js +4 -0
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/Expression.js +6 -8
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/GlobeSurfaceShaderSet.js +501 -409
- package/Source/Scene/GlobeSurfaceTile.js +540 -401
- package/Source/Scene/GlobeSurfaceTileProvider.js +1259 -1146
- package/Source/Scene/GltfBufferViewLoader.js +3 -3
- package/Source/Scene/GltfLoader.js +110 -0
- package/Source/Scene/GltfLoaderUtil.js +20 -4
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
- package/Source/Scene/ImageryLayer.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/Implicit3DTileContent.js +179 -214
- package/Source/Scene/MVTDataProvider.js +147 -0
- package/Source/Scene/Material.js +1 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +79 -311
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
- package/Source/Scene/Model/Model.js +37 -0
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelDrawCommand.js +31 -3
- package/Source/Scene/Model/ModelUtility.js +5 -0
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +466 -150
- package/Source/Scene/ModelComponents.js +39 -1
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/Picking.js +5 -0
- package/Source/Scene/PntsParser.js +1 -0
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/ResourceCacheKey.js +5 -5
- package/Source/Scene/Scene.js +27 -0
- package/Source/Scene/Tileset3DTileContent.js +113 -146
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
- package/Source/Scene/Vector3DTileContent.js +205 -234
- package/Source/Scene/VectorGltf3DTileContent.js +85 -36
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -91
- package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/decodeMVT.js +634 -0
- package/Source/Scene/findMeshoptExtension.js +23 -0
- package/Source/Scene/renderBufferPointCollection.js +113 -62
- package/Source/Scene/renderBufferPolygonCollection.js +98 -55
- package/Source/Scene/renderBufferPolylineCollection.js +270 -143
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
- package/index.d.ts +311 -288
- package/index.js +103 -92
- 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
|
|
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<
|
|
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
|
|
71
|
-
const
|
|
72
|
-
const
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
//
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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);
|
|
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:
|
|
265
|
-
componentDatatype: ComponentDatatype.
|
|
266
|
-
componentsPerAttribute:
|
|
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.
|
|
440
|
+
typedArray: attributeArrays.pickColor,
|
|
311
441
|
context,
|
|
312
442
|
usage: BufferUsage.STATIC_DRAW,
|
|
313
443
|
}),
|
|
314
444
|
},
|
|
315
445
|
{
|
|
316
|
-
index:
|
|
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.
|
|
450
|
+
typedArray: attributeArrays.showColorWidthAndTexCoord,
|
|
331
451
|
context,
|
|
332
452
|
usage: BufferUsage.STATIC_DRAW,
|
|
333
453
|
}),
|
|
334
454
|
},
|
|
335
455
|
{
|
|
336
|
-
index:
|
|
337
|
-
componentDatatype: ComponentDatatype.
|
|
338
|
-
componentsPerAttribute:
|
|
456
|
+
index: attributeLocations.alpha,
|
|
457
|
+
componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
|
|
458
|
+
componentsPerAttribute: 1,
|
|
339
459
|
vertexBuffer: Buffer.createVertexBuffer({
|
|
340
|
-
typedArray: attributeArrays.
|
|
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
|
|
358
|
-
if (Object.hasOwn(
|
|
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
|
-
|
|
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:
|
|
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
|
|
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:
|
|
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.
|
|
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
|
|
5
|
-
in
|
|
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 =
|
|
16
|
-
float pixelSize =
|
|
17
|
-
vec4 color = czm_decodeRGB8(
|
|
18
|
-
float
|
|
19
|
-
|
|
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
|
|