@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
|
@@ -20,6 +20,7 @@ import BufferPointMaterialFS from "../Shaders/BufferPointMaterialFS.js";
|
|
|
20
20
|
import EncodedCartesian3 from "../Core/EncodedCartesian3.js";
|
|
21
21
|
import AttributeCompression from "../Core/AttributeCompression.js";
|
|
22
22
|
import BufferPointMaterial from "./BufferPointMaterial.js";
|
|
23
|
+
import BlendOption from "./BlendOption.js";
|
|
23
24
|
|
|
24
25
|
/** @import FrameState from "./FrameState.js"; */
|
|
25
26
|
/** @import BufferPointCollection from "./BufferPointCollection.js"; */
|
|
@@ -27,26 +28,39 @@ import BufferPointMaterial from "./BufferPointMaterial.js";
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* TODO(PR#13211): Need 'keyof' syntax to avoid duplicating attribute names.
|
|
30
|
-
* @typedef {'positionHigh' | 'positionLow' | 'pickColor' | '
|
|
31
|
+
* @typedef {'positionHigh' | 'positionLow' | 'pickColor' | 'showSizeColorAlpha' | 'outlineWidthColorAlpha'} BufferPointAttribute
|
|
31
32
|
* @ignore
|
|
32
33
|
*/
|
|
33
34
|
|
|
34
35
|
/**
|
|
36
|
+
* Attribute locations when using 64-bit position precision.
|
|
35
37
|
* @type {Record<BufferPointAttribute, number>}
|
|
36
38
|
* @ignore
|
|
37
39
|
*/
|
|
38
|
-
const
|
|
40
|
+
const BufferPointAttributeLocationsFloat64 = {
|
|
39
41
|
positionHigh: 0,
|
|
40
42
|
positionLow: 1,
|
|
41
43
|
pickColor: 2,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
showSizeColorAlpha: 3,
|
|
45
|
+
outlineWidthColorAlpha: 4,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Attribute locations when using <= 32-bit position precision.
|
|
50
|
+
* @type {Record<string, number>}
|
|
51
|
+
* @ignore
|
|
52
|
+
*/
|
|
53
|
+
const BufferPointAttributeLocations = {
|
|
54
|
+
position: 0,
|
|
55
|
+
pickColor: 1,
|
|
56
|
+
showSizeColorAlpha: 2,
|
|
57
|
+
outlineWidthColorAlpha: 3,
|
|
44
58
|
};
|
|
45
59
|
|
|
46
60
|
/**
|
|
47
61
|
* @typedef {object} BufferPointRenderContext
|
|
48
62
|
* @property {VertexArray} [vertexArray]
|
|
49
|
-
* @property {Record<
|
|
63
|
+
* @property {Record<string, TypedArray>} [attributeArrays]
|
|
50
64
|
* @property {RenderState} [renderState]
|
|
51
65
|
* @property {ShaderProgram} [shaderProgram]
|
|
52
66
|
* @property {DrawCommand} [command]
|
|
@@ -71,16 +85,24 @@ const encodedCartesian = new EncodedCartesian3();
|
|
|
71
85
|
function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
72
86
|
const context = frameState.context;
|
|
73
87
|
renderContext = renderContext || { destroy: destroyRenderContext };
|
|
88
|
+
const useFloat64 = collection._positionDatatype === ComponentDatatype.DOUBLE;
|
|
89
|
+
const attributeLocations = useFloat64
|
|
90
|
+
? BufferPointAttributeLocationsFloat64
|
|
91
|
+
: BufferPointAttributeLocations;
|
|
74
92
|
|
|
75
93
|
if (!defined(renderContext.attributeArrays)) {
|
|
76
94
|
const featureCountMax = collection.primitiveCountMax;
|
|
77
95
|
|
|
78
96
|
renderContext.attributeArrays = {
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
...(useFloat64
|
|
98
|
+
? {
|
|
99
|
+
positionHigh: new Float32Array(featureCountMax * 3),
|
|
100
|
+
positionLow: new Float32Array(featureCountMax * 3),
|
|
101
|
+
}
|
|
102
|
+
: { position: collection._positionView }),
|
|
81
103
|
pickColor: new Uint8Array(featureCountMax * 4),
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
showSizeColorAlpha: new Float32Array(featureCountMax * 4),
|
|
105
|
+
outlineWidthColorAlpha: new Float32Array(featureCountMax * 3),
|
|
84
106
|
};
|
|
85
107
|
}
|
|
86
108
|
|
|
@@ -90,9 +112,8 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
90
112
|
const positionHighArray = attributeArrays.positionHigh;
|
|
91
113
|
const positionLowArray = attributeArrays.positionLow;
|
|
92
114
|
const pickColorArray = attributeArrays.pickColor;
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
attributeArrays.outlineWidthAndOutlineColor;
|
|
115
|
+
const showSizeColorAlphaArray = attributeArrays.showSizeColorAlpha;
|
|
116
|
+
const outlineWidthColorAlphaArray = attributeArrays.outlineWidthColorAlpha;
|
|
96
117
|
|
|
97
118
|
const { _dirtyOffset, _dirtyCount } = collection;
|
|
98
119
|
|
|
@@ -103,33 +124,40 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
103
124
|
continue;
|
|
104
125
|
}
|
|
105
126
|
|
|
106
|
-
|
|
107
|
-
|
|
127
|
+
if (useFloat64) {
|
|
128
|
+
point.getPosition(cartesian);
|
|
129
|
+
EncodedCartesian3.fromCartesian(cartesian, encodedCartesian);
|
|
130
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
131
|
+
Cartesian3.pack(encodedCartesian.high, positionHighArray, i * 3);
|
|
132
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
133
|
+
Cartesian3.pack(encodedCartesian.low, positionLowArray, i * 3);
|
|
134
|
+
}
|
|
135
|
+
|
|
108
136
|
point.getMaterial(material);
|
|
109
137
|
Color.fromRgba(point._pickId, pickColor);
|
|
110
138
|
|
|
111
|
-
positionHighArray[i * 3] = encodedCartesian.high.x;
|
|
112
|
-
positionHighArray[i * 3 + 1] = encodedCartesian.high.y;
|
|
113
|
-
positionHighArray[i * 3 + 2] = encodedCartesian.high.z;
|
|
114
|
-
|
|
115
|
-
positionLowArray[i * 3] = encodedCartesian.low.x;
|
|
116
|
-
positionLowArray[i * 3 + 1] = encodedCartesian.low.y;
|
|
117
|
-
positionLowArray[i * 3 + 2] = encodedCartesian.low.z;
|
|
118
|
-
|
|
119
139
|
pickColorArray[i * 4] = Color.floatToByte(pickColor.red);
|
|
120
140
|
pickColorArray[i * 4 + 1] = Color.floatToByte(pickColor.green);
|
|
121
141
|
pickColorArray[i * 4 + 2] = Color.floatToByte(pickColor.blue);
|
|
122
142
|
pickColorArray[i * 4 + 3] = Color.floatToByte(pickColor.alpha);
|
|
123
143
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
144
|
+
showSizeColorAlphaArray[i * 4] = point.show ? 1 : 0;
|
|
145
|
+
showSizeColorAlphaArray[i * 4 + 1] = material.size;
|
|
146
|
+
showSizeColorAlphaArray[i * 4 + 2] = AttributeCompression.encodeRGB8(
|
|
127
147
|
material.color,
|
|
128
148
|
);
|
|
149
|
+
showSizeColorAlphaArray[i * 4 + 3] = material.color.alpha;
|
|
129
150
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
outlineWidthColorAlphaArray[i * 3] = material.outlineWidth;
|
|
152
|
+
outlineWidthColorAlphaArray[i * 3 + 1] = AttributeCompression.encodeRGB8(
|
|
153
|
+
// When outlineWidth=0, overwrite outlineColor to prevent subpixel bleeding.
|
|
154
|
+
material.outlineWidth > 0 ? material.outlineColor : material.color,
|
|
155
|
+
);
|
|
156
|
+
outlineWidthColorAlphaArray[i * 3 + 2] =
|
|
157
|
+
// When outlineWidth=0, overwrite outlineAlpha to prevent subpixel bleeding.
|
|
158
|
+
material.outlineWidth > 0
|
|
159
|
+
? material.outlineColor.alpha
|
|
160
|
+
: material.color.alpha;
|
|
133
161
|
|
|
134
162
|
point._dirty = false;
|
|
135
163
|
}
|
|
@@ -141,28 +169,44 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
141
169
|
renderContext.vertexArray = new VertexArray({
|
|
142
170
|
context,
|
|
143
171
|
attributes: [
|
|
172
|
+
...(!useFloat64
|
|
173
|
+
? [
|
|
174
|
+
{
|
|
175
|
+
index: BufferPointAttributeLocations.position,
|
|
176
|
+
componentDatatype: collection._positionDatatype,
|
|
177
|
+
componentsPerAttribute: 3,
|
|
178
|
+
normalize: collection._positionNormalized,
|
|
179
|
+
vertexBuffer: Buffer.createVertexBuffer({
|
|
180
|
+
typedArray: collection._positionView,
|
|
181
|
+
context,
|
|
182
|
+
usage: BufferUsage.STATIC_DRAW,
|
|
183
|
+
}),
|
|
184
|
+
},
|
|
185
|
+
]
|
|
186
|
+
: [
|
|
187
|
+
{
|
|
188
|
+
index: BufferPointAttributeLocationsFloat64.positionHigh,
|
|
189
|
+
componentDatatype: ComponentDatatype.FLOAT,
|
|
190
|
+
componentsPerAttribute: 3,
|
|
191
|
+
vertexBuffer: Buffer.createVertexBuffer({
|
|
192
|
+
typedArray: attributeArrays.positionHigh,
|
|
193
|
+
context,
|
|
194
|
+
usage: BufferUsage.STATIC_DRAW,
|
|
195
|
+
}),
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
index: BufferPointAttributeLocationsFloat64.positionLow,
|
|
199
|
+
componentDatatype: ComponentDatatype.FLOAT,
|
|
200
|
+
componentsPerAttribute: 3,
|
|
201
|
+
vertexBuffer: Buffer.createVertexBuffer({
|
|
202
|
+
typedArray: attributeArrays.positionLow,
|
|
203
|
+
context,
|
|
204
|
+
usage: BufferUsage.STATIC_DRAW,
|
|
205
|
+
}),
|
|
206
|
+
},
|
|
207
|
+
]),
|
|
144
208
|
{
|
|
145
|
-
index:
|
|
146
|
-
componentDatatype: ComponentDatatype.FLOAT,
|
|
147
|
-
componentsPerAttribute: 3,
|
|
148
|
-
vertexBuffer: Buffer.createVertexBuffer({
|
|
149
|
-
typedArray: attributeArrays.positionHigh,
|
|
150
|
-
context,
|
|
151
|
-
usage: BufferUsage.STATIC_DRAW,
|
|
152
|
-
}),
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
index: BufferPointAttributeLocations.positionLow,
|
|
156
|
-
componentDatatype: ComponentDatatype.FLOAT,
|
|
157
|
-
componentsPerAttribute: 3,
|
|
158
|
-
vertexBuffer: Buffer.createVertexBuffer({
|
|
159
|
-
typedArray: attributeArrays.positionLow,
|
|
160
|
-
context,
|
|
161
|
-
usage: BufferUsage.STATIC_DRAW,
|
|
162
|
-
}),
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
index: BufferPointAttributeLocations.pickColor,
|
|
209
|
+
index: attributeLocations.pickColor,
|
|
166
210
|
componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
|
|
167
211
|
componentsPerAttribute: 4,
|
|
168
212
|
vertexBuffer: Buffer.createVertexBuffer({
|
|
@@ -172,21 +216,21 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
172
216
|
}),
|
|
173
217
|
},
|
|
174
218
|
{
|
|
175
|
-
index:
|
|
219
|
+
index: attributeLocations.showSizeColorAlpha,
|
|
176
220
|
componentDatatype: ComponentDatatype.FLOAT,
|
|
177
|
-
componentsPerAttribute:
|
|
221
|
+
componentsPerAttribute: 4,
|
|
178
222
|
vertexBuffer: Buffer.createVertexBuffer({
|
|
179
|
-
typedArray: attributeArrays.
|
|
223
|
+
typedArray: attributeArrays.showSizeColorAlpha,
|
|
180
224
|
context,
|
|
181
225
|
usage: BufferUsage.STATIC_DRAW,
|
|
182
226
|
}),
|
|
183
227
|
},
|
|
184
228
|
{
|
|
185
|
-
index:
|
|
229
|
+
index: attributeLocations.outlineWidthColorAlpha,
|
|
186
230
|
componentDatatype: ComponentDatatype.FLOAT,
|
|
187
|
-
componentsPerAttribute:
|
|
231
|
+
componentsPerAttribute: 3,
|
|
188
232
|
vertexBuffer: Buffer.createVertexBuffer({
|
|
189
|
-
typedArray: attributeArrays.
|
|
233
|
+
typedArray: attributeArrays.outlineWidthColorAlpha,
|
|
190
234
|
context,
|
|
191
235
|
usage: BufferUsage.STATIC_DRAW,
|
|
192
236
|
}),
|
|
@@ -194,11 +238,11 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
194
238
|
],
|
|
195
239
|
});
|
|
196
240
|
} else if (collection._dirtyCount > 0) {
|
|
197
|
-
for (const key in
|
|
198
|
-
if (Object.hasOwn(
|
|
241
|
+
for (const key in attributeLocations) {
|
|
242
|
+
if (Object.hasOwn(attributeLocations, key)) {
|
|
199
243
|
const attribute = /** @type {BufferPointAttribute} */ (key);
|
|
200
244
|
renderContext.vertexArray.copyAttributeFromRange(
|
|
201
|
-
|
|
245
|
+
attributeLocations[attribute],
|
|
202
246
|
renderContext.attributeArrays[attribute],
|
|
203
247
|
collection._dirtyOffset,
|
|
204
248
|
collection._dirtyCount,
|
|
@@ -209,7 +253,10 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
209
253
|
|
|
210
254
|
if (!defined(renderContext.renderState)) {
|
|
211
255
|
renderContext.renderState = RenderState.fromCache({
|
|
212
|
-
blending:
|
|
256
|
+
blending:
|
|
257
|
+
collection._blendOption === BlendOption.OPAQUE
|
|
258
|
+
? BlendingState.DISABLED
|
|
259
|
+
: BlendingState.ALPHA_BLEND,
|
|
213
260
|
depthTest: { enabled: true },
|
|
214
261
|
});
|
|
215
262
|
}
|
|
@@ -219,11 +266,12 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
219
266
|
context,
|
|
220
267
|
vertexShaderSource: new ShaderSource({
|
|
221
268
|
sources: [BufferPointMaterialVS],
|
|
269
|
+
defines: useFloat64 ? ["USE_FLOAT64"] : [],
|
|
222
270
|
}),
|
|
223
271
|
fragmentShaderSource: new ShaderSource({
|
|
224
272
|
sources: [BufferPointMaterialFS],
|
|
225
273
|
}),
|
|
226
|
-
attributeLocations
|
|
274
|
+
attributeLocations,
|
|
227
275
|
});
|
|
228
276
|
}
|
|
229
277
|
|
|
@@ -233,12 +281,15 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
233
281
|
renderState: renderContext.renderState,
|
|
234
282
|
shaderProgram: renderContext.shaderProgram,
|
|
235
283
|
primitiveType: PrimitiveType.POINTS,
|
|
236
|
-
pass:
|
|
284
|
+
pass:
|
|
285
|
+
collection._blendOption === BlendOption.OPAQUE
|
|
286
|
+
? Pass.OPAQUE
|
|
287
|
+
: Pass.TRANSLUCENT,
|
|
237
288
|
pickId: collection._allowPicking ? "v_pickColor" : undefined,
|
|
238
289
|
owner: collection,
|
|
239
290
|
count: collection.primitiveCount,
|
|
240
291
|
modelMatrix: collection.modelMatrix, // shared reference
|
|
241
|
-
boundingVolume: collection.
|
|
292
|
+
boundingVolume: collection.boundingVolume, // shared reference
|
|
242
293
|
debugShowBoundingVolume: collection.debugShowBoundingVolume,
|
|
243
294
|
});
|
|
244
295
|
}
|
|
@@ -21,6 +21,7 @@ import EncodedCartesian3 from "../Core/EncodedCartesian3.js";
|
|
|
21
21
|
import AttributeCompression from "../Core/AttributeCompression.js";
|
|
22
22
|
import IndexDatatype from "../Core/IndexDatatype.js";
|
|
23
23
|
import BufferPolygonMaterial from "./BufferPolygonMaterial.js";
|
|
24
|
+
import BlendOption from "./BlendOption.js";
|
|
24
25
|
|
|
25
26
|
/** @import {TypedArray} from "../Core/globalTypes.js"; */
|
|
26
27
|
/** @import FrameState from "./FrameState.js"; */
|
|
@@ -28,25 +29,37 @@ import BufferPolygonMaterial from "./BufferPolygonMaterial.js";
|
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* TODO(PR#13211): Need 'keyof' syntax to avoid duplicating attribute names.
|
|
31
|
-
* @typedef {'positionHigh' | 'positionLow' | 'pickColor' | '
|
|
32
|
+
* @typedef {'positionHigh' | 'positionLow' | 'pickColor' | 'showColorAlpha'} BufferPolygonAttribute
|
|
32
33
|
* @ignore
|
|
33
34
|
*/
|
|
34
35
|
|
|
35
36
|
/**
|
|
37
|
+
* Attribute locations when using 64-bit position precision.
|
|
36
38
|
* @type {Record<BufferPolygonAttribute, number>}
|
|
37
39
|
* @ignore
|
|
38
40
|
*/
|
|
39
|
-
const
|
|
41
|
+
const BufferPolygonAttributeLocationsFloat64 = {
|
|
40
42
|
positionHigh: 0,
|
|
41
43
|
positionLow: 1,
|
|
42
44
|
pickColor: 2,
|
|
43
|
-
|
|
45
|
+
showColorAlpha: 3,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Attribute locations when using <= 32-bit position precision.
|
|
50
|
+
* @type {Record<string, number>}
|
|
51
|
+
* @ignore
|
|
52
|
+
*/
|
|
53
|
+
const BufferPolygonAttributeLocations = {
|
|
54
|
+
position: 0,
|
|
55
|
+
pickColor: 1,
|
|
56
|
+
showColorAlpha: 2,
|
|
44
57
|
};
|
|
45
58
|
|
|
46
59
|
/**
|
|
47
60
|
* @typedef {object} BufferPolygonRenderContext
|
|
48
61
|
* @property {VertexArray} [vertexArray]
|
|
49
|
-
* @property {Record<
|
|
62
|
+
* @property {Record<string, TypedArray>} [attributeArrays]
|
|
50
63
|
* @property {TypedArray} [indexArray]
|
|
51
64
|
* @property {RenderState} [renderState]
|
|
52
65
|
* @property {ShaderProgram} [shaderProgram]
|
|
@@ -60,7 +73,7 @@ const polygon = new BufferPolygon();
|
|
|
60
73
|
const material = new BufferPolygonMaterial();
|
|
61
74
|
const pickColor = new Color();
|
|
62
75
|
const cartesian = new Cartesian3();
|
|
63
|
-
const
|
|
76
|
+
const encodedC = new EncodedCartesian3();
|
|
64
77
|
|
|
65
78
|
/**
|
|
66
79
|
* @param {BufferPolygonCollection} collection
|
|
@@ -72,6 +85,10 @@ const encodedCartesian = new EncodedCartesian3();
|
|
|
72
85
|
function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
73
86
|
const context = frameState.context;
|
|
74
87
|
renderContext = renderContext || { destroy: destroyRenderContext };
|
|
88
|
+
const useFloat64 = collection._positionDatatype === ComponentDatatype.DOUBLE;
|
|
89
|
+
const attributeLocations = useFloat64
|
|
90
|
+
? BufferPolygonAttributeLocationsFloat64
|
|
91
|
+
: BufferPolygonAttributeLocations;
|
|
75
92
|
|
|
76
93
|
if (
|
|
77
94
|
!defined(renderContext.attributeArrays) ||
|
|
@@ -86,10 +103,14 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
86
103
|
);
|
|
87
104
|
|
|
88
105
|
renderContext.attributeArrays = {
|
|
89
|
-
|
|
90
|
-
|
|
106
|
+
...(!useFloat64
|
|
107
|
+
? { position: collection._positionView }
|
|
108
|
+
: {
|
|
109
|
+
positionHigh: new Float32Array(vertexCountMax * 3),
|
|
110
|
+
positionLow: new Float32Array(vertexCountMax * 3),
|
|
111
|
+
}),
|
|
91
112
|
pickColor: new Uint8Array(vertexCountMax * 4),
|
|
92
|
-
|
|
113
|
+
showColorAlpha: new Float32Array(vertexCountMax * 3),
|
|
93
114
|
};
|
|
94
115
|
}
|
|
95
116
|
|
|
@@ -97,11 +118,11 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
97
118
|
const { attributeArrays } = renderContext;
|
|
98
119
|
const { _dirtyOffset, _dirtyCount } = collection;
|
|
99
120
|
|
|
100
|
-
const indexArray = renderContext.indexArray;
|
|
101
121
|
const positionHighArray = attributeArrays.positionHigh;
|
|
102
122
|
const positionLowArray = attributeArrays.positionLow;
|
|
123
|
+
const indexArray = renderContext.indexArray;
|
|
103
124
|
const pickColorArray = attributeArrays.pickColor;
|
|
104
|
-
const
|
|
125
|
+
const showColorAlphaArray = attributeArrays.showColorAlpha;
|
|
105
126
|
|
|
106
127
|
for (let i = _dirtyOffset, il = _dirtyOffset + _dirtyCount; i < il; i++) {
|
|
107
128
|
collection.get(i, polygon);
|
|
@@ -125,32 +146,31 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
const show = polygon.show;
|
|
128
|
-
const cartesianArray = polygon.getPositions();
|
|
149
|
+
const cartesianArray = !useFloat64 ? null : polygon.getPositions();
|
|
129
150
|
polygon.getMaterial(material);
|
|
130
151
|
const encodedColor = AttributeCompression.encodeRGB8(material.color);
|
|
131
152
|
Color.fromRgba(polygon._pickId, pickColor);
|
|
132
153
|
|
|
133
154
|
// Update vertex arrays.
|
|
134
155
|
for (let j = 0, jl = polygon.vertexCount; j < jl; j++) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
positionLowArray[vOffset * 3 + 1] = encodedCartesian.low.y;
|
|
145
|
-
positionLowArray[vOffset * 3 + 2] = encodedCartesian.low.z;
|
|
156
|
+
if (useFloat64) {
|
|
157
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
158
|
+
Cartesian3.fromArray(cartesianArray, j * 3, cartesian);
|
|
159
|
+
EncodedCartesian3.fromCartesian(cartesian, encodedC);
|
|
160
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
161
|
+
Cartesian3.pack(encodedC.high, positionHighArray, vOffset * 3);
|
|
162
|
+
// @ts-expect-error https://github.com/CesiumGS/cesium/pull/13302
|
|
163
|
+
Cartesian3.pack(encodedC.low, positionLowArray, vOffset * 3);
|
|
164
|
+
}
|
|
146
165
|
|
|
147
166
|
pickColorArray[vOffset * 4] = Color.floatToByte(pickColor.red);
|
|
148
167
|
pickColorArray[vOffset * 4 + 1] = Color.floatToByte(pickColor.green);
|
|
149
168
|
pickColorArray[vOffset * 4 + 2] = Color.floatToByte(pickColor.blue);
|
|
150
169
|
pickColorArray[vOffset * 4 + 3] = Color.floatToByte(pickColor.alpha);
|
|
151
170
|
|
|
152
|
-
|
|
153
|
-
|
|
171
|
+
showColorAlphaArray[vOffset * 3] = show ? 1 : 0;
|
|
172
|
+
showColorAlphaArray[vOffset * 3 + 1] = encodedColor;
|
|
173
|
+
showColorAlphaArray[vOffset * 3 + 2] = material.color.alpha;
|
|
154
174
|
|
|
155
175
|
vOffset++;
|
|
156
176
|
}
|
|
@@ -174,28 +194,44 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
174
194
|
}),
|
|
175
195
|
|
|
176
196
|
attributes: [
|
|
197
|
+
...(!useFloat64
|
|
198
|
+
? [
|
|
199
|
+
{
|
|
200
|
+
index: BufferPolygonAttributeLocations.position,
|
|
201
|
+
componentDatatype: collection._positionDatatype,
|
|
202
|
+
componentsPerAttribute: 3,
|
|
203
|
+
normalize: collection._positionNormalized,
|
|
204
|
+
vertexBuffer: Buffer.createVertexBuffer({
|
|
205
|
+
typedArray: attributeArrays.position,
|
|
206
|
+
context,
|
|
207
|
+
usage: BufferUsage.STATIC_DRAW,
|
|
208
|
+
}),
|
|
209
|
+
},
|
|
210
|
+
]
|
|
211
|
+
: [
|
|
212
|
+
{
|
|
213
|
+
index: BufferPolygonAttributeLocationsFloat64.positionHigh,
|
|
214
|
+
componentDatatype: ComponentDatatype.FLOAT,
|
|
215
|
+
componentsPerAttribute: 3,
|
|
216
|
+
vertexBuffer: Buffer.createVertexBuffer({
|
|
217
|
+
typedArray: attributeArrays.positionHigh,
|
|
218
|
+
context,
|
|
219
|
+
usage: BufferUsage.STATIC_DRAW,
|
|
220
|
+
}),
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
index: BufferPolygonAttributeLocationsFloat64.positionLow,
|
|
224
|
+
componentDatatype: ComponentDatatype.FLOAT,
|
|
225
|
+
componentsPerAttribute: 3,
|
|
226
|
+
vertexBuffer: Buffer.createVertexBuffer({
|
|
227
|
+
typedArray: attributeArrays.positionLow,
|
|
228
|
+
context,
|
|
229
|
+
usage: BufferUsage.STATIC_DRAW,
|
|
230
|
+
}),
|
|
231
|
+
},
|
|
232
|
+
]),
|
|
177
233
|
{
|
|
178
|
-
index:
|
|
179
|
-
componentDatatype: ComponentDatatype.FLOAT,
|
|
180
|
-
componentsPerAttribute: 3,
|
|
181
|
-
vertexBuffer: Buffer.createVertexBuffer({
|
|
182
|
-
typedArray: attributeArrays.positionHigh,
|
|
183
|
-
context,
|
|
184
|
-
usage: BufferUsage.STATIC_DRAW,
|
|
185
|
-
}),
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
index: BufferPolygonAttributeLocations.positionLow,
|
|
189
|
-
componentDatatype: ComponentDatatype.FLOAT,
|
|
190
|
-
componentsPerAttribute: 3,
|
|
191
|
-
vertexBuffer: Buffer.createVertexBuffer({
|
|
192
|
-
typedArray: attributeArrays.positionLow,
|
|
193
|
-
context,
|
|
194
|
-
usage: BufferUsage.STATIC_DRAW,
|
|
195
|
-
}),
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
index: BufferPolygonAttributeLocations.pickColor,
|
|
234
|
+
index: attributeLocations.pickColor,
|
|
199
235
|
componentDatatype: ComponentDatatype.UNSIGNED_BYTE,
|
|
200
236
|
componentsPerAttribute: 4,
|
|
201
237
|
vertexBuffer: Buffer.createVertexBuffer({
|
|
@@ -205,11 +241,11 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
205
241
|
}),
|
|
206
242
|
},
|
|
207
243
|
{
|
|
208
|
-
index:
|
|
244
|
+
index: attributeLocations.showColorAlpha,
|
|
209
245
|
componentDatatype: ComponentDatatype.FLOAT,
|
|
210
|
-
componentsPerAttribute:
|
|
246
|
+
componentsPerAttribute: 3,
|
|
211
247
|
vertexBuffer: Buffer.createVertexBuffer({
|
|
212
|
-
typedArray: attributeArrays.
|
|
248
|
+
typedArray: attributeArrays.showColorAlpha,
|
|
213
249
|
context,
|
|
214
250
|
usage: BufferUsage.STATIC_DRAW,
|
|
215
251
|
}),
|
|
@@ -226,11 +262,11 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
226
262
|
indexCount,
|
|
227
263
|
);
|
|
228
264
|
|
|
229
|
-
for (const key in
|
|
230
|
-
if (Object.hasOwn(
|
|
265
|
+
for (const key in attributeLocations) {
|
|
266
|
+
if (Object.hasOwn(attributeLocations, key)) {
|
|
231
267
|
const attribute = /** @type {BufferPolygonAttribute} */ (key);
|
|
232
268
|
renderContext.vertexArray.copyAttributeFromRange(
|
|
233
|
-
|
|
269
|
+
attributeLocations[attribute],
|
|
234
270
|
renderContext.attributeArrays[attribute],
|
|
235
271
|
vertexOffset,
|
|
236
272
|
vertexCount,
|
|
@@ -241,7 +277,10 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
241
277
|
|
|
242
278
|
if (!defined(renderContext.renderState)) {
|
|
243
279
|
renderContext.renderState = RenderState.fromCache({
|
|
244
|
-
blending:
|
|
280
|
+
blending:
|
|
281
|
+
collection._blendOption === BlendOption.OPAQUE
|
|
282
|
+
? BlendingState.DISABLED
|
|
283
|
+
: BlendingState.ALPHA_BLEND,
|
|
245
284
|
depthTest: { enabled: true },
|
|
246
285
|
});
|
|
247
286
|
}
|
|
@@ -251,11 +290,12 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
251
290
|
context,
|
|
252
291
|
vertexShaderSource: new ShaderSource({
|
|
253
292
|
sources: [BufferPolygonMaterialVS],
|
|
293
|
+
defines: useFloat64 ? ["USE_FLOAT64"] : [],
|
|
254
294
|
}),
|
|
255
295
|
fragmentShaderSource: new ShaderSource({
|
|
256
296
|
sources: [BufferPolygonMaterialFS],
|
|
257
297
|
}),
|
|
258
|
-
attributeLocations
|
|
298
|
+
attributeLocations,
|
|
259
299
|
});
|
|
260
300
|
}
|
|
261
301
|
|
|
@@ -267,12 +307,15 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
267
307
|
renderState: renderContext.renderState,
|
|
268
308
|
shaderProgram: renderContext.shaderProgram,
|
|
269
309
|
primitiveType: PrimitiveType.TRIANGLES,
|
|
270
|
-
pass:
|
|
310
|
+
pass:
|
|
311
|
+
collection._blendOption === BlendOption.OPAQUE
|
|
312
|
+
? Pass.OPAQUE
|
|
313
|
+
: Pass.TRANSLUCENT,
|
|
271
314
|
pickId: collection._allowPicking ? "v_pickColor" : undefined,
|
|
272
315
|
owner: collection,
|
|
273
316
|
count: drawCount,
|
|
274
317
|
modelMatrix: collection.modelMatrix, // shared reference
|
|
275
|
-
boundingVolume: collection.
|
|
318
|
+
boundingVolume: collection.boundingVolume, // shared reference
|
|
276
319
|
debugShowBoundingVolume: collection.debugShowBoundingVolume,
|
|
277
320
|
});
|
|
278
321
|
}
|