@cesium/engine 21.0.1 → 22.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/ThirdParty/Workers/zip-web-worker.js +10 -7
- package/Build/Workers/chunk-23T2IPHV.js +55 -0
- package/Build/Workers/{chunk-TGJQMEL4.js → chunk-2AM4E2WD.js} +2 -2
- package/Build/Workers/{chunk-4CORGH7N.js → chunk-2MWF4IES.js} +16 -14
- package/Build/Workers/{chunk-3RKX3UFI.js → chunk-2RCIRXNI.js} +1 -1
- package/Build/Workers/{chunk-LV3G32QE.js → chunk-3YTMGEXW.js} +5 -1424
- package/Build/Workers/{chunk-PJAA7QSC.js → chunk-4BHWJWS3.js} +6 -6
- package/Build/Workers/{chunk-FE565QHX.js → chunk-5JKH4AMT.js} +2 -2
- package/Build/Workers/{chunk-KZ7GDSAJ.js → chunk-6HKAPCSO.js} +1 -1
- package/Build/Workers/{chunk-VVALNLSH.js → chunk-A53R2F2L.js} +4 -4
- package/Build/Workers/{chunk-KVB73ECP.js → chunk-A6YFUGJO.js} +7 -7
- package/Build/Workers/{chunk-QNOIRRJK.js → chunk-AJYWXC6I.js} +4 -4
- package/Build/Workers/{chunk-UKA7OISV.js → chunk-AOIO5VUS.js} +282 -2284
- package/Build/Workers/{chunk-OBS5EMZ6.js → chunk-B7JRBTT6.js} +10 -10
- package/Build/Workers/{chunk-5YXA47QD.js → chunk-CHNDJRYA.js} +20 -18
- package/Build/Workers/{chunk-X3ZV3XNO.js → chunk-CJOV55CW.js} +20 -18
- package/Build/Workers/{chunk-W6I3LNPF.js → chunk-COGPE5Z2.js} +10 -8
- package/Build/Workers/{chunk-2QPH5QDK.js → chunk-CW7W27IZ.js} +14 -10
- package/Build/Workers/{chunk-MXOGBWMP.js → chunk-DICY26ID.js} +20 -16
- package/Build/Workers/{chunk-W6KMV4F5.js → chunk-DMEFNTUV.js} +69 -7
- package/Build/Workers/{chunk-T7HU6E7G.js → chunk-DQSJEOZY.js} +1 -1
- package/Build/Workers/{chunk-ASVODZNK.js → chunk-GDU4RZSZ.js} +16 -36
- package/Build/Workers/{chunk-MQPDOWGH.js → chunk-GKWOUMYA.js} +1 -1
- package/Build/Workers/{chunk-A2SP2EJZ.js → chunk-GTY4K4IA.js} +9 -7
- package/Build/Workers/{chunk-KEPPNSBL.js → chunk-H6Q7E4BQ.js} +8 -6
- package/Build/Workers/{chunk-JG3C3LPY.js → chunk-HHGOFZVQ.js} +7 -5
- package/Build/Workers/chunk-HXKUEOOD.js +352 -0
- package/Build/Workers/{chunk-UFSYRVC5.js → chunk-I4REFVXB.js} +4 -4
- package/Build/Workers/{chunk-LU7DLY2L.js → chunk-IL5F6WEE.js} +3 -3
- package/Build/Workers/{chunk-RVRN4KDB.js → chunk-JKXPC5HD.js} +2 -2
- package/Build/Workers/{chunk-CBPNIEGH.js → chunk-KKGD7HAW.js} +13 -11
- package/Build/Workers/{chunk-DTKSVIH5.js → chunk-KROSQJUA.js} +2 -2
- package/Build/Workers/{chunk-42EJCSIV.js → chunk-L4JLDVCM.js} +5 -5
- package/Build/Workers/{chunk-LPKJSIMD.js → chunk-LIYMRHGR.js} +15 -13
- package/Build/Workers/{chunk-J2XQVKVH.js → chunk-MKMZHRB3.js} +74 -35
- package/Build/Workers/{chunk-CSDYSXBI.js → chunk-MO25ZQ2I.js} +14 -12
- package/Build/Workers/{chunk-3YNW5K6O.js → chunk-O6RZEKHZ.js} +12 -12
- package/Build/Workers/{chunk-RR3NCT4R.js → chunk-OOCGX2OD.js} +4 -4
- package/Build/Workers/{chunk-XG54SG4O.js → chunk-OXFU5HNU.js} +13 -5
- package/Build/Workers/{chunk-P2UKEFCK.js → chunk-P5CGIJUY.js} +2 -2
- package/Build/Workers/{chunk-DBHL2UVG.js → chunk-QEANVUGT.js} +2 -2
- package/Build/Workers/{chunk-2SI7DEW5.js → chunk-QFBCIX7J.js} +8 -6
- package/Build/Workers/{chunk-DDXI6UYW.js → chunk-QUAH3XOT.js} +4 -4
- package/Build/Workers/{chunk-PZUZCAX3.js → chunk-RXZDTDIY.js} +13 -9
- package/Build/Workers/{chunk-YZ3RCE45.js → chunk-SPA2KPH3.js} +14 -12
- package/Build/Workers/chunk-TDSVSW5A.js +1460 -0
- package/Build/Workers/{chunk-G3CKZ34K.js → chunk-UG2DPFOL.js} +8 -6
- package/Build/Workers/{chunk-IKUOV6DO.js → chunk-URGEDZBS.js} +7 -7
- package/Build/Workers/{chunk-U2GR5FDL.js → chunk-V35NQOJC.js} +21 -11
- package/Build/Workers/chunk-W4XUEDU5.js +2058 -0
- package/Build/Workers/chunk-WB4TSSBQ.js +3514 -0
- package/Build/Workers/{chunk-EBDZDBJN.js → chunk-WTLYD4FE.js} +19 -15
- package/Build/Workers/{chunk-WQZL6CA2.js → chunk-Y4ALZ4SS.js} +9 -7
- package/Build/Workers/{chunk-DAJKOQW6.js → chunk-YF2NVO5B.js} +19 -13
- package/Build/Workers/{chunk-XJVRYJVZ.js → chunk-YSYSXSHF.js} +1 -1
- package/Build/Workers/{chunk-YNOVMSUX.js → chunk-YX562XOB.js} +15 -11
- package/Build/Workers/{chunk-J3KPR6DJ.js → chunk-YZWA5B4R.js} +15 -13
- package/Build/Workers/{chunk-NYYQZ3LH.js → chunk-Z6DFT4D3.js} +15 -11
- package/Build/Workers/combineGeometry.js +24 -21
- package/Build/Workers/createBoxGeometry.js +18 -15
- package/Build/Workers/createBoxOutlineGeometry.js +16 -13
- package/Build/Workers/createCircleGeometry.js +28 -24
- package/Build/Workers/createCircleOutlineGeometry.js +21 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +35 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -29
- package/Build/Workers/createCorridorGeometry.js +32 -28
- package/Build/Workers/createCorridorOutlineGeometry.js +30 -26
- package/Build/Workers/createCylinderGeometry.js +20 -17
- package/Build/Workers/createCylinderOutlineGeometry.js +20 -16
- package/Build/Workers/createEllipseGeometry.js +28 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +21 -17
- package/Build/Workers/createEllipsoidGeometry.js +19 -16
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -15
- package/Build/Workers/createFrustumGeometry.js +18 -15
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -15
- package/Build/Workers/createGeometry.js +28 -22
- package/Build/Workers/createGroundPolylineGeometry.js +25 -21
- package/Build/Workers/createPlaneGeometry.js +16 -13
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -12
- package/Build/Workers/createPolygonGeometry.js +35 -31
- package/Build/Workers/createPolygonOutlineGeometry.js +32 -28
- package/Build/Workers/createPolylineGeometry.js +27 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +33 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +29 -25
- package/Build/Workers/createRectangleGeometry.js +30 -26
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -19
- package/Build/Workers/createSimplePolylineGeometry.js +25 -21
- package/Build/Workers/createSphereGeometry.js +19 -16
- package/Build/Workers/createSphereOutlineGeometry.js +18 -15
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +16 -13
- package/Build/Workers/createVectorTileGeometries.js +24 -21
- package/Build/Workers/createVectorTilePoints.js +15 -12
- package/Build/Workers/createVectorTilePolygons.js +24 -20
- package/Build/Workers/createVectorTilePolylines.js +16 -13
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +28 -23
- package/Build/Workers/createVerticesFromHeightmap.js +28 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -279
- package/Build/Workers/createWallGeometry.js +26 -22
- package/Build/Workers/createWallOutlineGeometry.js +25 -21
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +13 -11
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -20
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +2 -2
- package/Source/Core/AxisAlignedBoundingBox.js +36 -0
- package/Source/Core/Cesium3DTilesTerrainData.js +932 -0
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +1868 -0
- package/Source/Core/Cesium3DTilesTerrainProvider.js +1052 -0
- package/Source/Core/CesiumTerrainProvider.js +2 -2
- package/Source/Core/Color.js +23 -6
- package/Source/Core/EllipsoidalOccluder.js +2 -2
- package/Source/Core/FeatureDetection.js +0 -2
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +1 -1
- package/Source/Core/GoogleEarthEnterpriseTerrainData.js +2 -1
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
- package/Source/Core/HeightmapTerrainData.js +12 -22
- package/Source/Core/HilbertOrder.js +0 -6
- package/Source/Core/ITwinPlatform.js +6 -6
- package/Source/Core/IntersectionTests.js +80 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +35 -27
- package/Source/Core/PixelFormat.js +2 -2
- package/Source/Core/QuantizedMeshTerrainData.js +24 -57
- package/Source/Core/Resource.js +15 -11
- package/Source/Core/S2Cell.js +6 -18
- package/Source/Core/TaskProcessor.js +1 -1
- package/Source/Core/TerrainData.js +2 -1
- package/Source/Core/TerrainEncoding.js +215 -38
- package/Source/Core/TerrainMesh.js +215 -8
- package/Source/Core/TerrainPicker.js +607 -0
- package/Source/Core/TerrainProvider.js +151 -0
- package/Source/Core/TexturePacker.js +27 -12
- package/Source/Core/Transforms.js +28 -19
- package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
- package/Source/Core/binarySearch.js +1 -1
- package/Source/Core/createWorldBathymetryAsync.js +2 -2
- package/Source/Core/createWorldTerrainAsync.js +3 -3
- package/Source/Core/loadImageFromTypedArray.js +9 -3
- package/Source/Core/mergeSort.js +1 -1
- package/Source/DataSources/BillboardGraphics.js +1 -1
- package/Source/DataSources/BillboardVisualizer.js +7 -4
- package/Source/DataSources/PropertyArray.js +2 -2
- package/Source/Renderer/AutomaticUniforms.js +61 -0
- package/Source/Renderer/Buffer.js +32 -0
- package/Source/Renderer/BufferUsage.js +3 -1
- package/Source/Renderer/Context.js +98 -14
- package/Source/Renderer/Pass.js +10 -9
- package/Source/Renderer/Sync.js +104 -0
- package/Source/Renderer/TextureAtlas.js +67 -27
- package/Source/Renderer/UniformState.js +12 -0
- package/Source/Renderer/VertexArray.js +1 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +1 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Azure2DImageryProvider.js +99 -13
- package/Source/Scene/BatchTable.js +2 -2
- package/Source/Scene/Billboard.js +75 -28
- package/Source/Scene/BillboardCollection.js +24 -15
- package/Source/Scene/BillboardTexture.js +56 -7
- package/Source/Scene/BingMapsImageryProvider.js +1 -1
- package/Source/Scene/BoundingVolumeSemantics.js +54 -62
- package/Source/Scene/Cesium3DTile.js +3 -3
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/EdgeFramebuffer.js +245 -0
- package/Source/Scene/FrameState.js +12 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +12 -16
- package/Source/Scene/GaussianSplatPrimitive.js +12 -8
- package/Source/Scene/GaussianSplatSorter.js +2 -2
- package/Source/Scene/Globe.js +4 -2
- package/Source/Scene/GlobeSurfaceTile.js +28 -70
- package/Source/Scene/GlobeSurfaceTileProvider.js +11 -0
- package/Source/Scene/GltfBufferViewLoader.js +18 -0
- package/Source/Scene/GltfLoader.js +46 -8
- package/Source/Scene/Google2DImageryProvider.js +48 -41
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SDecoder.js +3 -3
- package/Source/Scene/ITwinData.js +4 -4
- package/Source/Scene/ImageryLayer.js +1 -1
- package/Source/Scene/Implicit3DTileContent.js +18 -7
- package/Source/Scene/ImplicitSubtree.js +3 -3
- package/Source/Scene/ImplicitTileset.js +2 -2
- package/Source/Scene/IonImageryProvider.js +15 -84
- package/Source/Scene/IonImageryProviderFactory.js +194 -0
- package/Source/Scene/LabelCollection.js +54 -36
- package/Source/Scene/MetadataComponentType.js +5 -5
- package/Source/Scene/MetadataTableProperty.js +3 -9
- package/Source/Scene/Model/EdgeDetectionPipelineStage.js +42 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +800 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +7 -7
- package/Source/Scene/Model/ModelDrawCommand.js +69 -0
- package/Source/Scene/Model/ModelImagery.js +4 -0
- package/Source/Scene/Model/ModelRuntimeNode.js +2 -2
- package/Source/Scene/Model/ModelRuntimePrimitive.js +13 -2
- package/Source/Scene/Model/ModelSceneGraph.js +15 -3
- package/Source/Scene/Model/ModelUtility.js +0 -1
- package/Source/Scene/Model/NodeRenderResources.js +1 -1
- package/Source/Scene/Model/PrimitiveRenderResources.js +1 -1
- package/Source/Scene/OIT.js +11 -1
- package/Source/Scene/PickFramebuffer.js +134 -50
- package/Source/Scene/Picking.js +195 -89
- package/Source/Scene/QuadtreePrimitive.js +34 -26
- package/Source/Scene/QuadtreeTile.js +66 -46
- package/Source/Scene/ResourceLoaderState.js +1 -1
- package/Source/Scene/Scene.js +160 -16
- package/Source/Scene/ScreenSpaceCameraController.js +1 -1
- package/Source/Scene/SensorVolumePortionToDisplay.js +6 -6
- package/Source/Scene/SingleTileImageryProvider.js +3 -3
- package/Source/Scene/Terrain.js +5 -5
- package/Source/Scene/TerrainFillMesh.js +1 -0
- package/Source/Scene/TileMapServiceImageryProvider.js +2 -2
- package/Source/Scene/UrlTemplateImageryProvider.js +1 -1
- package/Source/Scene/View.js +3 -0
- package/Source/Scene/VoxelPrimitive.js +196 -189
- package/Source/Scene/VoxelShape.js +2 -0
- package/Source/Scene/createWorldImageryAsync.js +1 -1
- package/Source/Shaders/BillboardCollectionFS.glsl +115 -62
- package/Source/Shaders/BillboardCollectionFS.js +115 -63
- package/Source/Shaders/BillboardCollectionVS.glsl +44 -37
- package/Source/Shaders/BillboardCollectionVS.js +45 -38
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.glsl +10 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/GlobeVS.glsl +1 -1
- package/Source/Shaders/GlobeVS.js +1 -1
- package/Source/Shaders/Model/EdgeDetectionStageFS.glsl +58 -0
- package/Source/Shaders/Model/EdgeDetectionStageFS.js +60 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +83 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +85 -0
- package/Source/Shaders/Model/ModelFS.glsl +5 -0
- package/Source/Shaders/Model/ModelFS.js +5 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +0 -1
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
- package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +7 -15
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
- package/Source/Workers/incrementallyBuildTerrainPicker.js +108 -0
- package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
- package/index.d.ts +488 -31
- package/index.js +202 -190
- package/package.json +3 -2
|
@@ -12,89 +12,85 @@ const BoundingVolumeSemantics = {};
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Parse the bounding volume-related semantics such as
|
|
15
|
-
* <code>TILE_BOUNDING_BOX</code> and <code>
|
|
16
|
-
* implicit tile metadata. Results are returned as a JSON object for
|
|
17
|
-
* transcoding tiles (see {@link Implicit3DTileContent}).
|
|
15
|
+
* <code>TILE_BOUNDING_BOX</code> and <code>CONTENT_BOUNDING_BOX</code> from
|
|
16
|
+
* implicit tile or content metadata. Results are returned as a JSON object for
|
|
17
|
+
* use when transcoding tiles (see {@link Implicit3DTileContent}).
|
|
18
18
|
* <p>
|
|
19
19
|
* Bounding volumes are checked in the order box, region, then sphere. Only
|
|
20
20
|
* the first valid bounding volume is returned.
|
|
21
21
|
* </p>
|
|
22
|
+
* <p>
|
|
23
|
+
* This handles both tile and content bounding volumes, as the only difference
|
|
24
|
+
* is the prefix. e.g. <code>TILE_BOUNDING_BOX</code> and
|
|
25
|
+
* <code>CONTENT_BOUNDING_BOX</code> have the same memory layout.
|
|
26
|
+
* </p>
|
|
22
27
|
*
|
|
23
28
|
* @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata/Semantics|3D Metadata Semantic Reference} for the various bounding volumes and minimum/maximum heights.
|
|
24
29
|
*
|
|
25
|
-
* @param {
|
|
26
|
-
* @
|
|
30
|
+
* @param {string} prefix Either "TILE" or "CONTENT"
|
|
31
|
+
* @param {TileMetadata|ContentMetadata} metadata The metadata object for looking up values by semantic. In practice, this will typically be a {@link ImplicitMetadataView}
|
|
32
|
+
* @return {object} An object containing the bounding volume, and any minimum or maximum height.
|
|
27
33
|
*
|
|
28
34
|
* @private
|
|
29
35
|
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
|
|
30
36
|
*/
|
|
31
37
|
BoundingVolumeSemantics.parseAllBoundingVolumeSemantics = function (
|
|
32
|
-
|
|
38
|
+
prefix,
|
|
39
|
+
metadata,
|
|
33
40
|
) {
|
|
34
41
|
//>>includeStart('debug', pragmas.debug);
|
|
35
|
-
Check.typeOf.
|
|
42
|
+
Check.typeOf.string("prefix", prefix);
|
|
43
|
+
if (prefix !== "TILE" && prefix !== "CONTENT") {
|
|
44
|
+
throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
|
|
45
|
+
}
|
|
46
|
+
Check.typeOf.object("metadata", metadata);
|
|
36
47
|
//>>includeEnd('debug');
|
|
37
48
|
|
|
38
49
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
),
|
|
52
|
-
},
|
|
53
|
-
content: {
|
|
54
|
-
boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(
|
|
55
|
-
"CONTENT",
|
|
56
|
-
tileMetadata,
|
|
57
|
-
),
|
|
58
|
-
minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(
|
|
59
|
-
"CONTENT",
|
|
60
|
-
tileMetadata,
|
|
61
|
-
),
|
|
62
|
-
maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(
|
|
63
|
-
"CONTENT",
|
|
64
|
-
tileMetadata,
|
|
65
|
-
),
|
|
66
|
-
},
|
|
50
|
+
boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(
|
|
51
|
+
prefix,
|
|
52
|
+
metadata,
|
|
53
|
+
),
|
|
54
|
+
minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(
|
|
55
|
+
prefix,
|
|
56
|
+
metadata,
|
|
57
|
+
),
|
|
58
|
+
maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(
|
|
59
|
+
prefix,
|
|
60
|
+
metadata,
|
|
61
|
+
),
|
|
67
62
|
};
|
|
68
63
|
};
|
|
69
64
|
|
|
70
65
|
/**
|
|
71
|
-
* Parse the bounding volume from
|
|
72
|
-
* multiple bounding volumes, only the first one is returned. Bounding
|
|
73
|
-
* are checked in the order box, region, then sphere.
|
|
74
|
-
*
|
|
66
|
+
* Parse the bounding volume from tile or content metadata. If the metadata
|
|
67
|
+
* specify multiple bounding volumes, only the first one is returned. Bounding
|
|
68
|
+
* volumes are checked in the order box, region, then sphere.
|
|
69
|
+
* <p>
|
|
75
70
|
* This handles both tile and content bounding volumes, as the only difference
|
|
76
71
|
* is the prefix. e.g. <code>TILE_BOUNDING_BOX</code> and
|
|
77
72
|
* <code>CONTENT_BOUNDING_BOX</code> have the same memory layout.
|
|
73
|
+
* </p>
|
|
78
74
|
*
|
|
79
75
|
* @param {string} prefix Either "TILE" or "CONTENT"
|
|
80
|
-
* @param {TileMetadata}
|
|
81
|
-
* @return {object} An object representing the JSON description of the tile
|
|
76
|
+
* @param {TileMetadata|ContentMetadata} metadata The metadata for looking up values
|
|
77
|
+
* @return {object} An object representing the JSON description of the tile or content bounding volume
|
|
82
78
|
* @private
|
|
83
79
|
*/
|
|
84
80
|
BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
|
|
85
81
|
prefix,
|
|
86
|
-
|
|
82
|
+
metadata,
|
|
87
83
|
) {
|
|
88
84
|
//>>includeStart('debug', pragmas.debug);
|
|
89
85
|
Check.typeOf.string("prefix", prefix);
|
|
90
86
|
if (prefix !== "TILE" && prefix !== "CONTENT") {
|
|
91
87
|
throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
|
|
92
88
|
}
|
|
93
|
-
Check.typeOf.object("
|
|
89
|
+
Check.typeOf.object("metadata", metadata);
|
|
94
90
|
//>>includeEnd('debug');
|
|
95
91
|
|
|
96
92
|
const boundingBoxSemantic = `${prefix}_BOUNDING_BOX`;
|
|
97
|
-
const boundingBox =
|
|
93
|
+
const boundingBox = metadata.getPropertyBySemantic(boundingBoxSemantic);
|
|
98
94
|
|
|
99
95
|
if (defined(boundingBox)) {
|
|
100
96
|
return {
|
|
@@ -103,9 +99,7 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
|
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
const boundingRegionSemantic = `${prefix}_BOUNDING_REGION`;
|
|
106
|
-
const boundingRegion =
|
|
107
|
-
boundingRegionSemantic,
|
|
108
|
-
);
|
|
102
|
+
const boundingRegion = metadata.getPropertyBySemantic(boundingRegionSemantic);
|
|
109
103
|
|
|
110
104
|
if (defined(boundingRegion)) {
|
|
111
105
|
return {
|
|
@@ -114,9 +108,7 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
|
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
const boundingSphereSemantic = `${prefix}_BOUNDING_SPHERE`;
|
|
117
|
-
const boundingSphere =
|
|
118
|
-
boundingSphereSemantic,
|
|
119
|
-
);
|
|
111
|
+
const boundingSphere = metadata.getPropertyBySemantic(boundingSphereSemantic);
|
|
120
112
|
|
|
121
113
|
if (defined(boundingSphere)) {
|
|
122
114
|
// ARRAY with 4 elements is automatically converted to a Cartesian4
|
|
@@ -129,49 +121,49 @@ BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
|
|
|
129
121
|
};
|
|
130
122
|
|
|
131
123
|
/**
|
|
132
|
-
* Parse the minimum height from tile metadata. This is used for making
|
|
133
|
-
* quadtree bounds for implicit tiling. This works for both
|
|
124
|
+
* Parse the minimum height from tile or content metadata. This is used for making
|
|
125
|
+
* tighter quadtree bounds for implicit tiling. This works for both
|
|
134
126
|
* <code>TILE_MINIMUM_HEIGHT</code> and <code>CONTENT_MINIMUM_HEIGHT</code>
|
|
135
127
|
*
|
|
136
128
|
* @param {string} prefix Either "TILE" or "CONTENT"
|
|
137
|
-
* @param {TileMetadata}
|
|
129
|
+
* @param {TileMetadata|ContentMetadata} metadata The metadata for looking up values
|
|
138
130
|
* @return {number} The minimum height
|
|
139
131
|
* @private
|
|
140
132
|
*/
|
|
141
|
-
BoundingVolumeSemantics._parseMinimumHeight = function (prefix,
|
|
133
|
+
BoundingVolumeSemantics._parseMinimumHeight = function (prefix, metadata) {
|
|
142
134
|
//>>includeStart('debug', pragmas.debug);
|
|
143
135
|
Check.typeOf.string("prefix", prefix);
|
|
144
136
|
if (prefix !== "TILE" && prefix !== "CONTENT") {
|
|
145
137
|
throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
|
|
146
138
|
}
|
|
147
|
-
Check.typeOf.object("
|
|
139
|
+
Check.typeOf.object("metadata", metadata);
|
|
148
140
|
//>>includeEnd('debug');
|
|
149
141
|
|
|
150
142
|
const minimumHeightSemantic = `${prefix}_MINIMUM_HEIGHT`;
|
|
151
|
-
return
|
|
143
|
+
return metadata.getPropertyBySemantic(minimumHeightSemantic);
|
|
152
144
|
};
|
|
153
145
|
|
|
154
146
|
/**
|
|
155
|
-
* Parse the maximum height from tile metadata. This is used for
|
|
156
|
-
* quadtree bounds for implicit tiling. This works for both
|
|
147
|
+
* Parse the maximum height from tile or content metadata. This is used for
|
|
148
|
+
* making tighter quadtree bounds for implicit tiling. This works for both
|
|
157
149
|
* <code>TILE_MAXIMUM_HEIGHT</code> and <code>CONTENT_MAXIMUM_HEIGHT</code>
|
|
158
150
|
*
|
|
159
151
|
* @param {string} prefix Either "TILE" or "CONTENT"
|
|
160
|
-
* @param {TileMetadata}
|
|
152
|
+
* @param {TileMetadata|ContentMetadata} metadata The metadata for looking up values
|
|
161
153
|
* @return {number} The maximum height
|
|
162
154
|
* @private
|
|
163
155
|
*/
|
|
164
|
-
BoundingVolumeSemantics._parseMaximumHeight = function (prefix,
|
|
156
|
+
BoundingVolumeSemantics._parseMaximumHeight = function (prefix, metadata) {
|
|
165
157
|
//>>includeStart('debug', pragmas.debug);
|
|
166
158
|
Check.typeOf.string("prefix", prefix);
|
|
167
159
|
if (prefix !== "TILE" && prefix !== "CONTENT") {
|
|
168
160
|
throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
|
|
169
161
|
}
|
|
170
|
-
Check.typeOf.object("
|
|
162
|
+
Check.typeOf.object("metadata", metadata);
|
|
171
163
|
//>>includeEnd('debug');
|
|
172
164
|
|
|
173
165
|
const maximumHeightSemantic = `${prefix}_MAXIMUM_HEIGHT`;
|
|
174
|
-
return
|
|
166
|
+
return metadata.getPropertyBySemantic(maximumHeightSemantic);
|
|
175
167
|
};
|
|
176
168
|
|
|
177
169
|
export default BoundingVolumeSemantics;
|
|
@@ -795,7 +795,7 @@ const scratchCartesian = new Cartesian3();
|
|
|
795
795
|
* @private
|
|
796
796
|
* @param {Cesium3DTile} tile
|
|
797
797
|
* @param {FrameState} frameState
|
|
798
|
-
* @returns {
|
|
798
|
+
* @returns {boolean}
|
|
799
799
|
*/
|
|
800
800
|
function isPriorityDeferred(tile, frameState) {
|
|
801
801
|
const { tileset, boundingSphere } = tile;
|
|
@@ -905,7 +905,7 @@ const scratchJulianDate = new JulianDate();
|
|
|
905
905
|
*
|
|
906
906
|
* @private
|
|
907
907
|
* @param {FrameState} frameState
|
|
908
|
-
* @param {
|
|
908
|
+
* @param {boolean} useParentGeometricError
|
|
909
909
|
* @param {number} progressiveResolutionHeightFraction
|
|
910
910
|
*/
|
|
911
911
|
Cesium3DTile.prototype.getScreenSpaceError = function (
|
|
@@ -964,7 +964,7 @@ Cesium3DTile.prototype.getScreenSpaceError = function (
|
|
|
964
964
|
* @private
|
|
965
965
|
* @param {Cesium3DTileset} tileset
|
|
966
966
|
* @param {Cesium3DTile} tile
|
|
967
|
-
* @returns {
|
|
967
|
+
* @returns {boolean}
|
|
968
968
|
*/
|
|
969
969
|
function isPriorityProgressiveResolution(tileset, tile) {
|
|
970
970
|
if (
|
|
@@ -25,7 +25,7 @@ import CesiumMath from "../Core/Math.js";
|
|
|
25
25
|
import Quaternion from "../Core/Quaternion.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* @typedef {
|
|
28
|
+
* @typedef {object} Cesium3DTilesVoxelProvider.ConstructorOptions
|
|
29
29
|
*
|
|
30
30
|
* Initialization options for the Cesium3DTilesVoxelProvider constructor
|
|
31
31
|
*
|
|
@@ -65,7 +65,7 @@ import DynamicEnvironmentMapManager from "./DynamicEnvironmentMapManager.js";
|
|
|
65
65
|
import ImageryLayerCollection from "./ImageryLayerCollection.js";
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* @typedef {
|
|
68
|
+
* @typedef {object} Cesium3DTileset.ConstructorOptions
|
|
69
69
|
*
|
|
70
70
|
* Initialization options for the Cesium3DTileset constructor
|
|
71
71
|
*
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import defined from "../Core/defined.js";
|
|
2
|
+
import destroyObject from "../Core/destroyObject.js";
|
|
3
|
+
import PixelFormat from "../Core/PixelFormat.js";
|
|
4
|
+
import Color from "../Core/Color.js";
|
|
5
|
+
import PixelDatatype from "../Renderer/PixelDatatype.js";
|
|
6
|
+
import FramebufferManager from "../Renderer/FramebufferManager.js";
|
|
7
|
+
import ClearCommand from "../Renderer/ClearCommand.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Creates and manages framebuffers for edge visibility rendering.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} options Object with the following properties:
|
|
13
|
+
*
|
|
14
|
+
* @alias EdgeFramebuffer
|
|
15
|
+
* @constructor
|
|
16
|
+
*
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
function EdgeFramebuffer(options) {
|
|
20
|
+
options = options || {};
|
|
21
|
+
|
|
22
|
+
// Create framebuffer manager with multiple render targets (MRT)
|
|
23
|
+
// Color attachment 0: edge color output (visualization / debug)
|
|
24
|
+
// Color attachment 1: R: edge type, G: featureId (metadata / ids)
|
|
25
|
+
// Color attachment 2: packed depth (czm_packDepth) for edge fragments
|
|
26
|
+
this._framebufferManager = new FramebufferManager({
|
|
27
|
+
colorAttachmentsLength: 3, // MRT: Color + ID + Depth (packed RGBA)
|
|
28
|
+
createColorAttachments: true,
|
|
29
|
+
depthStencil: true,
|
|
30
|
+
supportsDepthTexture: true,
|
|
31
|
+
color: true,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
this._framebuffer = undefined;
|
|
35
|
+
this._colorTexture = undefined;
|
|
36
|
+
this._idTexture = undefined;
|
|
37
|
+
this._depthTexture = undefined; // packed depth color attachment (location = 2)
|
|
38
|
+
this._depthStencilTexture = undefined;
|
|
39
|
+
|
|
40
|
+
this._clearCommand = new ClearCommand({
|
|
41
|
+
color: new Color(0.0, 0.0, 0.0, 0.0),
|
|
42
|
+
depth: 1.0,
|
|
43
|
+
stencil: 0,
|
|
44
|
+
owner: this,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Object.defineProperties(EdgeFramebuffer.prototype, {
|
|
49
|
+
/**
|
|
50
|
+
* Gets the framebuffer for edge rendering.
|
|
51
|
+
* @memberof EdgeFramebuffer.prototype
|
|
52
|
+
* @type {Framebuffer}
|
|
53
|
+
* @readonly
|
|
54
|
+
*/
|
|
55
|
+
framebuffer: {
|
|
56
|
+
get: function () {
|
|
57
|
+
return this._framebuffer;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Gets the color texture.
|
|
63
|
+
* @memberof EdgeFramebuffer.prototype
|
|
64
|
+
* @type {Texture}
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
colorTexture: {
|
|
68
|
+
get: function () {
|
|
69
|
+
return this._colorTexture;
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets the ID texture.
|
|
75
|
+
* @memberof EdgeFramebuffer.prototype
|
|
76
|
+
* @type {Texture}
|
|
77
|
+
* @readonly
|
|
78
|
+
*/
|
|
79
|
+
idTexture: {
|
|
80
|
+
get: function () {
|
|
81
|
+
return this._idTexture;
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Gets the packed depth texture written during the edge pass.
|
|
87
|
+
* @memberof EdgeFramebuffer.prototype
|
|
88
|
+
* @type {Texture}
|
|
89
|
+
* @readonly
|
|
90
|
+
*/
|
|
91
|
+
depthTexture: {
|
|
92
|
+
get: function () {
|
|
93
|
+
return this._depthTexture;
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Gets the depth-stencil texture.
|
|
99
|
+
* @memberof EdgeFramebuffer.prototype
|
|
100
|
+
* @type {Texture}
|
|
101
|
+
* @readonly
|
|
102
|
+
*/
|
|
103
|
+
depthStencilTexture: {
|
|
104
|
+
get: function () {
|
|
105
|
+
return this._depthStencilTexture;
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Updates the framebuffer.
|
|
112
|
+
*
|
|
113
|
+
* @param {Context} context The context.
|
|
114
|
+
* @param {Viewport} viewport The viewport.
|
|
115
|
+
* @param {boolean} hdr Whether HDR is enabled.
|
|
116
|
+
* @param {Texture} [existingColorTexture] Optional existing color texture to reuse.
|
|
117
|
+
* @param {Texture} [existingDepthTexture] Optional existing depth texture to reuse.
|
|
118
|
+
*
|
|
119
|
+
* @returns {boolean} True if the framebuffer was updated; otherwise, false.
|
|
120
|
+
*/
|
|
121
|
+
EdgeFramebuffer.prototype.update = function (
|
|
122
|
+
context,
|
|
123
|
+
viewport,
|
|
124
|
+
hdr,
|
|
125
|
+
existingColorTexture,
|
|
126
|
+
existingDepthTexture,
|
|
127
|
+
) {
|
|
128
|
+
const width = viewport.width;
|
|
129
|
+
const height = viewport.height;
|
|
130
|
+
|
|
131
|
+
const pixelDatatype = hdr
|
|
132
|
+
? context.halfFloatingPointTexture
|
|
133
|
+
? PixelDatatype.HALF_FLOAT
|
|
134
|
+
: PixelDatatype.FLOAT
|
|
135
|
+
: PixelDatatype.UNSIGNED_BYTE;
|
|
136
|
+
|
|
137
|
+
const changed = this._framebufferManager.update(
|
|
138
|
+
context,
|
|
139
|
+
width,
|
|
140
|
+
height,
|
|
141
|
+
1, // No MSAA
|
|
142
|
+
pixelDatatype,
|
|
143
|
+
PixelFormat.RGBA,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
// Always assign framebuffer if FramebufferManager has one
|
|
147
|
+
if (this._framebufferManager.framebuffer) {
|
|
148
|
+
this._framebuffer = this._framebufferManager.framebuffer;
|
|
149
|
+
|
|
150
|
+
// Get the textures from the framebuffer manager or use existing ones
|
|
151
|
+
this._colorTexture = defined(existingColorTexture)
|
|
152
|
+
? existingColorTexture
|
|
153
|
+
: this._framebufferManager.getColorTexture(0); // Color attachment 0
|
|
154
|
+
this._idTexture = this._framebufferManager.getColorTexture(1); // Color attachment 1: ID texture
|
|
155
|
+
this._depthTexture = this._framebufferManager.getColorTexture(2); // Color attachment 2: packed depth
|
|
156
|
+
this._depthStencilTexture = defined(existingDepthTexture)
|
|
157
|
+
? existingDepthTexture
|
|
158
|
+
: this._framebufferManager.getDepthStencilTexture();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return changed;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Clears the framebuffer using ClearCommand.
|
|
166
|
+
* @deprecated Use getClearCommand() instead for proper MRT clearing.
|
|
167
|
+
*
|
|
168
|
+
* @param {Context} context The context.
|
|
169
|
+
* @param {PassState} passState The pass state.
|
|
170
|
+
* @param {Color} clearColor The clear color.
|
|
171
|
+
*/
|
|
172
|
+
EdgeFramebuffer.prototype.clear = function (context, passState, clearColor) {
|
|
173
|
+
const clearCommand = this.getClearCommand(clearColor);
|
|
174
|
+
clearCommand.execute(context, passState);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Gets the clear command for this framebuffer.
|
|
179
|
+
*
|
|
180
|
+
* @param {Color} [clearColor] The clear color to use. If undefined, uses the default.
|
|
181
|
+
* @returns {ClearCommand} The clear command.
|
|
182
|
+
*/
|
|
183
|
+
EdgeFramebuffer.prototype.getClearCommand = function (clearColor) {
|
|
184
|
+
this._clearCommand.framebuffer = this._framebuffer;
|
|
185
|
+
|
|
186
|
+
if (defined(clearColor)) {
|
|
187
|
+
Color.clone(clearColor, this._clearCommand.color);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return this._clearCommand;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Gets the edge framebuffer, creating it if necessary.
|
|
195
|
+
*
|
|
196
|
+
* @param {Context} context The context.
|
|
197
|
+
* @param {Viewport} viewport The viewport.
|
|
198
|
+
* @param {Texture} [existingColorTexture] Optional existing color texture to reuse.
|
|
199
|
+
* @param {Texture} [existingDepthTexture] Optional existing depth texture to reuse.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Framebuffer} The edge framebuffer.
|
|
202
|
+
*/
|
|
203
|
+
EdgeFramebuffer.prototype.getFramebuffer = function (
|
|
204
|
+
context,
|
|
205
|
+
viewport,
|
|
206
|
+
existingColorTexture,
|
|
207
|
+
existingDepthTexture,
|
|
208
|
+
) {
|
|
209
|
+
this.update(
|
|
210
|
+
context,
|
|
211
|
+
viewport,
|
|
212
|
+
false,
|
|
213
|
+
existingColorTexture,
|
|
214
|
+
existingDepthTexture,
|
|
215
|
+
);
|
|
216
|
+
return this._framebuffer;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Returns true if this object was destroyed; otherwise, false.
|
|
221
|
+
*
|
|
222
|
+
* @returns {boolean} True if this object was destroyed; otherwise, false.
|
|
223
|
+
*/
|
|
224
|
+
EdgeFramebuffer.prototype.isDestroyed = function () {
|
|
225
|
+
return false;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
|
|
230
|
+
* release of WebGL resources, instead of relying on the garbage collector to destroy this object.
|
|
231
|
+
* <br /><br />
|
|
232
|
+
* Once an object is destroyed, it should not be used; calling any function other than
|
|
233
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
|
|
234
|
+
* assign the return value (<code>undefined</code>) to the object as done in the example.
|
|
235
|
+
*
|
|
236
|
+
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
|
|
237
|
+
*/
|
|
238
|
+
EdgeFramebuffer.prototype.destroy = function () {
|
|
239
|
+
this._framebufferManager =
|
|
240
|
+
this._framebufferManager && this._framebufferManager.destroy();
|
|
241
|
+
this._clearCommand = undefined;
|
|
242
|
+
return destroyObject(this);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export default EdgeFramebuffer;
|
|
@@ -454,6 +454,18 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
454
454
|
* @type {PickedMetadataInfo|undefined}
|
|
455
455
|
*/
|
|
456
456
|
this.pickedMetadataInfo = undefined;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Internal toggle indicating that at least one primitive for this frame requested
|
|
460
|
+
* edge visibility rendering (EXT_mesh_primitive_edge_visibility). This allows
|
|
461
|
+
* lazy allocation/activation of the edge MRT without storing a Scene reference
|
|
462
|
+
* on the frame state (avoids passing entire Scene through internal APIs).
|
|
463
|
+
* Set by model pipeline stages when they encounter edge visibility data.
|
|
464
|
+
* Consumed by Scene to flip its _enableEdgeVisibility flag.
|
|
465
|
+
* @type {boolean}
|
|
466
|
+
* @private
|
|
467
|
+
*/
|
|
468
|
+
this.edgeVisibilityRequested = false;
|
|
457
469
|
}
|
|
458
470
|
|
|
459
471
|
/**
|
|
@@ -125,7 +125,6 @@ GaussianSplat3DTileContent.tilesetRequiresGaussianSplattingExt = function (
|
|
|
125
125
|
tileset,
|
|
126
126
|
) {
|
|
127
127
|
let hasGaussianSplatExtension = false;
|
|
128
|
-
let hasLegacyGaussianSplatExtension = false;
|
|
129
128
|
if (tileset.isGltfExtensionRequired instanceof Function) {
|
|
130
129
|
hasGaussianSplatExtension =
|
|
131
130
|
tileset.isGltfExtensionRequired("KHR_gaussian_splatting") &&
|
|
@@ -133,22 +132,20 @@ GaussianSplat3DTileContent.tilesetRequiresGaussianSplattingExt = function (
|
|
|
133
132
|
"KHR_gaussian_splatting_compression_spz_2",
|
|
134
133
|
);
|
|
135
134
|
|
|
136
|
-
|
|
137
|
-
"KHR_spz_gaussian_splats_compression"
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"KHR_gaussian_splatting_compression_spz_2 extensions.",
|
|
148
|
-
);
|
|
135
|
+
if (
|
|
136
|
+
tileset.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")
|
|
137
|
+
) {
|
|
138
|
+
deprecationWarning(
|
|
139
|
+
"KHR_spz_gaussian_splats_compression",
|
|
140
|
+
"Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor " +
|
|
141
|
+
"of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions" +
|
|
142
|
+
"\n\nPlease retile your tileset with the KHR_gaussian_splatting and " +
|
|
143
|
+
"KHR_gaussian_splatting_compression_spz_2 extensions.",
|
|
144
|
+
);
|
|
145
|
+
}
|
|
149
146
|
}
|
|
150
147
|
|
|
151
|
-
return hasGaussianSplatExtension
|
|
148
|
+
return hasGaussianSplatExtension;
|
|
152
149
|
};
|
|
153
150
|
|
|
154
151
|
Object.defineProperties(GaussianSplat3DTileContent.prototype, {
|
|
@@ -236,7 +233,6 @@ Object.defineProperties(GaussianSplat3DTileContent.prototype, {
|
|
|
236
233
|
* @readonly
|
|
237
234
|
*/
|
|
238
235
|
batchTableByteLength: {
|
|
239
|
-
// eslint-disable-next-line getter-return
|
|
240
236
|
get: function () {
|
|
241
237
|
return 0;
|
|
242
238
|
},
|
|
@@ -32,6 +32,7 @@ import Quaternion from "../Core/Quaternion.js";
|
|
|
32
32
|
import SplitDirection from "./SplitDirection.js";
|
|
33
33
|
import destroyObject from "../Core/destroyObject.js";
|
|
34
34
|
import ContextLimits from "../Renderer/ContextLimits.js";
|
|
35
|
+
import Transforms from "../Core/Transforms.js";
|
|
35
36
|
|
|
36
37
|
const scratchMatrix4A = new Matrix4();
|
|
37
38
|
const scratchMatrix4B = new Matrix4();
|
|
@@ -89,7 +90,7 @@ function createGaussianSplatTexture(context, splatTextureData) {
|
|
|
89
90
|
* </p>
|
|
90
91
|
* @alias GaussianSplatPrimitive
|
|
91
92
|
* @constructor
|
|
92
|
-
* @param {
|
|
93
|
+
* @param {object} options An object with the following properties:
|
|
93
94
|
* @param {Cesium3DTileset} options.tileset The tileset that this primitive belongs to.
|
|
94
95
|
* @param {boolean} [options.debugShowBoundingVolume=false] Whether to show the bounding volume of the primitive for debugging purposes.
|
|
95
96
|
* @private
|
|
@@ -427,6 +428,13 @@ GaussianSplatPrimitive.transformTile = function (tile) {
|
|
|
427
428
|
const gltfPrimitive = tile.content.gltfPrimitive;
|
|
428
429
|
const gaussianSplatPrimitive = tile.tileset.gaussianSplatPrimitive;
|
|
429
430
|
|
|
431
|
+
if (gaussianSplatPrimitive._rootTransform === undefined) {
|
|
432
|
+
gaussianSplatPrimitive._rootTransform = Transforms.eastNorthUpToFixedFrame(
|
|
433
|
+
tile.tileset.boundingSphere.center,
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
const rootTransform = gaussianSplatPrimitive._rootTransform;
|
|
437
|
+
|
|
430
438
|
const computedModelMatrix = Matrix4.multiplyTransformation(
|
|
431
439
|
computedTransform,
|
|
432
440
|
gaussianSplatPrimitive._axisCorrectionMatrix,
|
|
@@ -441,7 +449,7 @@ GaussianSplatPrimitive.transformTile = function (tile) {
|
|
|
441
449
|
|
|
442
450
|
const toGlobal = Matrix4.multiply(
|
|
443
451
|
tile.tileset.modelMatrix,
|
|
444
|
-
|
|
452
|
+
rootTransform,
|
|
445
453
|
scratchMatrix4B,
|
|
446
454
|
);
|
|
447
455
|
const toLocal = Matrix4.inverse(toGlobal, scratchMatrix4C);
|
|
@@ -684,7 +692,7 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
|
|
|
684
692
|
const tileset = primitive._tileset;
|
|
685
693
|
const modelMatrix = Matrix4.multiply(
|
|
686
694
|
tileset.modelMatrix,
|
|
687
|
-
|
|
695
|
+
primitive._rootTransform,
|
|
688
696
|
scratchMatrix4A,
|
|
689
697
|
);
|
|
690
698
|
const inverseModelRotation = Matrix4.getRotation(
|
|
@@ -765,7 +773,7 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
|
|
|
765
773
|
|
|
766
774
|
const modelMatrix = Matrix4.multiply(
|
|
767
775
|
tileset.modelMatrix,
|
|
768
|
-
|
|
776
|
+
primitive._rootTransform,
|
|
769
777
|
scratchMatrix4B,
|
|
770
778
|
);
|
|
771
779
|
|
|
@@ -804,10 +812,6 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
|
|
|
804
812
|
GaussianSplatPrimitive.prototype.update = function (frameState) {
|
|
805
813
|
const tileset = this._tileset;
|
|
806
814
|
|
|
807
|
-
if (!defined(this._rootTransform)) {
|
|
808
|
-
this._rootTransform = tileset.root.computedTransform;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
815
|
if (!tileset.show || tileset._selectedTiles.length === 0) {
|
|
812
816
|
return;
|
|
813
817
|
}
|
|
@@ -49,8 +49,8 @@ GaussianSplatSorter._getSorterTaskProcessor = function () {
|
|
|
49
49
|
* Sorts Gaussian splats using a radix sort algorithm. Sorted by distance from the camera.
|
|
50
50
|
* A new list of indexes is returned, which can be used to render the splats in the correct order.
|
|
51
51
|
*
|
|
52
|
-
* @param {
|
|
53
|
-
* @param {
|
|
52
|
+
* @param {object} parameters - The parameters for sorting Gaussian splat indexes.
|
|
53
|
+
* @param {object} parameters.primitive - The primitive containing positions and modelView matrices.
|
|
54
54
|
* @returns {Promise|undefined} A promise that resolves to the sorted indexes or undefined if the task cannot be scheduled.
|
|
55
55
|
* @exception {RuntimeError} Sorter could not be initialized.
|
|
56
56
|
* @private
|
package/Source/Scene/Globe.js
CHANGED
|
@@ -646,7 +646,7 @@ function makeShadersDirty(globe) {
|
|
|
646
646
|
const fragmentSources = [AtmosphereCommon, GroundAtmosphere];
|
|
647
647
|
if (
|
|
648
648
|
defined(globe._material) &&
|
|
649
|
-
(!requireNormals || globe._terrainProvider.
|
|
649
|
+
(!requireNormals || globe._terrainProvider.hasVertexNormals)
|
|
650
650
|
) {
|
|
651
651
|
fragmentSources.push(globe._material.shaderSource);
|
|
652
652
|
defines.push("APPLY_MATERIAL");
|
|
@@ -943,7 +943,9 @@ Globe.prototype.getHeight = function (cartographic) {
|
|
|
943
943
|
|
|
944
944
|
const intersection = tile.data.pick(
|
|
945
945
|
ray,
|
|
946
|
-
|
|
946
|
+
// Globe height is the same at a given cartographic regardless of the scene mode,
|
|
947
|
+
// but the ray is constructed via a surface normal (which assumes 3D), so pick in 3D mode.
|
|
948
|
+
SceneMode.SCENE3D,
|
|
947
949
|
projection,
|
|
948
950
|
false,
|
|
949
951
|
scratchGetHeightIntersection,
|