@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
|
@@ -13,7 +13,6 @@ import EncodedCartesian3 from "../Core/EncodedCartesian3.js";
|
|
|
13
13
|
import IndexDatatype from "../Core/IndexDatatype.js";
|
|
14
14
|
import CesiumMath from "../Core/Math.js";
|
|
15
15
|
import Matrix4 from "../Core/Matrix4.js";
|
|
16
|
-
import WebGLConstants from "../Core/WebGLConstants.js";
|
|
17
16
|
import Buffer from "../Renderer/Buffer.js";
|
|
18
17
|
import BufferUsage from "../Renderer/BufferUsage.js";
|
|
19
18
|
import ContextLimits from "../Renderer/ContextLimits.js";
|
|
@@ -34,6 +33,7 @@ import SceneMode from "./SceneMode.js";
|
|
|
34
33
|
import SDFSettings from "./SDFSettings.js";
|
|
35
34
|
import TextureAtlas from "../Renderer/TextureAtlas.js";
|
|
36
35
|
import VerticalOrigin from "./VerticalOrigin.js";
|
|
36
|
+
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
37
37
|
|
|
38
38
|
const SHOW_INDEX = Billboard.SHOW_INDEX;
|
|
39
39
|
const POSITION_INDEX = Billboard.POSITION_INDEX;
|
|
@@ -315,6 +315,8 @@ function BillboardCollection(options) {
|
|
|
315
315
|
];
|
|
316
316
|
|
|
317
317
|
this._highlightColor = Color.clone(Color.WHITE); // Only used by Vector3DTilePoints
|
|
318
|
+
this._coarseDepthTestDistance = Ellipsoid.default.minimumRadius / 100;
|
|
319
|
+
this._threePointDepthTestDistance = Ellipsoid.default.minimumRadius / 1000;
|
|
318
320
|
|
|
319
321
|
this._uniforms = {
|
|
320
322
|
u_atlas: () => {
|
|
@@ -323,6 +325,16 @@ function BillboardCollection(options) {
|
|
|
323
325
|
u_highlightColor: () => {
|
|
324
326
|
return this._highlightColor;
|
|
325
327
|
},
|
|
328
|
+
// An eye-space distance, beyond which, the billboard is simply tested against a camera-facing plane at the ellipsoid's center,
|
|
329
|
+
// rather than against a depth texture. Note: only if the disableDepthTestingDistance property permits.
|
|
330
|
+
u_coarseDepthTestDistance: () => {
|
|
331
|
+
return this._coarseDepthTestDistance;
|
|
332
|
+
},
|
|
333
|
+
// Within this distance, if the billboard is clamped to the ground, we'll depth-test 3 key points.
|
|
334
|
+
// If any key point is visible, the whole billboard will be visible.
|
|
335
|
+
u_threePointDepthTestDistance: () => {
|
|
336
|
+
return this._threePointDepthTestDistance;
|
|
337
|
+
},
|
|
326
338
|
};
|
|
327
339
|
|
|
328
340
|
const scene = this._scene;
|
|
@@ -1372,9 +1384,6 @@ function writeCompressedAttribute3(
|
|
|
1372
1384
|
const clampToGround =
|
|
1373
1385
|
isHeightReferenceClamp(billboard.heightReference) &&
|
|
1374
1386
|
frameState.context.depthTexture;
|
|
1375
|
-
if (!defined(disableDepthTestDistance)) {
|
|
1376
|
-
disableDepthTestDistance = clampToGround ? 5000.0 : 0.0;
|
|
1377
|
-
}
|
|
1378
1387
|
|
|
1379
1388
|
disableDepthTestDistance *= disableDepthTestDistance;
|
|
1380
1389
|
if (clampToGround || disableDepthTestDistance > 0.0) {
|
|
@@ -2030,8 +2039,7 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2030
2039
|
) {
|
|
2031
2040
|
this._rsOpaque = RenderState.fromCache({
|
|
2032
2041
|
depthTest: {
|
|
2033
|
-
enabled:
|
|
2034
|
-
func: WebGLConstants.LESS,
|
|
2042
|
+
enabled: false,
|
|
2035
2043
|
},
|
|
2036
2044
|
depthMask: true,
|
|
2037
2045
|
});
|
|
@@ -2042,7 +2050,6 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2042
2050
|
// If OPAQUE_AND_TRANSLUCENT is in use, only the opaque pass gets the benefit of the depth buffer,
|
|
2043
2051
|
// not the translucent pass. Otherwise, if the TRANSLUCENT pass is on its own, it turns on
|
|
2044
2052
|
// a depthMask in lieu of full depth sorting (because it has opaque-ish fragments that look bad in OIT).
|
|
2045
|
-
// When the TRANSLUCENT depth mask is in use, label backgrounds require the depth func to be LEQUAL.
|
|
2046
2053
|
const useTranslucentDepthMask =
|
|
2047
2054
|
this._blendOption === BlendOption.TRANSLUCENT;
|
|
2048
2055
|
|
|
@@ -2052,10 +2059,7 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2052
2059
|
) {
|
|
2053
2060
|
this._rsTranslucent = RenderState.fromCache({
|
|
2054
2061
|
depthTest: {
|
|
2055
|
-
enabled:
|
|
2056
|
-
func: useTranslucentDepthMask
|
|
2057
|
-
? WebGLConstants.LEQUAL
|
|
2058
|
-
: WebGLConstants.LESS,
|
|
2062
|
+
enabled: false,
|
|
2059
2063
|
},
|
|
2060
2064
|
depthMask: useTranslucentDepthMask,
|
|
2061
2065
|
blending: BlendingState.ALPHA_BLEND,
|
|
@@ -2141,9 +2145,9 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2141
2145
|
}
|
|
2142
2146
|
if (this._shaderClampToGround) {
|
|
2143
2147
|
if (supportVSTextureReads) {
|
|
2144
|
-
vs.defines.push("
|
|
2148
|
+
vs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
|
|
2145
2149
|
} else {
|
|
2146
|
-
vs.defines.push("
|
|
2150
|
+
vs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
|
|
2147
2151
|
}
|
|
2148
2152
|
}
|
|
2149
2153
|
|
|
@@ -2162,9 +2166,9 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2162
2166
|
});
|
|
2163
2167
|
if (this._shaderClampToGround) {
|
|
2164
2168
|
if (supportVSTextureReads) {
|
|
2165
|
-
fs.defines.push("
|
|
2169
|
+
fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
|
|
2166
2170
|
} else {
|
|
2167
|
-
fs.defines.push("
|
|
2171
|
+
fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
|
|
2168
2172
|
}
|
|
2169
2173
|
}
|
|
2170
2174
|
|
|
@@ -2187,9 +2191,9 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2187
2191
|
});
|
|
2188
2192
|
if (this._shaderClampToGround) {
|
|
2189
2193
|
if (supportVSTextureReads) {
|
|
2190
|
-
fs.defines.push("
|
|
2194
|
+
fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
|
|
2191
2195
|
} else {
|
|
2192
|
-
fs.defines.push("
|
|
2196
|
+
fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
|
|
2193
2197
|
}
|
|
2194
2198
|
}
|
|
2195
2199
|
if (this._sdf) {
|
|
@@ -2212,9 +2216,9 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2212
2216
|
});
|
|
2213
2217
|
if (this._shaderClampToGround) {
|
|
2214
2218
|
if (supportVSTextureReads) {
|
|
2215
|
-
fs.defines.push("
|
|
2219
|
+
fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
|
|
2216
2220
|
} else {
|
|
2217
|
-
fs.defines.push("
|
|
2221
|
+
fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
|
|
2218
2222
|
}
|
|
2219
2223
|
}
|
|
2220
2224
|
if (this._sdf) {
|
|
@@ -2237,9 +2241,9 @@ BillboardCollection.prototype.update = function (frameState) {
|
|
|
2237
2241
|
});
|
|
2238
2242
|
if (this._shaderClampToGround) {
|
|
2239
2243
|
if (supportVSTextureReads) {
|
|
2240
|
-
fs.defines.push("
|
|
2244
|
+
fs.defines.push("VS_THREE_POINT_DEPTH_CHECK");
|
|
2241
2245
|
} else {
|
|
2242
|
-
fs.defines.push("
|
|
2246
|
+
fs.defines.push("FS_THREE_POINT_DEPTH_CHECK");
|
|
2243
2247
|
}
|
|
2244
2248
|
}
|
|
2245
2249
|
if (this._sdf) {
|
|
@@ -457,7 +457,7 @@ Object.defineProperties(BingMapsImageryProvider.prototype, {
|
|
|
457
457
|
/**
|
|
458
458
|
* Creates an {@link ImageryProvider} which provides tiled imagery using the Bing Maps Imagery REST API.
|
|
459
459
|
*
|
|
460
|
-
* @param {Resource|
|
|
460
|
+
* @param {Resource|string} url The url of the Bing Maps server hosting the imagery.
|
|
461
461
|
* @param {BingMapsImageryProvider.ConstructorOptions} options Object describing initialization options
|
|
462
462
|
* @returns {Promise<BingMapsImageryProvider>} A promise that resolves to the created BingMapsImageryProvider
|
|
463
463
|
*
|
|
@@ -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
|
/**
|