@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
|
@@ -122,7 +122,7 @@ MetadataPipelineStage.process = function (
|
|
|
122
122
|
* @param {PropertyAttribute[]} propertyAttributes The PropertyAttributes with properties to be described
|
|
123
123
|
* @param {ModelComponents.Primitive} primitive The primitive to be rendered
|
|
124
124
|
* @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)
|
|
125
|
-
* @returns {
|
|
125
|
+
* @returns {object[]} An array of objects containing information about each PropertyAttributeProperty
|
|
126
126
|
* @private
|
|
127
127
|
*/
|
|
128
128
|
function getPropertyAttributesInfo(propertyAttributes, primitive, statistics) {
|
|
@@ -139,7 +139,7 @@ function getPropertyAttributesInfo(propertyAttributes, primitive, statistics) {
|
|
|
139
139
|
* @param {PropertyAttribute} propertyAttribute The PropertyAttribute with properties to be described
|
|
140
140
|
* @param {ModelComponents.Primitive} primitive The primitive to be rendered
|
|
141
141
|
* @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)
|
|
142
|
-
* @returns {
|
|
142
|
+
* @returns {object[]} An array of objects containing information about each PropertyAttributeProperty
|
|
143
143
|
* @private
|
|
144
144
|
*/
|
|
145
145
|
function getPropertyAttributeInfo(propertyAttribute, primitive, statistics) {
|
|
@@ -176,7 +176,7 @@ function getPropertyAttributeInfo(propertyAttribute, primitive, statistics) {
|
|
|
176
176
|
* return as a flattened Array
|
|
177
177
|
* @param {PropertyTexture[]} propertyTextures The PropertyTextures with properties to be described
|
|
178
178
|
* @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)
|
|
179
|
-
* @returns {
|
|
179
|
+
* @returns {object[]} An array of objects containing information about each PropertyTextureProperty
|
|
180
180
|
* @private
|
|
181
181
|
*/
|
|
182
182
|
function getPropertyTexturesInfo(propertyTextures, statistics) {
|
|
@@ -192,7 +192,7 @@ function getPropertyTexturesInfo(propertyTextures, statistics) {
|
|
|
192
192
|
* Collect info about the properties of a single PropertyTexture
|
|
193
193
|
* @param {PropertyTexture} propertyTexture The PropertyTexture with properties to be described
|
|
194
194
|
* @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)
|
|
195
|
-
* @returns {
|
|
195
|
+
* @returns {object[]} An array of objects containing information about each PropertyTextureProperty
|
|
196
196
|
* @private
|
|
197
197
|
*/
|
|
198
198
|
function getPropertyTextureInfo(propertyTexture, statistics) {
|
|
@@ -225,7 +225,7 @@ function getPropertyTextureInfo(propertyTexture, statistics) {
|
|
|
225
225
|
/**
|
|
226
226
|
* Declare <type>MetadataClass structs in the shader for each PropertyAttributeProperty and PropertyTextureProperty
|
|
227
227
|
* @param {ShaderBuilder} shaderBuilder The shader builder for the primitive
|
|
228
|
-
* @param {
|
|
228
|
+
* @param {object[]} propertyInfos Information about the PropertyAttributeProperties and PropertyTextureProperties
|
|
229
229
|
* @private
|
|
230
230
|
*/
|
|
231
231
|
function declareMetadataTypeStructs(shaderBuilder, propertyInfos) {
|
|
@@ -408,7 +408,7 @@ function addPropertyAttributePropertyMetadata(renderResources, propertyInfo) {
|
|
|
408
408
|
/**
|
|
409
409
|
* Update the shader for a single PropertyTextureProperty
|
|
410
410
|
* @param {PrimitiveRenderResources} renderResources The render resources for the primitive
|
|
411
|
-
* @param {
|
|
411
|
+
* @param {object[]} propertyInfo Info about the PropertyTextureProperty
|
|
412
412
|
* @private
|
|
413
413
|
*/
|
|
414
414
|
function processPropertyTextureProperty(renderResources, propertyInfo) {
|
|
@@ -596,7 +596,7 @@ function addPropertyMetadataStatistics(shaderBuilder, propertyInfo) {
|
|
|
596
596
|
|
|
597
597
|
/**
|
|
598
598
|
* Construct GLSL assignment statements to set metadata spec values in a struct
|
|
599
|
-
* @param {
|
|
599
|
+
* @param {object[]} fieldNames An object with the following properties:
|
|
600
600
|
* @param {string} fieldNames[].specName The name of the property in the spec
|
|
601
601
|
* @param {string} fieldNames[].shaderName The name of the property in the shader
|
|
602
602
|
* @param {object} values A source of property values, keyed on fieldNames[].specName
|
|
@@ -50,6 +50,9 @@ function ModelDrawCommand(options) {
|
|
|
50
50
|
const runtimePrimitive = renderResources.runtimePrimitive;
|
|
51
51
|
this._runtimePrimitive = runtimePrimitive;
|
|
52
52
|
|
|
53
|
+
// Store render resources for edge command creation
|
|
54
|
+
this._primitiveRenderResources = renderResources;
|
|
55
|
+
|
|
53
56
|
// If the command is translucent, or if the primitive's material is
|
|
54
57
|
// double-sided, then back-face culling is automatically disabled for
|
|
55
58
|
// the command. The user value for back-face culling will be ignored.
|
|
@@ -73,6 +76,8 @@ function ModelDrawCommand(options) {
|
|
|
73
76
|
|
|
74
77
|
const needsSilhouetteCommands = hasSilhouette;
|
|
75
78
|
|
|
79
|
+
const needsEdgeCommands = defined(renderResources.edgeGeometry);
|
|
80
|
+
|
|
76
81
|
this._command = command;
|
|
77
82
|
|
|
78
83
|
// None of the derived commands (non-2D) use a different model matrix
|
|
@@ -96,6 +101,7 @@ function ModelDrawCommand(options) {
|
|
|
96
101
|
this._needsTranslucentCommand = needsTranslucentCommand;
|
|
97
102
|
this._needsSkipLevelOfDetailCommands = needsSkipLevelOfDetailCommands;
|
|
98
103
|
this._needsSilhouetteCommands = needsSilhouetteCommands;
|
|
104
|
+
this._needsEdgeCommands = needsEdgeCommands;
|
|
99
105
|
|
|
100
106
|
// Derived commands
|
|
101
107
|
this._originalCommand = undefined;
|
|
@@ -104,6 +110,7 @@ function ModelDrawCommand(options) {
|
|
|
104
110
|
this._skipLodStencilCommand = undefined;
|
|
105
111
|
this._silhouetteModelCommand = undefined;
|
|
106
112
|
this._silhouetteColorCommand = undefined;
|
|
113
|
+
this._edgeCommand = undefined;
|
|
107
114
|
|
|
108
115
|
// All derived commands (including 2D commands)
|
|
109
116
|
this._derivedCommands = [];
|
|
@@ -215,6 +222,19 @@ function initialize(drawCommand) {
|
|
|
215
222
|
derivedCommands.push(drawCommand._silhouetteModelCommand);
|
|
216
223
|
derivedCommands.push(drawCommand._silhouetteColorCommand);
|
|
217
224
|
}
|
|
225
|
+
|
|
226
|
+
if (drawCommand._needsEdgeCommands) {
|
|
227
|
+
const renderResources = drawCommand._primitiveRenderResources;
|
|
228
|
+
drawCommand._edgeCommand = new ModelDerivedCommand({
|
|
229
|
+
command: deriveEdgeCommand(command, renderResources, model),
|
|
230
|
+
updateShadows: false,
|
|
231
|
+
updateBackFaceCulling: false,
|
|
232
|
+
updateCullFace: false,
|
|
233
|
+
updateDebugShowBoundingVolume: false,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
derivedCommands.push(drawCommand._edgeCommand);
|
|
237
|
+
}
|
|
218
238
|
}
|
|
219
239
|
|
|
220
240
|
Object.defineProperties(ModelDrawCommand.prototype, {
|
|
@@ -586,6 +606,24 @@ ModelDrawCommand.prototype.pushSilhouetteCommands = function (
|
|
|
586
606
|
return result;
|
|
587
607
|
};
|
|
588
608
|
|
|
609
|
+
/**
|
|
610
|
+
* @param {FrameState} frameState The frame state.
|
|
611
|
+
* @param {DrawCommand[]} result The draw commands to push to.
|
|
612
|
+
* @returns {DrawCommand[]} The modified command list.
|
|
613
|
+
*
|
|
614
|
+
* @private
|
|
615
|
+
*/
|
|
616
|
+
ModelDrawCommand.prototype.pushEdgeCommands = function (frameState, result) {
|
|
617
|
+
if (!defined(this._edgeCommand)) {
|
|
618
|
+
return result;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const use2D = shouldUse2DCommands(this, frameState);
|
|
622
|
+
pushCommand(result, this._edgeCommand, use2D);
|
|
623
|
+
|
|
624
|
+
return result;
|
|
625
|
+
};
|
|
626
|
+
|
|
589
627
|
function pushCommand(commandList, derivedCommand, use2D) {
|
|
590
628
|
commandList.push(derivedCommand.command);
|
|
591
629
|
if (use2D) {
|
|
@@ -644,6 +682,7 @@ function derive2DCommands(drawCommand) {
|
|
|
644
682
|
derive2DCommand(drawCommand, drawCommand._skipLodStencilCommand);
|
|
645
683
|
derive2DCommand(drawCommand, drawCommand._silhouetteModelCommand);
|
|
646
684
|
derive2DCommand(drawCommand, drawCommand._silhouetteColorCommand);
|
|
685
|
+
derive2DCommand(drawCommand, drawCommand._edgeCommand);
|
|
647
686
|
}
|
|
648
687
|
|
|
649
688
|
function deriveTranslucentCommand(command) {
|
|
@@ -752,6 +791,36 @@ function deriveSilhouetteColorCommand(command, model) {
|
|
|
752
791
|
return silhouetteColorCommand;
|
|
753
792
|
}
|
|
754
793
|
|
|
794
|
+
function deriveEdgeCommand(command, renderResources) {
|
|
795
|
+
const edgeGeometry = renderResources.edgeGeometry;
|
|
796
|
+
const edgeCommand = DrawCommand.shallowClone(command);
|
|
797
|
+
|
|
798
|
+
// Use the edge geometry instead of the original geometry
|
|
799
|
+
edgeCommand.vertexArray = edgeGeometry.vertexArray;
|
|
800
|
+
edgeCommand.primitiveType = edgeGeometry.primitiveType;
|
|
801
|
+
edgeCommand.count = edgeGeometry.indexCount;
|
|
802
|
+
|
|
803
|
+
// Use the edge shader program if available
|
|
804
|
+
if (defined(edgeGeometry.shaderProgram)) {
|
|
805
|
+
edgeCommand.shaderProgram = edgeGeometry.shaderProgram;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// Set pass for edge rendering (use the pass specified in edgeGeometry)
|
|
809
|
+
edgeCommand.pass = edgeGeometry.pass;
|
|
810
|
+
|
|
811
|
+
// Override uniformMap to set u_isEdgePass to true for the edge pass
|
|
812
|
+
const uniformMap = clone(command.uniformMap);
|
|
813
|
+
uniformMap.u_isEdgePass = function () {
|
|
814
|
+
return true; // This is the edge pass
|
|
815
|
+
};
|
|
816
|
+
edgeCommand.uniformMap = uniformMap;
|
|
817
|
+
|
|
818
|
+
edgeCommand.castShadows = false;
|
|
819
|
+
edgeCommand.receiveShadows = false;
|
|
820
|
+
|
|
821
|
+
return edgeCommand;
|
|
822
|
+
}
|
|
823
|
+
|
|
755
824
|
function updateSkipLodStencilCommand(drawCommand, tile, use2D) {
|
|
756
825
|
const stencilDerivedComand = drawCommand._skipLodStencilCommand;
|
|
757
826
|
const stencilCommand = stencilDerivedComand.command;
|
|
@@ -100,6 +100,9 @@ class ModelImagery {
|
|
|
100
100
|
//>>includeEnd('debug');
|
|
101
101
|
|
|
102
102
|
if (!this._hasImagery) {
|
|
103
|
+
// When there is no imagery, make sure to delete any model primitive
|
|
104
|
+
// imageries that may previously have been created
|
|
105
|
+
this._deleteModelPrimitiveImageries();
|
|
103
106
|
return;
|
|
104
107
|
}
|
|
105
108
|
|
|
@@ -215,6 +218,7 @@ class ModelImagery {
|
|
|
215
218
|
modelPrimitiveImagery.destroy();
|
|
216
219
|
}
|
|
217
220
|
delete this._modelPrimitiveImageries;
|
|
221
|
+
this._model.resetDrawCommands();
|
|
218
222
|
}
|
|
219
223
|
|
|
220
224
|
/**
|
|
@@ -92,7 +92,7 @@ function ModelRuntimeNode(options) {
|
|
|
92
92
|
* This is an array of classes, each with a static method called
|
|
93
93
|
* <code>process()</code>.
|
|
94
94
|
*
|
|
95
|
-
* @type {
|
|
95
|
+
* @type {object[]}
|
|
96
96
|
* @readonly
|
|
97
97
|
*
|
|
98
98
|
* @private
|
|
@@ -112,7 +112,7 @@ function ModelRuntimeNode(options) {
|
|
|
112
112
|
/**
|
|
113
113
|
* Update stages to apply to this node.
|
|
114
114
|
*
|
|
115
|
-
* @type {
|
|
115
|
+
* @type {object[]}
|
|
116
116
|
* @readonly
|
|
117
117
|
*
|
|
118
118
|
* @private
|
|
@@ -10,6 +10,8 @@ import CPUStylingPipelineStage from "./CPUStylingPipelineStage.js";
|
|
|
10
10
|
import CustomShaderMode from "./CustomShaderMode.js";
|
|
11
11
|
import CustomShaderPipelineStage from "./CustomShaderPipelineStage.js";
|
|
12
12
|
import DequantizationPipelineStage from "./DequantizationPipelineStage.js";
|
|
13
|
+
import EdgeDetectionPipelineStage from "./EdgeDetectionPipelineStage.js";
|
|
14
|
+
import EdgeVisibilityPipelineStage from "./EdgeVisibilityPipelineStage.js";
|
|
13
15
|
import FeatureIdPipelineStage from "./FeatureIdPipelineStage.js";
|
|
14
16
|
import GeometryPipelineStage from "./GeometryPipelineStage.js";
|
|
15
17
|
import ImageryPipelineStage from "./ImageryPipelineStage.js";
|
|
@@ -88,7 +90,7 @@ function ModelRuntimePrimitive(options) {
|
|
|
88
90
|
* is an array of classes, each with a static method called
|
|
89
91
|
* <code>process()</code>
|
|
90
92
|
*
|
|
91
|
-
* @type {
|
|
93
|
+
* @type {object[]}
|
|
92
94
|
* @readonly
|
|
93
95
|
*
|
|
94
96
|
* @private
|
|
@@ -170,7 +172,7 @@ function ModelRuntimePrimitive(options) {
|
|
|
170
172
|
/**
|
|
171
173
|
* Update stages to apply to this primitive.
|
|
172
174
|
*
|
|
173
|
-
* @type {
|
|
175
|
+
* @type {object[]}
|
|
174
176
|
* @readonly
|
|
175
177
|
*
|
|
176
178
|
* @private
|
|
@@ -244,6 +246,8 @@ ModelRuntimePrimitive.prototype.configurePipeline = function (frameState) {
|
|
|
244
246
|
const hasOutlines =
|
|
245
247
|
model._enableShowOutline && defined(primitive.outlineCoordinates);
|
|
246
248
|
|
|
249
|
+
const hasEdgeVisibility = defined(primitive.edgeVisibility);
|
|
250
|
+
|
|
247
251
|
const featureIdFlags = inspectFeatureIds(model, node, primitive);
|
|
248
252
|
|
|
249
253
|
const hasClassification = defined(model.classificationType);
|
|
@@ -324,6 +328,13 @@ ModelRuntimePrimitive.prototype.configurePipeline = function (frameState) {
|
|
|
324
328
|
pipelineStages.push(PrimitiveOutlinePipelineStage);
|
|
325
329
|
}
|
|
326
330
|
|
|
331
|
+
if (hasEdgeVisibility) {
|
|
332
|
+
// Indicate to Scene (after primitive updates) that the edge MRT should be enabled.
|
|
333
|
+
frameState.edgeVisibilityRequested = true;
|
|
334
|
+
pipelineStages.push(EdgeVisibilityPipelineStage);
|
|
335
|
+
pipelineStages.push(EdgeDetectionPipelineStage);
|
|
336
|
+
}
|
|
337
|
+
|
|
327
338
|
pipelineStages.push(AlphaPipelineStage);
|
|
328
339
|
|
|
329
340
|
pipelineStages.push(PrimitiveStatisticsPipelineStage);
|
|
@@ -72,7 +72,7 @@ function ModelSceneGraph(options) {
|
|
|
72
72
|
/**
|
|
73
73
|
* Pipeline stages to apply across the model.
|
|
74
74
|
*
|
|
75
|
-
* @type {
|
|
75
|
+
* @type {object[]}
|
|
76
76
|
* @readonly
|
|
77
77
|
*
|
|
78
78
|
* @private
|
|
@@ -82,7 +82,7 @@ function ModelSceneGraph(options) {
|
|
|
82
82
|
/**
|
|
83
83
|
* Update stages to apply across the model.
|
|
84
84
|
*
|
|
85
|
-
* @type {
|
|
85
|
+
* @type {object[]}
|
|
86
86
|
* @readonly
|
|
87
87
|
*
|
|
88
88
|
* @private
|
|
@@ -136,7 +136,7 @@ function ModelSceneGraph(options) {
|
|
|
136
136
|
* is an array of classes, each with a static method called
|
|
137
137
|
* <code>process()</code>
|
|
138
138
|
*
|
|
139
|
-
* @type {
|
|
139
|
+
* @type {object[]}
|
|
140
140
|
* @readonly
|
|
141
141
|
*
|
|
142
142
|
* @private
|
|
@@ -985,6 +985,7 @@ function updatePrimitiveShowBoundingVolume(runtimePrimitive, options) {
|
|
|
985
985
|
}
|
|
986
986
|
|
|
987
987
|
const scratchSilhouetteCommands = [];
|
|
988
|
+
const scratchEdgeCommands = [];
|
|
988
989
|
const scratchPushDrawCommandOptions = {
|
|
989
990
|
frameState: undefined,
|
|
990
991
|
hasSilhouette: undefined,
|
|
@@ -1006,6 +1007,10 @@ ModelSceneGraph.prototype.pushDrawCommands = function (frameState) {
|
|
|
1006
1007
|
const silhouetteCommands = scratchSilhouetteCommands;
|
|
1007
1008
|
silhouetteCommands.length = 0;
|
|
1008
1009
|
|
|
1010
|
+
// Gather edge commands for the edge pass
|
|
1011
|
+
const edgeCommands = scratchEdgeCommands;
|
|
1012
|
+
edgeCommands.length = 0;
|
|
1013
|
+
|
|
1009
1014
|
// Since this function is called each frame, the options object is
|
|
1010
1015
|
// preallocated in a scratch variable
|
|
1011
1016
|
const pushDrawCommandOptions = scratchPushDrawCommandOptions;
|
|
@@ -1020,6 +1025,7 @@ ModelSceneGraph.prototype.pushDrawCommands = function (frameState) {
|
|
|
1020
1025
|
);
|
|
1021
1026
|
|
|
1022
1027
|
addAllToArray(frameState.commandList, silhouetteCommands);
|
|
1028
|
+
addAllToArray(frameState.commandList, edgeCommands);
|
|
1023
1029
|
};
|
|
1024
1030
|
|
|
1025
1031
|
// Callback is defined here to avoid allocating a closure in the render loop
|
|
@@ -1029,6 +1035,7 @@ function pushPrimitiveDrawCommands(runtimePrimitive, options) {
|
|
|
1029
1035
|
|
|
1030
1036
|
const passes = frameState.passes;
|
|
1031
1037
|
const silhouetteCommands = scratchSilhouetteCommands;
|
|
1038
|
+
const edgeCommands = scratchEdgeCommands;
|
|
1032
1039
|
const primitiveDrawCommand = runtimePrimitive.drawCommand;
|
|
1033
1040
|
primitiveDrawCommand.pushCommands(frameState, frameState.commandList);
|
|
1034
1041
|
|
|
@@ -1039,6 +1046,11 @@ function pushPrimitiveDrawCommands(runtimePrimitive, options) {
|
|
|
1039
1046
|
if (hasSilhouette && !passes.pick) {
|
|
1040
1047
|
primitiveDrawCommand.pushSilhouetteCommands(frameState, silhouetteCommands);
|
|
1041
1048
|
}
|
|
1049
|
+
|
|
1050
|
+
// Add edge commands to the edge pass
|
|
1051
|
+
if (defined(primitiveDrawCommand.pushEdgeCommands)) {
|
|
1052
|
+
primitiveDrawCommand.pushEdgeCommands(frameState, edgeCommands);
|
|
1053
|
+
}
|
|
1042
1054
|
}
|
|
1043
1055
|
|
|
1044
1056
|
/**
|
|
@@ -118,7 +118,7 @@ function NodeRenderResources(modelRenderResources, runtimeNode) {
|
|
|
118
118
|
* be used to create a {@link VertexArray} for the draw command. Attributes
|
|
119
119
|
* at the node level may be needed for extensions such as EXT_mesh_gpu_instancing.
|
|
120
120
|
*
|
|
121
|
-
* @type {
|
|
121
|
+
* @type {object[]}
|
|
122
122
|
* @readonly
|
|
123
123
|
*
|
|
124
124
|
* @private
|
|
@@ -46,7 +46,7 @@ function PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) {
|
|
|
46
46
|
* The vertex attributes. This is shallow cloned from the node render
|
|
47
47
|
* resources as the primitive will add additional properties.
|
|
48
48
|
*
|
|
49
|
-
* @type {
|
|
49
|
+
* @type {object[]}
|
|
50
50
|
* @readonly
|
|
51
51
|
*
|
|
52
52
|
* @private
|
package/Source/Scene/OIT.js
CHANGED
|
@@ -531,10 +531,20 @@ function getTranslucentShaderProgram(context, shaderProgram, keyword, source) {
|
|
|
531
531
|
|
|
532
532
|
// Discarding the fragment in main is a workaround for ANGLE D3D9
|
|
533
533
|
// shader compilation errors.
|
|
534
|
+
//
|
|
535
|
+
// CESIUM_REDIRECTED_COLOR_OUTPUT: A general-purpose flag to indicate that this shader
|
|
536
|
+
// is a derived/modified version created by Cesium's rendering pipeline.
|
|
537
|
+
// This flag can be used to avoid color attachment conflicts when shaders
|
|
538
|
+
// need different output declarations for different rendering passes.
|
|
539
|
+
// For example, MRT (Multiple Render Targets) features can check this flag
|
|
540
|
+
// to conditionally declare their output variables only when not conflicting
|
|
541
|
+
// with the derived shader's output layout.
|
|
534
542
|
fs.sources.splice(
|
|
535
543
|
0,
|
|
536
544
|
0,
|
|
537
|
-
|
|
545
|
+
`#define CESIUM_REDIRECTED_COLOR_OUTPUT\n` +
|
|
546
|
+
`vec4 czm_out_FragColor;\n` +
|
|
547
|
+
`bool czm_discard = false;\n`,
|
|
538
548
|
);
|
|
539
549
|
|
|
540
550
|
const fragDataMatches = [...source.matchAll(/out_FragData_(\d+)/g)];
|
|
@@ -48,15 +48,14 @@ PickFramebuffer.prototype.begin = function (screenSpaceRectangle, viewport) {
|
|
|
48
48
|
return this._passState;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const colorScratchForPickFramebuffer = new Color();
|
|
52
|
-
|
|
53
51
|
/**
|
|
54
|
-
* Return the picked
|
|
52
|
+
* Return the picked objects rendered within a given rectangle.
|
|
55
53
|
*
|
|
56
54
|
* @param {BoundingRectangle} screenSpaceRectangle
|
|
57
|
-
* @
|
|
55
|
+
* @param {number} [limit=1] If supplied, stop iterating after collecting this many objects.
|
|
56
|
+
* @returns {object[]} A list of rendered objects, ordered by distance to the middle of the rectangle.
|
|
58
57
|
*/
|
|
59
|
-
PickFramebuffer.prototype.end = function (screenSpaceRectangle) {
|
|
58
|
+
PickFramebuffer.prototype.end = function (screenSpaceRectangle, limit = 1) {
|
|
60
59
|
const width = screenSpaceRectangle.width ?? 1.0;
|
|
61
60
|
const height = screenSpaceRectangle.height ?? 1.0;
|
|
62
61
|
|
|
@@ -84,6 +83,7 @@ PickFramebuffer.prototype.end = function (screenSpaceRectangle) {
|
|
|
84
83
|
|
|
85
84
|
// The region does not have to square and the dimensions do not have to be odd, but
|
|
86
85
|
// loop iterations would be wasted. Prefer square regions where the size is odd.
|
|
86
|
+
const objects = new Set();
|
|
87
87
|
for (let i = 0; i < length; ++i) {
|
|
88
88
|
if (
|
|
89
89
|
-halfWidth <= x &&
|
|
@@ -93,22 +93,19 @@ PickFramebuffer.prototype.end = function (screenSpaceRectangle) {
|
|
|
93
93
|
) {
|
|
94
94
|
const index = 4 * ((halfHeight - y) * width + x + halfWidth);
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
const pickColor = Color.bytesToRgba(
|
|
97
|
+
pixels[index],
|
|
98
98
|
pixels[index + 1],
|
|
99
|
-
);
|
|
100
|
-
colorScratchForPickFramebuffer.blue = Color.byteToFloat(
|
|
101
99
|
pixels[index + 2],
|
|
102
|
-
);
|
|
103
|
-
colorScratchForPickFramebuffer.alpha = Color.byteToFloat(
|
|
104
100
|
pixels[index + 3],
|
|
105
101
|
);
|
|
106
102
|
|
|
107
|
-
const object = context.getObjectByPickColor(
|
|
108
|
-
colorScratchForPickFramebuffer,
|
|
109
|
-
);
|
|
103
|
+
const object = context.getObjectByPickColor(pickColor);
|
|
110
104
|
if (defined(object)) {
|
|
111
|
-
|
|
105
|
+
objects.add(object);
|
|
106
|
+
if (objects.size >= limit) {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
111
|
|
|
@@ -123,8 +120,7 @@ PickFramebuffer.prototype.end = function (screenSpaceRectangle) {
|
|
|
123
120
|
x += dx;
|
|
124
121
|
y += dy;
|
|
125
122
|
}
|
|
126
|
-
|
|
127
|
-
return undefined;
|
|
123
|
+
return [...objects];
|
|
128
124
|
};
|
|
129
125
|
|
|
130
126
|
/**
|