@cesium/engine 21.0.1-ion.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/Workers/{chunk-LSNF6CIP.js → chunk-2D3GLFZD.js} +12 -12
- package/Build/Workers/chunk-34YXP222.js +352 -0
- package/Build/Workers/{chunk-OLH67Z2S.js → chunk-3GL53OCU.js} +17 -18
- package/Build/Workers/{chunk-WIPOMPA5.js → chunk-5B7VZQZY.js} +6 -6
- package/Build/Workers/{chunk-NWJRIJQG.js → chunk-5T5SY63I.js} +2 -2
- package/Build/Workers/{chunk-DTYIUWZU.js → chunk-5ZF53EY6.js} +4 -4
- package/Build/Workers/{chunk-UTTKH2UG.js → chunk-6HBKE43B.js} +7 -7
- package/Build/Workers/{chunk-ZTGZMKAB.js → chunk-726NINF5.js} +16 -16
- package/Build/Workers/{chunk-L73TRTIG.js → chunk-75HAJIDT.js} +1 -1
- package/Build/Workers/{chunk-G5RX7BPJ.js → chunk-7KAXDKRU.js} +10 -10
- package/Build/Workers/chunk-7XEJGXX2.js +2759 -0
- package/Build/Workers/{chunk-ZOVMWDPW.js → chunk-A4DPJIWS.js} +18 -10
- package/Build/Workers/{chunk-UTL4WVC3.js → chunk-A6JAFSZT.js} +5 -5
- package/Build/Workers/{chunk-E6T4LSM6.js → chunk-AARZSH4V.js} +5 -5
- package/Build/Workers/{chunk-EEDSGIH7.js → chunk-AOM3FHBN.js} +6 -6
- package/Build/Workers/{chunk-WJV24LAS.js → chunk-BJSNGGBM.js} +4 -4
- package/Build/Workers/{chunk-VIDWZGD6.js → chunk-ECHAJNQJ.js} +12 -12
- package/Build/Workers/{chunk-MIFUV36K.js → chunk-EJO3NKMS.js} +1 -1
- package/Build/Workers/{chunk-ADADBRLI.js → chunk-EZ7NJXQN.js} +4 -4
- package/Build/Workers/{chunk-MJWRSKJV.js → chunk-FA3SCJDX.js} +2 -2
- package/Build/Workers/{chunk-XFS2ORSO.js → chunk-GYRDA3XK.js} +14 -14
- package/Build/Workers/{chunk-3XTJC4CV.js → chunk-H7B7FU2U.js} +7 -7
- package/Build/Workers/{chunk-HDBIC7IL.js → chunk-IGX772ZQ.js} +1 -1
- package/Build/Workers/{chunk-EHMAKCWQ.js → chunk-JDJAPBZP.js} +1 -1
- package/Build/Workers/{chunk-LK7H6V2E.js → chunk-JZFU2LEM.js} +4 -4
- package/Build/Workers/{chunk-3K4DRV7Y.js → chunk-KGLDJRSO.js} +9 -9
- package/Build/Workers/{chunk-LEFV6H2V.js → chunk-KUB64XW6.js} +11 -11
- package/Build/Workers/{chunk-26ZRRKTU.js → chunk-L7U26FFD.js} +16 -16
- package/Build/Workers/{chunk-T7WXNKIA.js → chunk-LEFQBK6H.js} +11 -11
- package/Build/Workers/{chunk-75UG66GR.js → chunk-LWJXCI3F.js} +5 -5
- package/Build/Workers/{chunk-ESPNIYL5.js → chunk-M7HRE4QR.js} +8 -8
- package/Build/Workers/{chunk-SGEAS4NZ.js → chunk-MXHRZHDF.js} +6 -6
- package/Build/Workers/{chunk-YFZMB6FZ.js → chunk-N52ZRKUE.js} +6 -6
- package/Build/Workers/{chunk-AQ4A5CMC.js → chunk-NE5JTQJP.js} +7 -7
- package/Build/Workers/{chunk-G74UMFQ4.js → chunk-NGKF5NTR.js} +5 -5
- package/Build/Workers/{chunk-TXK2FF6N.js → chunk-NHZNMTIR.js} +5 -5
- package/Build/Workers/{chunk-2PX2ULSM.js → chunk-OE22564R.js} +3 -3
- package/Build/Workers/{chunk-AGT6W3JS.js → chunk-OUBBMEWX.js} +6 -6
- package/Build/Workers/{chunk-JESBYOH5.js → chunk-P2H75UV5.js} +67 -33
- package/Build/Workers/{chunk-B56XVJRS.js → chunk-QCMRUVVF.js} +12 -12
- package/Build/Workers/{chunk-SDFGZML6.js → chunk-QSMIHPUM.js} +2 -2
- package/Build/Workers/{chunk-SF2XXYOB.js → chunk-RCCYW6E7.js} +12 -12
- package/Build/Workers/{chunk-EZJXK2UP.js → chunk-RQRODXVN.js} +4 -4
- package/Build/Workers/{chunk-WMG6UOCJ.js → chunk-SZN34LQ5.js} +10 -10
- package/Build/Workers/{chunk-XYBFMHXA.js → chunk-U4XMLGSR.js} +7 -7
- package/Build/Workers/{chunk-KGL66RWW.js → chunk-U7CX3HHE.js} +8 -8
- package/Build/Workers/{chunk-MFPT34BC.js → chunk-VCVA7BMD.js} +4 -4
- package/Build/Workers/{chunk-H3G7OYZY.js → chunk-VVZ667H6.js} +2 -2
- package/Build/Workers/{chunk-PQW63B2T.js → chunk-W4PIP5PG.js} +2 -2
- package/Build/Workers/{chunk-XPTKQIVN.js → chunk-XPVZWY4A.js} +8 -8
- package/Build/Workers/{chunk-OWCFUM4Z.js → chunk-XQ347YWU.js} +13 -13
- package/Build/Workers/{chunk-MBIUW42A.js → chunk-XZO6F23E.js} +1 -1
- package/Build/Workers/{chunk-6KX3IUUT.js → chunk-YLILBDWK.js} +2 -2
- package/Build/Workers/{chunk-RFZAUDYZ.js → chunk-YLXWC7OW.js} +4 -4
- package/Build/Workers/combineGeometry.js +21 -21
- package/Build/Workers/createBoxGeometry.js +15 -15
- package/Build/Workers/createBoxOutlineGeometry.js +13 -13
- package/Build/Workers/createCircleGeometry.js +23 -23
- package/Build/Workers/createCircleOutlineGeometry.js +16 -16
- package/Build/Workers/createCoplanarPolygonGeometry.js +30 -30
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createCorridorGeometry.js +26 -26
- package/Build/Workers/createCorridorOutlineGeometry.js +25 -25
- package/Build/Workers/createCylinderGeometry.js +17 -17
- package/Build/Workers/createCylinderOutlineGeometry.js +15 -15
- package/Build/Workers/createEllipseGeometry.js +23 -23
- package/Build/Workers/createEllipseOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipsoidGeometry.js +16 -16
- package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -15
- package/Build/Workers/createFrustumGeometry.js +15 -15
- package/Build/Workers/createFrustumOutlineGeometry.js +15 -15
- package/Build/Workers/createGeometry.js +24 -22
- package/Build/Workers/createGroundPolylineGeometry.js +19 -19
- package/Build/Workers/createPlaneGeometry.js +13 -13
- package/Build/Workers/createPlaneOutlineGeometry.js +12 -12
- package/Build/Workers/createPolygonGeometry.js +29 -29
- package/Build/Workers/createPolygonOutlineGeometry.js +27 -27
- package/Build/Workers/createPolylineGeometry.js +22 -22
- package/Build/Workers/createPolylineVolumeGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
- package/Build/Workers/createRectangleGeometry.js +24 -24
- package/Build/Workers/createRectangleOutlineGeometry.js +17 -17
- package/Build/Workers/createSimplePolylineGeometry.js +20 -20
- package/Build/Workers/createSphereGeometry.js +16 -16
- package/Build/Workers/createSphereOutlineGeometry.js +15 -15
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +12 -12
- package/Build/Workers/createVectorTileGeometries.js +21 -21
- package/Build/Workers/createVectorTilePoints.js +11 -11
- package/Build/Workers/createVectorTilePolygons.js +19 -19
- package/Build/Workers/createVectorTilePolylines.js +12 -12
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +88 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +21 -21
- package/Build/Workers/createVerticesFromHeightmap.js +21 -21
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -277
- package/Build/Workers/createWallGeometry.js +21 -21
- package/Build/Workers/createWallOutlineGeometry.js +20 -20
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +9 -9
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +19 -19
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +92 -0
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +2 -2
- package/Source/Core/Cesium3DTilesTerrainData.js +930 -0
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +1866 -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 +1 -1
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
- package/Source/Core/HeightmapTerrainData.js +10 -22
- package/Source/Core/HilbertOrder.js +0 -6
- package/Source/Core/ITwinPlatform.js +6 -6
- 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 +23 -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 +8 -8
- package/Source/Core/TerrainProvider.js +151 -0
- 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/PropertyArray.js +2 -2
- package/Source/Renderer/AutomaticUniforms.js +61 -0
- package/Source/Renderer/Context.js +13 -7
- package/Source/Renderer/Pass.js +10 -9
- 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 +7 -5
- package/Source/Scene/BatchTable.js +2 -2
- package/Source/Scene/BillboardCollection.js +25 -21
- 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 +1 -1
- package/Source/Scene/GlobeSurfaceTile.js +10 -4
- package/Source/Scene/GltfBufferViewLoader.js +18 -0
- package/Source/Scene/GltfLoader.js +46 -8
- package/Source/Scene/Google2DImageryProvider.js +39 -27
- 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 +13 -17
- package/Source/Scene/Picking.js +104 -80
- 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 +124 -12
- 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/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 +102 -62
- package/Source/Shaders/BillboardCollectionFS.js +102 -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/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
- package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
- package/index.d.ts +281 -27
- package/index.js +176 -166
- package/package.json +2 -1
package/Source/Scene/Scene.js
CHANGED
|
@@ -761,6 +761,15 @@ function Scene(options) {
|
|
|
761
761
|
*/
|
|
762
762
|
this.light = new SunLight();
|
|
763
763
|
|
|
764
|
+
/**
|
|
765
|
+
* Whether or not to enable edge visibility rendering for 3D tiles.
|
|
766
|
+
* When enabled, creates a framebuffer with multiple render targets
|
|
767
|
+
* for advanced edge detection and visibility techniques.
|
|
768
|
+
* @type {boolean}
|
|
769
|
+
* @default false
|
|
770
|
+
*/
|
|
771
|
+
this._enableEdgeVisibility = false;
|
|
772
|
+
|
|
764
773
|
// Give frameState, camera, and screen space camera controller initial state before rendering
|
|
765
774
|
updateFrameNumber(this, 0.0, JulianDate.now());
|
|
766
775
|
this.updateFrameState();
|
|
@@ -1350,7 +1359,7 @@ Object.defineProperties(Scene.prototype, {
|
|
|
1350
1359
|
*
|
|
1351
1360
|
* @memberof Scene.prototype
|
|
1352
1361
|
*
|
|
1353
|
-
* @type {
|
|
1362
|
+
* @type {object | undefined}
|
|
1354
1363
|
* @readonly
|
|
1355
1364
|
*
|
|
1356
1365
|
* @default undefined
|
|
@@ -2567,6 +2576,48 @@ function performTranslucent3DTilesClassification(
|
|
|
2567
2576
|
);
|
|
2568
2577
|
}
|
|
2569
2578
|
|
|
2579
|
+
function performCesium3DTileEdgesPass(scene, passState, frustumCommands) {
|
|
2580
|
+
scene.context.uniformState.updatePass(Pass.CESIUM_3D_TILE_EDGES);
|
|
2581
|
+
|
|
2582
|
+
const originalFramebuffer = passState.framebuffer;
|
|
2583
|
+
|
|
2584
|
+
scene.context.uniformState.edgeColorTexture = scene.context.defaultTexture;
|
|
2585
|
+
scene.context.uniformState.edgeIdTexture = scene.context.defaultTexture;
|
|
2586
|
+
scene.context.uniformState.edgeDepthTexture = scene.context.defaultTexture;
|
|
2587
|
+
|
|
2588
|
+
// Set edge framebuffer for rendering
|
|
2589
|
+
if (
|
|
2590
|
+
scene._enableEdgeVisibility &&
|
|
2591
|
+
defined(scene._view) &&
|
|
2592
|
+
defined(scene._view.edgeFramebuffer)
|
|
2593
|
+
) {
|
|
2594
|
+
passState.framebuffer = scene._view.edgeFramebuffer.framebuffer;
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
// performPass
|
|
2598
|
+
const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_EDGES];
|
|
2599
|
+
const commandCount = frustumCommands.indices[Pass.CESIUM_3D_TILE_EDGES];
|
|
2600
|
+
|
|
2601
|
+
// clear edge framebuffer
|
|
2602
|
+
if (
|
|
2603
|
+
scene._enableEdgeVisibility &&
|
|
2604
|
+
defined(scene._view) &&
|
|
2605
|
+
defined(scene._view.edgeFramebuffer)
|
|
2606
|
+
) {
|
|
2607
|
+
const clearCommand = scene._view.edgeFramebuffer.getClearCommand(
|
|
2608
|
+
new Color(0.0, 0.0, 0.0, 0.0),
|
|
2609
|
+
);
|
|
2610
|
+
clearCommand.execute(scene.context, passState);
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
// Then execute edge rendering commands
|
|
2614
|
+
for (let j = 0; j < commandCount; ++j) {
|
|
2615
|
+
executeCommand(commands[j], scene, passState);
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
passState.framebuffer = originalFramebuffer;
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2570
2621
|
/**
|
|
2571
2622
|
* Execute the draw commands for all the render passes.
|
|
2572
2623
|
*
|
|
@@ -2709,6 +2760,48 @@ function executeCommands(scene, passState) {
|
|
|
2709
2760
|
}
|
|
2710
2761
|
|
|
2711
2762
|
let commandCount;
|
|
2763
|
+
|
|
2764
|
+
// Draw edges FIRST - before binding textures to avoid feedback loop
|
|
2765
|
+
performCesium3DTileEdgesPass(scene, passState, frustumCommands);
|
|
2766
|
+
|
|
2767
|
+
if (
|
|
2768
|
+
scene._enableEdgeVisibility &&
|
|
2769
|
+
defined(scene._view) &&
|
|
2770
|
+
defined(scene._view.edgeFramebuffer)
|
|
2771
|
+
) {
|
|
2772
|
+
// Get edge color texture (attachment 0)
|
|
2773
|
+
const colorTexture = scene._view.edgeFramebuffer.colorTexture;
|
|
2774
|
+
if (defined(colorTexture)) {
|
|
2775
|
+
scene.context.uniformState.edgeColorTexture = colorTexture;
|
|
2776
|
+
} else {
|
|
2777
|
+
scene.context.uniformState.edgeColorTexture =
|
|
2778
|
+
scene.context.defaultTexture;
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
// Get edge ID texture (attachment 1)
|
|
2782
|
+
const idTexture = scene._view.edgeFramebuffer.idTexture;
|
|
2783
|
+
if (defined(idTexture)) {
|
|
2784
|
+
scene.context.uniformState.edgeIdTexture = idTexture;
|
|
2785
|
+
} else {
|
|
2786
|
+
scene.context.uniformState.edgeIdTexture = scene.context.defaultTexture;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
// Get edge depth texture (attachment 2)
|
|
2790
|
+
const edgeDepthTexture = scene._view.edgeFramebuffer.depthTexture;
|
|
2791
|
+
if (defined(edgeDepthTexture)) {
|
|
2792
|
+
scene.context.uniformState.edgeDepthTexture = edgeDepthTexture;
|
|
2793
|
+
} else {
|
|
2794
|
+
scene.context.uniformState.edgeDepthTexture =
|
|
2795
|
+
scene.context.defaultTexture;
|
|
2796
|
+
}
|
|
2797
|
+
} else {
|
|
2798
|
+
scene.context.uniformState.edgeColorTexture =
|
|
2799
|
+
scene.context.defaultTexture;
|
|
2800
|
+
scene.context.uniformState.edgeIdTexture = scene.context.defaultTexture;
|
|
2801
|
+
scene.context.uniformState.edgeDepthTexture =
|
|
2802
|
+
scene.context.defaultTexture;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2712
2805
|
if (!useInvertClassification || picking || renderTranslucentDepthForPick) {
|
|
2713
2806
|
// Common/fastest path. Draw 3D Tiles and classification normally.
|
|
2714
2807
|
|
|
@@ -3595,9 +3688,20 @@ function updateShadowMaps(scene) {
|
|
|
3595
3688
|
function updateAndRenderPrimitives(scene) {
|
|
3596
3689
|
const frameState = scene._frameState;
|
|
3597
3690
|
|
|
3691
|
+
// Reset per-frame edge visibility request flag before primitives update
|
|
3692
|
+
frameState.edgeVisibilityRequested = false;
|
|
3693
|
+
|
|
3598
3694
|
scene._groundPrimitives.update(frameState);
|
|
3599
3695
|
scene._primitives.update(frameState);
|
|
3600
3696
|
|
|
3697
|
+
// If any primitive requested edge visibility this frame, flip the scene flag lazily.
|
|
3698
|
+
if (
|
|
3699
|
+
frameState.edgeVisibilityRequested &&
|
|
3700
|
+
scene._enableEdgeVisibility === false
|
|
3701
|
+
) {
|
|
3702
|
+
scene._enableEdgeVisibility = true;
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3601
3705
|
updateDebugFrustumPlanes(scene);
|
|
3602
3706
|
updateShadowMaps(scene);
|
|
3603
3707
|
|
|
@@ -3714,6 +3818,13 @@ function updateAndClearFramebuffers(scene, passState, clearColor) {
|
|
|
3714
3818
|
|
|
3715
3819
|
const useInvertClassification = (environmentState.useInvertClassification =
|
|
3716
3820
|
!picking && defined(passState.framebuffer) && scene.invertClassification);
|
|
3821
|
+
|
|
3822
|
+
// Update edge framebuffer for 3D tile edge rendering
|
|
3823
|
+
const useEdgeFramebuffer = !picking && scene._enableEdgeVisibility;
|
|
3824
|
+
if (useEdgeFramebuffer) {
|
|
3825
|
+
view.edgeFramebuffer.update(context, view.viewport, scene._hdr);
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3717
3828
|
if (useInvertClassification) {
|
|
3718
3829
|
let depthFramebuffer;
|
|
3719
3830
|
if (frameState.invertClassificationColor.alpha === 1.0) {
|
|
@@ -4399,10 +4510,11 @@ Scene.prototype.clampLineWidth = function (width) {
|
|
|
4399
4510
|
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
4400
4511
|
* @param {number} [width=3] Width of the pick rectangle.
|
|
4401
4512
|
* @param {number} [height=3] Height of the pick rectangle.
|
|
4402
|
-
* @returns {
|
|
4513
|
+
* @returns {object | undefined} Object containing the picked primitive or <code>undefined</code> if nothing is at the location.
|
|
4403
4514
|
*/
|
|
4404
4515
|
Scene.prototype.pick = function (windowPosition, width, height) {
|
|
4405
|
-
|
|
4516
|
+
// Picking one object, result is either [object] or []
|
|
4517
|
+
return this._picking.pick(this, windowPosition, width, height, 1)[0];
|
|
4406
4518
|
};
|
|
4407
4519
|
|
|
4408
4520
|
/**
|
|
@@ -4674,7 +4786,7 @@ function updateRequestRenderModeDeferCheckPass(scene) {
|
|
|
4674
4786
|
* @private
|
|
4675
4787
|
*
|
|
4676
4788
|
* @param {Ray} ray The ray.
|
|
4677
|
-
* @param {
|
|
4789
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4678
4790
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4679
4791
|
* @returns {object | undefined} An object containing the object and position of the first intersection or <code>undefined</code> if there are no intersections.
|
|
4680
4792
|
*
|
|
@@ -4699,9 +4811,9 @@ Scene.prototype.pickFromRay = function (ray, objectsToExclude, width) {
|
|
|
4699
4811
|
*
|
|
4700
4812
|
* @param {Ray} ray The ray.
|
|
4701
4813
|
* @param {number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.
|
|
4702
|
-
* @param {
|
|
4814
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4703
4815
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4704
|
-
* @returns {
|
|
4816
|
+
* @returns {object[]} List of objects containing the object and position of each intersection.
|
|
4705
4817
|
*
|
|
4706
4818
|
* @exception {DeveloperError} Ray intersections are only supported in 3D mode.
|
|
4707
4819
|
*/
|
|
@@ -4727,7 +4839,7 @@ Scene.prototype.drillPickFromRay = function (
|
|
|
4727
4839
|
* @private
|
|
4728
4840
|
*
|
|
4729
4841
|
* @param {Ray} ray The ray.
|
|
4730
|
-
* @param {
|
|
4842
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4731
4843
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4732
4844
|
* @returns {Promise<object>} A promise that resolves to an object containing the object and position of the first intersection.
|
|
4733
4845
|
*
|
|
@@ -4754,7 +4866,7 @@ Scene.prototype.pickFromRayMostDetailed = function (
|
|
|
4754
4866
|
*
|
|
4755
4867
|
* @param {Ray} ray The ray.
|
|
4756
4868
|
* @param {number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.
|
|
4757
|
-
* @param {
|
|
4869
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4758
4870
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4759
4871
|
* @returns {Promise<Object[]>} A promise that resolves to a list of objects containing the object and position of each intersection.
|
|
4760
4872
|
*
|
|
@@ -4785,7 +4897,7 @@ Scene.prototype.drillPickFromRayMostDetailed = function (
|
|
|
4785
4897
|
* </p>
|
|
4786
4898
|
*
|
|
4787
4899
|
* @param {Cartographic} position The cartographic position to sample height from.
|
|
4788
|
-
* @param {
|
|
4900
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.
|
|
4789
4901
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4790
4902
|
* @returns {number | undefined} The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
|
|
4791
4903
|
*
|
|
@@ -4815,7 +4927,7 @@ Scene.prototype.sampleHeight = function (position, objectsToExclude, width) {
|
|
|
4815
4927
|
* </p>
|
|
4816
4928
|
*
|
|
4817
4929
|
* @param {Cartesian3} cartesian The cartesian position.
|
|
4818
|
-
* @param {
|
|
4930
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.
|
|
4819
4931
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4820
4932
|
* @param {Cartesian3} [result] An optional object to return the clamped position.
|
|
4821
4933
|
* @returns {Cartesian3 | undefined} The modified result parameter or a new Cartesian3 instance if one was not provided. This may be <code>undefined</code> if there was no scene geometry to clamp to.
|
|
@@ -4855,7 +4967,7 @@ Scene.prototype.clampToHeight = function (
|
|
|
4855
4967
|
* the height is set to <code>undefined</code>.
|
|
4856
4968
|
*
|
|
4857
4969
|
* @param {Cartographic[]} positions The cartographic positions to update with sampled heights.
|
|
4858
|
-
* @param {
|
|
4970
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.
|
|
4859
4971
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4860
4972
|
* @returns {Promise<Array<Cartographic | undefined>>} A promise that resolves to the provided list of positions when the query has completed. Positions may become <code>undefined</code> if the height cannot be determined.
|
|
4861
4973
|
*
|
|
@@ -4895,7 +5007,7 @@ Scene.prototype.sampleHeightMostDetailed = function (
|
|
|
4895
5007
|
* can be sampled at that location, or another error occurs, the element in the array is set to undefined.
|
|
4896
5008
|
*
|
|
4897
5009
|
* @param {Cartesian3[]} cartesians The cartesian positions to update with clamped positions.
|
|
4898
|
-
* @param {
|
|
5010
|
+
* @param {object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.
|
|
4899
5011
|
* @param {number} [width=0.1] Width of the intersection volume in meters.
|
|
4900
5012
|
* @returns {Promise<Array<Cartesian3 | undefined>>} A promise that resolves to the provided list of positions when the query has completed. Positions may become <code>undefined</code> if they cannot be clamped.
|
|
4901
5013
|
*
|
|
@@ -3,27 +3,27 @@ import DeveloperError from "../Core/DeveloperError.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Constants used to indicated what part of the sensor volume to display.
|
|
5
5
|
*
|
|
6
|
-
* @enum {
|
|
6
|
+
* @enum {number}
|
|
7
7
|
*/
|
|
8
8
|
const SensorVolumePortionToDisplay = {
|
|
9
9
|
/**
|
|
10
10
|
* 0x0000. Display the complete sensor volume.
|
|
11
11
|
*
|
|
12
|
-
* @type {
|
|
12
|
+
* @type {number}
|
|
13
13
|
* @constant
|
|
14
14
|
*/
|
|
15
15
|
COMPLETE: 0x0000,
|
|
16
16
|
/**
|
|
17
17
|
* 0x0001. Display the portion of the sensor volume that lies below the true horizon of the ellipsoid.
|
|
18
18
|
*
|
|
19
|
-
* @type {
|
|
19
|
+
* @type {number}
|
|
20
20
|
* @constant
|
|
21
21
|
*/
|
|
22
22
|
BELOW_ELLIPSOID_HORIZON: 0x0001,
|
|
23
23
|
/**
|
|
24
24
|
* 0x0002. Display the portion of the sensor volume that lies above the true horizon of the ellipsoid.
|
|
25
25
|
*
|
|
26
|
-
* @type {
|
|
26
|
+
* @type {number}
|
|
27
27
|
* @constant
|
|
28
28
|
*/
|
|
29
29
|
ABOVE_ELLIPSOID_HORIZON: 0x0002,
|
|
@@ -34,7 +34,7 @@ const SensorVolumePortionToDisplay = {
|
|
|
34
34
|
*
|
|
35
35
|
* @param {SensorVolumePortionToDisplay} portionToDisplay The value to validate.
|
|
36
36
|
*
|
|
37
|
-
* @returns {
|
|
37
|
+
* @returns {boolean} <code>true</code> if the provided value is a valid enumeration value; otherwise, <code>false</code>.
|
|
38
38
|
*/
|
|
39
39
|
SensorVolumePortionToDisplay.validate = function (portionToDisplay) {
|
|
40
40
|
return (
|
|
@@ -49,7 +49,7 @@ SensorVolumePortionToDisplay.validate = function (portionToDisplay) {
|
|
|
49
49
|
*
|
|
50
50
|
* @param {SensorVolumePortionToDisplay} portionToDisplay The value to be converted to its corresponding enumeration string.
|
|
51
51
|
*
|
|
52
|
-
* @returns {
|
|
52
|
+
* @returns {string} The enumeration string corresponding to the value.
|
|
53
53
|
*/
|
|
54
54
|
SensorVolumePortionToDisplay.toString = function (portionToDisplay) {
|
|
55
55
|
switch (portionToDisplay) {
|
|
@@ -283,18 +283,18 @@ async function doRequest(resource, provider, previousError) {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
|
-
* @typedef {
|
|
286
|
+
* @typedef {object} SingleTileImageryProvider.fromUrlOptions
|
|
287
287
|
*
|
|
288
288
|
* Initialization options for the SingleTileImageryProvider constructor when using SingleTileImageryProvider.fromUrl
|
|
289
289
|
*
|
|
290
290
|
* @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.
|
|
291
|
-
* @property {Credit|
|
|
291
|
+
* @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.
|
|
292
292
|
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
|
|
293
293
|
*/
|
|
294
294
|
|
|
295
295
|
/**
|
|
296
296
|
* Creates a provider for a single, top-level imagery tile. The single image is assumed to use a
|
|
297
|
-
* @param {Resource|
|
|
297
|
+
* @param {Resource|string} url The url for the tile
|
|
298
298
|
* @param {SingleTileImageryProvider.fromUrlOptions} [options] Object describing initialization options.
|
|
299
299
|
* @returns {Promise.<SingleTileImageryProvider>} The resolved SingleTileImageryProvider.
|
|
300
300
|
*
|
package/Source/Scene/Terrain.js
CHANGED
|
@@ -112,9 +112,9 @@ Object.defineProperties(Terrain.prototype, {
|
|
|
112
112
|
*
|
|
113
113
|
* @function
|
|
114
114
|
*
|
|
115
|
-
* @param {
|
|
116
|
-
* @param {
|
|
117
|
-
* @param {
|
|
115
|
+
* @param {object} [options] Object with the following properties:
|
|
116
|
+
* @param {boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available.
|
|
117
|
+
* @param {boolean} [options.requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server if available.
|
|
118
118
|
* @returns {Terrain} An asynchronous helper object for a CesiumTerrainProvider
|
|
119
119
|
*
|
|
120
120
|
* @see Ion
|
|
@@ -162,8 +162,8 @@ Terrain.fromWorldTerrain = function (options) {
|
|
|
162
162
|
*
|
|
163
163
|
* @function
|
|
164
164
|
*
|
|
165
|
-
* @param {
|
|
166
|
-
* @param {
|
|
165
|
+
* @param {object} [options] Object with the following properties:
|
|
166
|
+
* @param {boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available.
|
|
167
167
|
* @returns {Terrain} An asynchronous helper object for a CesiumTerrainProvider
|
|
168
168
|
*
|
|
169
169
|
* @see Ion
|
|
@@ -107,7 +107,7 @@ TileMapServiceImageryProvider._requestMetadata = async function (
|
|
|
107
107
|
/**
|
|
108
108
|
* Creates a TileMapServiceImageryProvider from the specified url.
|
|
109
109
|
*
|
|
110
|
-
* @param {Resource|
|
|
110
|
+
* @param {Resource|string} url Path to image tiles on server.
|
|
111
111
|
* @param {TileMapServiceImageryProvider.ConstructorOptions} [options] Object describing initialization options.
|
|
112
112
|
* @returns {Promise<TileMapServiceImageryProvider>} A promise that resolves to the created TileMapServiceImageryProvider.
|
|
113
113
|
*
|
|
@@ -205,7 +205,7 @@ function calculateSafeMinimumDetailLevel(
|
|
|
205
205
|
* Parses the results of a successful xml request
|
|
206
206
|
* @private
|
|
207
207
|
*
|
|
208
|
-
* @param {
|
|
208
|
+
* @param {object} xml
|
|
209
209
|
* @param {TileMapServiceImageryProvider.ConstructorOptions} options
|
|
210
210
|
* @param {Resource} tmsResource
|
|
211
211
|
* @param {Resource} xmlResource
|
|
@@ -134,7 +134,7 @@ const pickFeaturesTags = combine(tags, {
|
|
|
134
134
|
* that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}
|
|
135
135
|
* property.
|
|
136
136
|
* @property {TileDiscardPolicy} [tileDiscardPolicy] A policy for discarding tile images according to some criteria
|
|
137
|
-
* @property {
|
|
137
|
+
* @property {object} [customTags] Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.
|
|
138
138
|
*/
|
|
139
139
|
|
|
140
140
|
/**
|
package/Source/Scene/View.js
CHANGED
|
@@ -10,6 +10,7 @@ import ClearCommand from "../Renderer/ClearCommand.js";
|
|
|
10
10
|
import Pass from "../Renderer/Pass.js";
|
|
11
11
|
import PassState from "../Renderer/PassState.js";
|
|
12
12
|
import Camera from "./Camera.js";
|
|
13
|
+
import EdgeFramebuffer from "./EdgeFramebuffer.js";
|
|
13
14
|
import FrustumCommands from "./FrustumCommands.js";
|
|
14
15
|
import GlobeDepth from "./GlobeDepth.js";
|
|
15
16
|
import GlobeTranslucencyFramebuffer from "./GlobeTranslucencyFramebuffer.js";
|
|
@@ -63,6 +64,7 @@ function View(scene, camera, viewport) {
|
|
|
63
64
|
this.pickFramebuffer = new PickFramebuffer(context);
|
|
64
65
|
this.pickDepthFramebuffer = new PickDepthFramebuffer();
|
|
65
66
|
this.sceneFramebuffer = new SceneFramebuffer();
|
|
67
|
+
this.edgeFramebuffer = new EdgeFramebuffer();
|
|
66
68
|
this.globeDepth = globeDepth;
|
|
67
69
|
this.globeTranslucencyFramebuffer = new GlobeTranslucencyFramebuffer();
|
|
68
70
|
this.oit = oit;
|
|
@@ -445,6 +447,7 @@ View.prototype.destroy = function () {
|
|
|
445
447
|
this.pickDepthFramebuffer && this.pickDepthFramebuffer.destroy();
|
|
446
448
|
this.sceneFramebuffer =
|
|
447
449
|
this.sceneFramebuffer && this.sceneFramebuffer.destroy();
|
|
450
|
+
this.edgeFramebuffer = this.edgeFramebuffer && this.edgeFramebuffer.destroy();
|
|
448
451
|
this.globeDepth = this.globeDepth && this.globeDepth.destroy();
|
|
449
452
|
this.oit = this.oit && this.oit.destroy();
|
|
450
453
|
this.translucentTileClassification =
|