@cesium/engine 13.1.0 → 15.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-APCS5YJI.js → chunk-25TOENEE.js} +7 -7
- package/Build/Workers/{chunk-FNCXBBCF.js → chunk-2AVIUB5H.js} +2 -2
- package/Build/Workers/{chunk-OZTFRHA2.js → chunk-3JZGPJMZ.js} +6 -6
- package/Build/Workers/{chunk-5JY4LYO3.js → chunk-3LHBH4TC.js} +7 -7
- package/Build/Workers/{chunk-MGABCOOH.js → chunk-3LZF23RY.js} +6 -6
- package/Build/Workers/{chunk-AXYZUG4N.js → chunk-5S2B46UQ.js} +1 -1
- package/Build/Workers/{chunk-2SRHVCFD.js → chunk-67ONR44K.js} +6 -6
- package/Build/Workers/{chunk-PBJQFLKS.js → chunk-6EDBC234.js} +11 -11
- package/Build/Workers/{chunk-GSLKQJM2.js → chunk-6EV4VOET.js} +10 -10
- package/Build/Workers/{chunk-OGRXNUR2.js → chunk-7ITUZTFH.js} +1 -1
- package/Build/Workers/{chunk-IP7F2MVW.js → chunk-ARVZCY6X.js} +7 -7
- package/Build/Workers/{chunk-EYZFEJX3.js → chunk-B2UQN3DH.js} +6 -6
- package/Build/Workers/{chunk-WE4KF4AM.js → chunk-B2Y4ZS6X.js} +9 -9
- package/Build/Workers/{chunk-DWIKWWEE.js → chunk-BD2TPFGC.js} +5 -5
- package/Build/Workers/{chunk-5ICYLS6B.js → chunk-CHX2K5AC.js} +10 -10
- package/Build/Workers/{chunk-NQDKNE7V.js → chunk-CJGVEABL.js} +13 -13
- package/Build/Workers/{chunk-B34JXFHF.js → chunk-DYJHEP3B.js} +5 -5
- package/Build/Workers/{chunk-J7BMSSY7.js → chunk-E3H7AVMK.js} +13 -13
- package/Build/Workers/{chunk-TOHDFUJM.js → chunk-EZNAJPP5.js} +4 -4
- package/Build/Workers/{chunk-K62EHZFT.js → chunk-F7ZI463G.js} +15 -15
- package/Build/Workers/{chunk-EJ5DT5BP.js → chunk-FMZ5CX6V.js} +1 -1
- package/Build/Workers/{chunk-OARMSJUU.js → chunk-FRAWHNSR.js} +2 -2
- package/Build/Workers/{chunk-S3UM4OKP.js → chunk-GGV2XJHE.js} +7 -7
- package/Build/Workers/{chunk-SAKQO5NX.js → chunk-GK4QU6QI.js} +2 -2
- package/Build/Workers/{chunk-LFUFGHL3.js → chunk-HYPB7FAV.js} +10 -10
- package/Build/Workers/{chunk-3SCCWLZS.js → chunk-I4HO2ED2.js} +9 -9
- package/Build/Workers/{chunk-K6SQV4IS.js → chunk-IGINOLDX.js} +6 -6
- package/Build/Workers/{chunk-IXNXKVOB.js → chunk-ISQSYLZY.js} +4 -4
- package/Build/Workers/{chunk-PM76TX2X.js → chunk-JZAMRL5I.js} +6 -6
- package/Build/Workers/{chunk-CBE4HRBH.js → chunk-K5G2WELR.js} +7 -7
- package/Build/Workers/{chunk-EHGQQA7C.js → chunk-L5SO4Y5V.js} +1 -1
- package/Build/Workers/{chunk-M2AA2ARJ.js → chunk-LCMJQVIF.js} +11 -11
- package/Build/Workers/{chunk-HI73PIPQ.js → chunk-MWJW37I7.js} +2 -2
- package/Build/Workers/{chunk-WAJNX74N.js → chunk-NAGMYRDW.js} +27 -20
- package/Build/Workers/{chunk-WUIDEXAN.js → chunk-OYO6TKMU.js} +7 -7
- package/Build/Workers/{chunk-YVGU235V.js → chunk-PUTA3AE2.js} +4 -4
- package/Build/Workers/{chunk-ZWSWJYJP.js → chunk-Q5BHMNKU.js} +13 -13
- package/Build/Workers/{chunk-LQT2ZK7D.js → chunk-QTEX3Y4V.js} +17 -17
- package/Build/Workers/{chunk-UBAHTE4Q.js → chunk-QZKN2RXM.js} +1 -1
- package/Build/Workers/{chunk-T34EOLFR.js → chunk-RO2Z3LCR.js} +14 -14
- package/Build/Workers/{chunk-PTFIVVLX.js → chunk-RRN6LRDX.js} +12 -12
- package/Build/Workers/{chunk-B6IJY6AN.js → chunk-SLIA3GQP.js} +7 -7
- package/Build/Workers/{chunk-GIOZHX7U.js → chunk-TFCOEX3W.js} +2 -2
- package/Build/Workers/{chunk-KRVALCCI.js → chunk-TU6ZXHVU.js} +5 -5
- package/Build/Workers/{chunk-54I6VSRP.js → chunk-VJ2PDF64.js} +6 -6
- package/Build/Workers/{chunk-BMFWWTD7.js → chunk-VMVPONIV.js} +5 -5
- package/Build/Workers/{chunk-CNPP6TQ2.js → chunk-WPXU45PH.js} +4 -4
- package/Build/Workers/{chunk-2ONAV62A.js → chunk-XDHM4G3P.js} +7 -7
- package/Build/Workers/{chunk-KO232FLP.js → chunk-XED3RXKO.js} +2 -2
- package/Build/Workers/{chunk-5I3LPAS7.js → chunk-YNYCGTQH.js} +5 -5
- package/Build/Workers/{chunk-THDHWSEJ.js → chunk-Z4SI54EB.js} +4 -4
- package/Build/Workers/{chunk-R2KGFZBA.js → chunk-ZVDLC3T4.js} +13 -13
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +24 -24
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +27 -27
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +20 -20
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +30 -30
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createPolylineGeometry.js +23 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
- package/Build/Workers/createRectangleGeometry.js +25 -25
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
- package/Build/Workers/createSimplePolylineGeometry.js +21 -21
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +20 -20
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +22 -22
- package/Build/Workers/createWallOutlineGeometry.js +21 -21
- package/Build/Workers/decodeDraco.js +15 -14
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +50 -43
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/Color.js +3 -3
- package/Source/Core/Credit.js +3 -3
- package/Source/Core/DistanceDisplayCondition.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/OrientedBoundingBox.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +26 -4
- package/Source/Core/Spherical.js +3 -3
- package/Source/Core/TexturePacker.js +166 -0
- package/Source/Core/writeTextToCanvas.js +0 -1
- package/Source/DataSources/BillboardVisualizer.js +3 -3
- package/Source/DataSources/BoundingSphereState.js +3 -3
- package/Source/DataSources/DataSourceClock.js +1 -1
- package/Source/DataSources/DataSourceDisplay.js +5 -2
- package/Source/DataSources/EntityCluster.js +44 -19
- package/Source/Renderer/AutomaticUniforms.js +2 -2
- package/Source/Renderer/Context.js +0 -4
- package/Source/Renderer/Texture.js +6 -5
- package/Source/Renderer/TextureAtlas.js +802 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +87 -142
- package/Source/Scene/BillboardCollection.js +132 -202
- package/Source/Scene/BillboardLoadState.js +44 -0
- package/Source/Scene/BillboardTexture.js +348 -0
- package/Source/Scene/Camera.js +2 -2
- package/Source/Scene/Cesium3DTile.js +56 -28
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +403 -132
- package/Source/Scene/Cesium3DTilesetStatistics.js +0 -1
- package/Source/Scene/ClippingPolygon.js +2 -2
- package/Source/Scene/Expression.js +1 -0
- package/Source/Scene/GltfDracoLoader.js +45 -0
- package/Source/Scene/GltfIndexBufferLoader.js +5 -0
- package/Source/Scene/GltfLoader.js +22 -9
- package/Source/Scene/GltfVertexBufferLoader.js +13 -0
- package/Source/Scene/ITwinData.js +47 -1
- package/Source/Scene/ImageryLayer.js +1 -1
- package/Source/Scene/ImplicitSubtree.js +2 -0
- package/Source/Scene/KeyframeNode.js +16 -2
- package/Source/Scene/Label.js +1 -1
- package/Source/Scene/LabelCollection.js +212 -193
- package/Source/Scene/Megatexture.js +145 -81
- package/Source/Scene/Model/CustomShader.js +0 -2
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/Model/ModelUtility.js +5 -1
- package/Source/Scene/Multiple3DTileContent.js +21 -8
- package/Source/Scene/PointPrimitive.js +1 -1
- package/Source/Scene/ResourceCache.js +17 -1
- package/Source/Scene/Scene.js +39 -15
- package/Source/Scene/ScreenSpaceCameraController.js +0 -8
- package/Source/Scene/SpatialNode.js +4 -11
- package/Source/Scene/Vector3DTilePoints.js +2 -5
- package/Source/Scene/VoxelBoxShape.js +12 -5
- package/Source/Scene/VoxelCell.js +6 -5
- package/Source/Scene/VoxelContent.js +171 -107
- package/Source/Scene/VoxelCylinderShape.js +65 -58
- package/Source/Scene/VoxelEllipsoidShape.js +15 -5
- package/Source/Scene/VoxelMetadataOrder.js +12 -0
- package/Source/Scene/VoxelPrimitive.js +245 -53
- package/Source/Scene/VoxelProvider.js +44 -29
- package/Source/Scene/VoxelRenderResources.js +30 -7
- package/Source/Scene/VoxelShape.js +10 -3
- package/Source/Scene/VoxelTraversal.js +326 -166
- package/Source/Scene/WebMapTileServiceImageryProvider.js +2 -2
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +5 -8
- package/Source/Scene/processVoxelProperties.js +3 -0
- package/Source/Shaders/GlobeFS.glsl +10 -1
- package/Source/Shaders/GlobeFS.js +10 -1
- package/Source/Shaders/PolylineCommon.glsl +1 -1
- package/Source/Shaders/PolylineCommon.js +1 -1
- package/Source/Shaders/Voxels/Megatexture.glsl +4 -16
- package/Source/Shaders/Voxels/Megatexture.js +4 -16
- package/Source/Shaders/Voxels/Octree.glsl +44 -7
- package/Source/Shaders/Voxels/Octree.js +44 -7
- package/Source/Shaders/Voxels/VoxelFS.glsl +9 -15
- package/Source/Shaders/Voxels/VoxelFS.js +9 -15
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +15 -15
- package/Source/Shaders/Voxels/convertUvToCylinder.js +15 -15
- package/Source/Widget/CesiumWidget.js +16 -10
- package/Source/Workers/decodeDraco.js +4 -4
- package/index.d.ts +321 -110
- package/index.js +209 -205
- package/package.json +2 -2
- package/Source/Scene/TextureAtlas.js +0 -558
|
@@ -2,29 +2,32 @@ import buildVoxelDrawCommands from "./buildVoxelDrawCommands.js";
|
|
|
2
2
|
import Cartesian2 from "../Core/Cartesian2.js";
|
|
3
3
|
import Cartesian3 from "../Core/Cartesian3.js";
|
|
4
4
|
import Cartesian4 from "../Core/Cartesian4.js";
|
|
5
|
+
import Cartographic from "../Core/Cartographic.js";
|
|
6
|
+
import Cesium3DTilesetStatistics from "./Cesium3DTilesetStatistics.js";
|
|
5
7
|
import CesiumMath from "../Core/Math.js";
|
|
6
8
|
import Check from "../Core/Check.js";
|
|
7
|
-
import clone from "../Core/clone.js";
|
|
8
9
|
import Color from "../Core/Color.js";
|
|
10
|
+
import ClippingPlaneCollection from "./ClippingPlaneCollection.js";
|
|
11
|
+
import clone from "../Core/clone.js";
|
|
12
|
+
import CustomShader from "./Model/CustomShader.js";
|
|
9
13
|
import defaultValue from "../Core/defaultValue.js";
|
|
10
14
|
import defined from "../Core/defined.js";
|
|
11
15
|
import destroyObject from "../Core/destroyObject.js";
|
|
16
|
+
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
12
17
|
import Event from "../Core/Event.js";
|
|
13
18
|
import JulianDate from "../Core/JulianDate.js";
|
|
19
|
+
import Material from "./Material.js";
|
|
14
20
|
import Matrix3 from "../Core/Matrix3.js";
|
|
15
21
|
import Matrix4 from "../Core/Matrix4.js";
|
|
16
|
-
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
17
|
-
import ClippingPlaneCollection from "./ClippingPlaneCollection.js";
|
|
18
|
-
import Material from "./Material.js";
|
|
19
22
|
import MetadataComponentType from "./MetadataComponentType.js";
|
|
20
23
|
import MetadataType from "./MetadataType.js";
|
|
24
|
+
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
21
25
|
import PolylineCollection from "./PolylineCollection.js";
|
|
26
|
+
import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
27
|
+
import VoxelContent from "./VoxelContent.js";
|
|
22
28
|
import VoxelShapeType from "./VoxelShapeType.js";
|
|
23
29
|
import VoxelTraversal from "./VoxelTraversal.js";
|
|
24
|
-
import
|
|
25
|
-
import Cartographic from "../Core/Cartographic.js";
|
|
26
|
-
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
27
|
-
import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
30
|
+
import VoxelMetadataOrder from "./VoxelMetadataOrder.js";
|
|
28
31
|
|
|
29
32
|
/**
|
|
30
33
|
* A primitive that renders voxel data from a {@link VoxelProvider}.
|
|
@@ -37,6 +40,7 @@ import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
|
37
40
|
* @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix used to transform the primitive.
|
|
38
41
|
* @param {CustomShader} [options.customShader] The custom shader used to style the primitive.
|
|
39
42
|
* @param {Clock} [options.clock] The clock used to control time dynamic behavior.
|
|
43
|
+
* @param {Boolean} [options.calculateStatistics] Generate statistics for performance profile.
|
|
40
44
|
*
|
|
41
45
|
* @see VoxelProvider
|
|
42
46
|
* @see Cesium3DTilesVoxelProvider
|
|
@@ -70,6 +74,18 @@ function VoxelPrimitive(options) {
|
|
|
70
74
|
*/
|
|
71
75
|
this._traversal = undefined;
|
|
72
76
|
|
|
77
|
+
/**
|
|
78
|
+
* @type {Cesium3DTilesetStatistics}
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
this._statistics = new Cesium3DTilesetStatistics();
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
this._calculateStatistics = defaultValue(options.calculateStatistics, false);
|
|
88
|
+
|
|
73
89
|
/**
|
|
74
90
|
* This member is not created until the provider is ready.
|
|
75
91
|
*
|
|
@@ -84,6 +100,22 @@ function VoxelPrimitive(options) {
|
|
|
84
100
|
*/
|
|
85
101
|
this._shapeVisible = false;
|
|
86
102
|
|
|
103
|
+
/**
|
|
104
|
+
* This member is not created until the provider is ready.
|
|
105
|
+
*
|
|
106
|
+
* @type {Cartesian3}
|
|
107
|
+
* @private
|
|
108
|
+
*/
|
|
109
|
+
this._dimensions = new Cartesian3();
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* This member is not created until the provider is ready.
|
|
113
|
+
*
|
|
114
|
+
* @type {Cartesian3}
|
|
115
|
+
* @private
|
|
116
|
+
*/
|
|
117
|
+
this._inputDimensions = new Cartesian3();
|
|
118
|
+
|
|
87
119
|
/**
|
|
88
120
|
* This member is not created until the provider is ready.
|
|
89
121
|
*
|
|
@@ -411,6 +443,7 @@ function VoxelPrimitive(options) {
|
|
|
411
443
|
megatextureSliceSizeUv: new Cartesian2(),
|
|
412
444
|
megatextureTileSizeUv: new Cartesian2(),
|
|
413
445
|
dimensions: new Cartesian3(),
|
|
446
|
+
inputDimensions: new Cartesian3(),
|
|
414
447
|
paddingBefore: new Cartesian3(),
|
|
415
448
|
paddingAfter: new Cartesian3(),
|
|
416
449
|
transformPositionViewToUv: new Matrix4(),
|
|
@@ -450,6 +483,123 @@ function VoxelPrimitive(options) {
|
|
|
450
483
|
}
|
|
451
484
|
}
|
|
452
485
|
|
|
486
|
+
/**
|
|
487
|
+
* The event fired to indicate that a tile's content was loaded.
|
|
488
|
+
* <p>
|
|
489
|
+
* This event is fired during the tileset traversal while the frame is being rendered
|
|
490
|
+
* so that updates to the tile take effect in the same frame. Do not create or modify
|
|
491
|
+
* Cesium entities or primitives during the event listener.
|
|
492
|
+
* </p>
|
|
493
|
+
*
|
|
494
|
+
* @type {Event}
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* voxelPrimitive.tileLoad.addEventListener(function() {
|
|
498
|
+
* console.log('A tile was loaded.');
|
|
499
|
+
* });
|
|
500
|
+
*/
|
|
501
|
+
this.tileLoad = new Event();
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* This event fires once for each visible tile in a frame.
|
|
505
|
+
* <p>
|
|
506
|
+
* This event is fired during the traversal while the frame is being rendered.
|
|
507
|
+
*
|
|
508
|
+
* @type {Event}
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* voxelPrimitive.tileVisible.addEventListener(function() {
|
|
512
|
+
* console.log('A tile is visible.');
|
|
513
|
+
* });
|
|
514
|
+
*
|
|
515
|
+
*/
|
|
516
|
+
this.tileVisible = new Event();
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* The event fired to indicate that a tile's content failed to load.
|
|
520
|
+
*
|
|
521
|
+
* @type {Event}
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* voxelPrimitive.tileFailed.addEventListener(function() {
|
|
525
|
+
* console.log('An error occurred loading tile.');
|
|
526
|
+
* });
|
|
527
|
+
*/
|
|
528
|
+
this.tileFailed = new Event();
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* The event fired to indicate that a tile's content was unloaded.
|
|
532
|
+
*
|
|
533
|
+
* @type {Event}
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
* voxelPrimitive.tileUnload.addEventListener(function() {
|
|
537
|
+
* console.log('A tile was unloaded from the cache.');
|
|
538
|
+
* });
|
|
539
|
+
*
|
|
540
|
+
*/
|
|
541
|
+
this.tileUnload = new Event();
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The event fired to indicate progress of loading new tiles. This event is fired when a new tile
|
|
545
|
+
* is requested, when a requested tile is finished downloading, and when a downloaded tile has been
|
|
546
|
+
* processed and is ready to render.
|
|
547
|
+
* <p>
|
|
548
|
+
* The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles
|
|
549
|
+
* processing, <code>numberOfTilesProcessing</code> are passed to the event listener.
|
|
550
|
+
* </p>
|
|
551
|
+
* <p>
|
|
552
|
+
* This event is fired at the end of the frame after the scene is rendered.
|
|
553
|
+
* </p>
|
|
554
|
+
*
|
|
555
|
+
* @type {Event}
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* voxelPrimitive.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
|
|
559
|
+
* if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
|
|
560
|
+
* console.log('Finished loading');
|
|
561
|
+
* return;
|
|
562
|
+
* }
|
|
563
|
+
*
|
|
564
|
+
* console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`);
|
|
565
|
+
* });
|
|
566
|
+
*/
|
|
567
|
+
this.loadProgress = new Event();
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The voxel
|
|
571
|
+
* primitive is completely loaded for this view.
|
|
572
|
+
* <p>
|
|
573
|
+
* This event is fired at the end of the frame after the scene is rendered.
|
|
574
|
+
* </p>
|
|
575
|
+
*
|
|
576
|
+
* @type {Event}
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* voxelPrimitive.allTilesLoaded.addEventListener(function() {
|
|
580
|
+
* console.log('All tiles are loaded');
|
|
581
|
+
* });
|
|
582
|
+
*/
|
|
583
|
+
this.allTilesLoaded = new Event();
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
|
|
587
|
+
* is fired once when all tiles in the initial view are loaded.
|
|
588
|
+
* <p>
|
|
589
|
+
* This event is fired at the end of the frame after the scene is rendered.
|
|
590
|
+
* </p>
|
|
591
|
+
*
|
|
592
|
+
* @type {Event}
|
|
593
|
+
*
|
|
594
|
+
* @example
|
|
595
|
+
* voxelPrimitive.initialTilesLoaded.addEventListener(function() {
|
|
596
|
+
* console.log('Initial tiles are loaded');
|
|
597
|
+
* });
|
|
598
|
+
*
|
|
599
|
+
* @see Cesium3DTileset#allTilesLoaded
|
|
600
|
+
*/
|
|
601
|
+
this.initialTilesLoaded = new Event();
|
|
602
|
+
|
|
453
603
|
// If the provider fails to initialize the primitive will fail too.
|
|
454
604
|
const provider = this._provider;
|
|
455
605
|
initialize(this, provider);
|
|
@@ -581,7 +731,8 @@ Object.defineProperties(VoxelPrimitive.prototype, {
|
|
|
581
731
|
},
|
|
582
732
|
|
|
583
733
|
/**
|
|
584
|
-
* Gets the voxel
|
|
734
|
+
* Gets the dimensions of each voxel tile, in z-up orientation.
|
|
735
|
+
* Does not include padding.
|
|
585
736
|
*
|
|
586
737
|
* @memberof VoxelPrimitive.prototype
|
|
587
738
|
* @type {Cartesian3}
|
|
@@ -589,7 +740,46 @@ Object.defineProperties(VoxelPrimitive.prototype, {
|
|
|
589
740
|
*/
|
|
590
741
|
dimensions: {
|
|
591
742
|
get: function () {
|
|
592
|
-
return this.
|
|
743
|
+
return this._dimensions;
|
|
744
|
+
},
|
|
745
|
+
},
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Gets the dimensions of one tile of the input voxel data, in the input orientation.
|
|
749
|
+
* Includes padding.
|
|
750
|
+
* @memberof VoxelPrimitive.prototype
|
|
751
|
+
* @type {Cartesian3}
|
|
752
|
+
* @readonly
|
|
753
|
+
*/
|
|
754
|
+
inputDimensions: {
|
|
755
|
+
get: function () {
|
|
756
|
+
return this._inputDimensions;
|
|
757
|
+
},
|
|
758
|
+
},
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Gets the padding before the voxel data.
|
|
762
|
+
*
|
|
763
|
+
* @memberof VoxelPrimitive.prototype
|
|
764
|
+
* @type {Cartesian3}
|
|
765
|
+
* @readonly
|
|
766
|
+
*/
|
|
767
|
+
paddingBefore: {
|
|
768
|
+
get: function () {
|
|
769
|
+
return this._paddingBefore;
|
|
770
|
+
},
|
|
771
|
+
},
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* Gets the padding after the voxel data.
|
|
775
|
+
*
|
|
776
|
+
* @memberof VoxelPrimitive.prototype
|
|
777
|
+
* @type {Cartesian3}
|
|
778
|
+
* @readonly
|
|
779
|
+
*/
|
|
780
|
+
paddingAfter: {
|
|
781
|
+
get: function () {
|
|
782
|
+
return this._paddingAfter;
|
|
593
783
|
},
|
|
594
784
|
},
|
|
595
785
|
|
|
@@ -935,9 +1125,21 @@ Object.defineProperties(VoxelPrimitive.prototype, {
|
|
|
935
1125
|
return this._customShaderCompilationEvent;
|
|
936
1126
|
},
|
|
937
1127
|
},
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Loading and rendering information for requested content
|
|
1131
|
+
* To use `visited` and `numberOfTilesWithContentReady` statistics, set options._calculateStatistics` to `true` in the constructor.
|
|
1132
|
+
* @type {Cesium3DTilesetStatistics}
|
|
1133
|
+
* @readonly
|
|
1134
|
+
* @private
|
|
1135
|
+
*/
|
|
1136
|
+
statistics: {
|
|
1137
|
+
get: function () {
|
|
1138
|
+
return this._statistics;
|
|
1139
|
+
},
|
|
1140
|
+
},
|
|
938
1141
|
});
|
|
939
1142
|
|
|
940
|
-
const scratchDimensions = new Cartesian3();
|
|
941
1143
|
const scratchIntersect = new Cartesian4();
|
|
942
1144
|
const scratchNdcAabb = new Cartesian4();
|
|
943
1145
|
const scratchScale = new Cartesian3();
|
|
@@ -1273,8 +1475,12 @@ function initFromProvider(primitive, provider, context) {
|
|
|
1273
1475
|
|
|
1274
1476
|
// Set uniforms that come from the provider.
|
|
1275
1477
|
// Note that minBounds and maxBounds can be set dynamically, so their uniforms aren't set here.
|
|
1276
|
-
|
|
1478
|
+
primitive._dimensions = Cartesian3.clone(
|
|
1277
1479
|
provider.dimensions,
|
|
1480
|
+
primitive._dimensions,
|
|
1481
|
+
);
|
|
1482
|
+
uniforms.dimensions = Cartesian3.clone(
|
|
1483
|
+
primitive._dimensions,
|
|
1278
1484
|
uniforms.dimensions,
|
|
1279
1485
|
);
|
|
1280
1486
|
primitive._paddingBefore = Cartesian3.clone(
|
|
@@ -1287,15 +1493,37 @@ function initFromProvider(primitive, provider, context) {
|
|
|
1287
1493
|
);
|
|
1288
1494
|
primitive._paddingAfter = Cartesian3.clone(
|
|
1289
1495
|
defaultValue(provider.paddingAfter, Cartesian3.ZERO),
|
|
1290
|
-
primitive.
|
|
1496
|
+
primitive._paddingAfter,
|
|
1291
1497
|
);
|
|
1292
1498
|
uniforms.paddingAfter = Cartesian3.clone(
|
|
1293
1499
|
primitive._paddingAfter,
|
|
1294
1500
|
uniforms.paddingAfter,
|
|
1295
1501
|
);
|
|
1502
|
+
primitive._inputDimensions = Cartesian3.add(
|
|
1503
|
+
primitive._dimensions,
|
|
1504
|
+
primitive._paddingBefore,
|
|
1505
|
+
primitive._inputDimensions,
|
|
1506
|
+
);
|
|
1507
|
+
primitive._inputDimensions = Cartesian3.add(
|
|
1508
|
+
primitive._inputDimensions,
|
|
1509
|
+
primitive._paddingAfter,
|
|
1510
|
+
primitive._inputDimensions,
|
|
1511
|
+
);
|
|
1512
|
+
if (provider.metadataOrder === VoxelMetadataOrder.GLTF) {
|
|
1513
|
+
const inputDimensionsY = primitive._inputDimensions.y;
|
|
1514
|
+
primitive._inputDimensions.y = primitive._inputDimensions.z;
|
|
1515
|
+
primitive._inputDimensions.z = inputDimensionsY;
|
|
1516
|
+
}
|
|
1517
|
+
uniforms.inputDimensions = Cartesian3.clone(
|
|
1518
|
+
primitive._inputDimensions,
|
|
1519
|
+
uniforms.inputDimensions,
|
|
1520
|
+
);
|
|
1296
1521
|
|
|
1297
1522
|
// Create the VoxelTraversal, and set related uniforms
|
|
1298
|
-
|
|
1523
|
+
const keyframeCount = defaultValue(provider.keyframeCount, 1);
|
|
1524
|
+
primitive._traversal = new VoxelTraversal(primitive, context, keyframeCount);
|
|
1525
|
+
primitive.statistics.texturesByteLength =
|
|
1526
|
+
primitive._traversal.textureMemoryByteLength;
|
|
1299
1527
|
setTraversalUniforms(primitive._traversal, uniforms);
|
|
1300
1528
|
}
|
|
1301
1529
|
|
|
@@ -1432,44 +1660,6 @@ function updateShapeAndTransforms(primitive, shape, provider) {
|
|
|
1432
1660
|
return true;
|
|
1433
1661
|
}
|
|
1434
1662
|
|
|
1435
|
-
/**
|
|
1436
|
-
* Set up a VoxelTraversal based on dimensions and types from the primitive and provider
|
|
1437
|
-
* @param {VoxelPrimitive} primitive
|
|
1438
|
-
* @param {VoxelProvider} provider
|
|
1439
|
-
* @param {Context} context
|
|
1440
|
-
* @returns {VoxelTraversal}
|
|
1441
|
-
* @private
|
|
1442
|
-
*/
|
|
1443
|
-
function setupTraversal(primitive, provider, context) {
|
|
1444
|
-
const dimensions = Cartesian3.clone(provider.dimensions, scratchDimensions);
|
|
1445
|
-
Cartesian3.add(dimensions, primitive._paddingBefore, dimensions);
|
|
1446
|
-
Cartesian3.add(dimensions, primitive._paddingAfter, dimensions);
|
|
1447
|
-
|
|
1448
|
-
// It's ok for memory byte length to be undefined.
|
|
1449
|
-
// The system will choose a default memory size.
|
|
1450
|
-
const maximumTileCount = provider.maximumTileCount;
|
|
1451
|
-
const maximumTextureMemoryByteLength = defined(maximumTileCount)
|
|
1452
|
-
? VoxelTraversal.getApproximateTextureMemoryByteLength(
|
|
1453
|
-
maximumTileCount,
|
|
1454
|
-
dimensions,
|
|
1455
|
-
provider.types,
|
|
1456
|
-
provider.componentTypes,
|
|
1457
|
-
)
|
|
1458
|
-
: undefined;
|
|
1459
|
-
|
|
1460
|
-
const keyframeCount = defaultValue(provider.keyframeCount, 1);
|
|
1461
|
-
|
|
1462
|
-
return new VoxelTraversal(
|
|
1463
|
-
primitive,
|
|
1464
|
-
context,
|
|
1465
|
-
dimensions,
|
|
1466
|
-
provider.types,
|
|
1467
|
-
provider.componentTypes,
|
|
1468
|
-
keyframeCount,
|
|
1469
|
-
maximumTextureMemoryByteLength,
|
|
1470
|
-
);
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
1663
|
/**
|
|
1474
1664
|
* Set uniforms that come from the traversal.
|
|
1475
1665
|
* @param {VoxelTraversal} traversal
|
|
@@ -1674,6 +1864,7 @@ VoxelPrimitive.prototype.destroy = function () {
|
|
|
1674
1864
|
|
|
1675
1865
|
this._pickId = this._pickId && this._pickId.destroy();
|
|
1676
1866
|
this._traversal = this._traversal && this._traversal.destroy();
|
|
1867
|
+
this.statistics.texturesByteLength = 0;
|
|
1677
1868
|
this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();
|
|
1678
1869
|
|
|
1679
1870
|
return destroyObject(this);
|
|
@@ -1955,7 +2146,8 @@ DefaultVoxelProvider.prototype.requestData = function (options) {
|
|
|
1955
2146
|
return undefined;
|
|
1956
2147
|
}
|
|
1957
2148
|
|
|
1958
|
-
|
|
2149
|
+
const content = new VoxelContent({ metadata: [new Float32Array(1)] });
|
|
2150
|
+
return Promise.resolve(content);
|
|
1959
2151
|
};
|
|
1960
2152
|
|
|
1961
2153
|
VoxelPrimitive.DefaultProvider = new DefaultVoxelProvider();
|
|
@@ -19,10 +19,11 @@ function VoxelProvider() {
|
|
|
19
19
|
|
|
20
20
|
Object.defineProperties(VoxelProvider.prototype, {
|
|
21
21
|
/**
|
|
22
|
-
* A transform from local space to global space.
|
|
22
|
+
* A transform from local space to global space.
|
|
23
23
|
*
|
|
24
24
|
* @memberof VoxelProvider.prototype
|
|
25
|
-
* @type {Matrix4
|
|
25
|
+
* @type {Matrix4}
|
|
26
|
+
* @default Matrix4.IDENTITY
|
|
26
27
|
* @readonly
|
|
27
28
|
*/
|
|
28
29
|
globalTransform: {
|
|
@@ -30,10 +31,11 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
30
31
|
},
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
* A transform from shape space to local space.
|
|
34
|
+
* A transform from shape space to local space.
|
|
34
35
|
*
|
|
35
36
|
* @memberof VoxelProvider.prototype
|
|
36
|
-
* @type {Matrix4
|
|
37
|
+
* @type {Matrix4}
|
|
38
|
+
* @default Matrix4.IDENTITY
|
|
37
39
|
* @readonly
|
|
38
40
|
*/
|
|
39
41
|
shapeTransform: {
|
|
@@ -42,7 +44,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
46
|
* Gets the {@link VoxelShapeType}
|
|
45
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
46
47
|
*
|
|
47
48
|
* @memberof VoxelProvider.prototype
|
|
48
49
|
* @type {VoxelShapeType}
|
|
@@ -55,7 +56,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
55
56
|
/**
|
|
56
57
|
* Gets the minimum bounds.
|
|
57
58
|
* If undefined, the shape's default minimum bounds will be used instead.
|
|
58
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
59
59
|
*
|
|
60
60
|
* @memberof VoxelProvider.prototype
|
|
61
61
|
* @type {Cartesian3|undefined}
|
|
@@ -68,7 +68,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
68
68
|
/**
|
|
69
69
|
* Gets the maximum bounds.
|
|
70
70
|
* If undefined, the shape's default maximum bounds will be used instead.
|
|
71
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
72
71
|
*
|
|
73
72
|
* @memberof VoxelProvider.prototype
|
|
74
73
|
* @type {Cartesian3|undefined}
|
|
@@ -80,7 +79,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
80
79
|
|
|
81
80
|
/**
|
|
82
81
|
* Gets the number of voxels per dimension of a tile. This is the same for all tiles in the dataset.
|
|
83
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
84
82
|
*
|
|
85
83
|
* @memberof VoxelProvider.prototype
|
|
86
84
|
* @type {Cartesian3}
|
|
@@ -92,10 +90,10 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
92
90
|
|
|
93
91
|
/**
|
|
94
92
|
* Gets the number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
|
|
95
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
96
93
|
*
|
|
97
94
|
* @memberof VoxelProvider.prototype
|
|
98
|
-
* @type {Cartesian3
|
|
95
|
+
* @type {Cartesian3}
|
|
96
|
+
* @default Cartesian3.ZERO
|
|
99
97
|
* @readonly
|
|
100
98
|
*/
|
|
101
99
|
paddingBefore: {
|
|
@@ -104,10 +102,10 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
104
102
|
|
|
105
103
|
/**
|
|
106
104
|
* Gets the number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
|
|
107
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
108
105
|
*
|
|
109
106
|
* @memberof VoxelProvider.prototype
|
|
110
|
-
* @type {Cartesian3
|
|
107
|
+
* @type {Cartesian3}
|
|
108
|
+
* @default Cartesian3.ZERO
|
|
111
109
|
* @readonly
|
|
112
110
|
*/
|
|
113
111
|
paddingAfter: {
|
|
@@ -116,7 +114,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
116
114
|
|
|
117
115
|
/**
|
|
118
116
|
* Gets the metadata names.
|
|
119
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
120
117
|
*
|
|
121
118
|
* @memberof VoxelProvider.prototype
|
|
122
119
|
* @type {string[]}
|
|
@@ -128,7 +125,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
128
125
|
|
|
129
126
|
/**
|
|
130
127
|
* Gets the metadata types.
|
|
131
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
132
128
|
*
|
|
133
129
|
* @memberof VoxelProvider.prototype
|
|
134
130
|
* @type {MetadataType[]}
|
|
@@ -140,7 +136,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
140
136
|
|
|
141
137
|
/**
|
|
142
138
|
* Gets the metadata component types.
|
|
143
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
144
139
|
*
|
|
145
140
|
* @memberof VoxelProvider.prototype
|
|
146
141
|
* @type {MetadataComponentType[]}
|
|
@@ -150,9 +145,20 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
150
145
|
get: DeveloperError.throwInstantiationError,
|
|
151
146
|
},
|
|
152
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Gets the ordering of the metadata in the buffers.
|
|
150
|
+
*
|
|
151
|
+
* @memberof VoxelProvider.prototype
|
|
152
|
+
* @type {VoxelMetadataOrder}
|
|
153
|
+
* @default VoxelMetadataOrder.XYZ
|
|
154
|
+
* @readonly
|
|
155
|
+
*/
|
|
156
|
+
metadataOrder: {
|
|
157
|
+
get: DeveloperError.throwInstantiationError,
|
|
158
|
+
},
|
|
159
|
+
|
|
153
160
|
/**
|
|
154
161
|
* Gets the metadata minimum values.
|
|
155
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
156
162
|
*
|
|
157
163
|
* @memberof VoxelProvider.prototype
|
|
158
164
|
* @type {number[][]|undefined}
|
|
@@ -164,7 +170,6 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
164
170
|
|
|
165
171
|
/**
|
|
166
172
|
* Gets the metadata maximum values.
|
|
167
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
168
173
|
*
|
|
169
174
|
* @memberof VoxelProvider.prototype
|
|
170
175
|
* @type {number[][]|undefined}
|
|
@@ -175,8 +180,9 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
175
180
|
},
|
|
176
181
|
|
|
177
182
|
/**
|
|
178
|
-
* The maximum number of tiles that exist for this provider.
|
|
179
|
-
* This
|
|
183
|
+
* The maximum number of tiles that exist for this provider.
|
|
184
|
+
* This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory.
|
|
185
|
+
* If this value is not known it can be undefined.
|
|
180
186
|
*
|
|
181
187
|
* @memberof VoxelProvider.prototype
|
|
182
188
|
* @type {number|undefined}
|
|
@@ -186,12 +192,21 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
186
192
|
get: DeveloperError.throwInstantiationError,
|
|
187
193
|
},
|
|
188
194
|
|
|
195
|
+
/**
|
|
196
|
+
* The number of levels of detail containing available tiles in the tileset.
|
|
197
|
+
*
|
|
198
|
+
* @type {number|undefined}
|
|
199
|
+
* @readonly
|
|
200
|
+
*/
|
|
201
|
+
availableLevels: {
|
|
202
|
+
get: DeveloperError.throwInstantiationError,
|
|
203
|
+
},
|
|
204
|
+
|
|
189
205
|
/**
|
|
190
206
|
* Gets the number of keyframes in the dataset.
|
|
191
|
-
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
192
207
|
*
|
|
193
208
|
* @memberof VoxelProvider.prototype
|
|
194
|
-
* @type {number}
|
|
209
|
+
* @type {number|undefined}
|
|
195
210
|
* @readonly
|
|
196
211
|
* @private
|
|
197
212
|
*/
|
|
@@ -200,11 +215,11 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
200
215
|
},
|
|
201
216
|
|
|
202
217
|
/**
|
|
203
|
-
* Gets the {@link TimeIntervalCollection} for the dataset,
|
|
204
|
-
*
|
|
218
|
+
* Gets the {@link TimeIntervalCollection} for the dataset,
|
|
219
|
+
* or undefined if it doesn't have timestamps.
|
|
205
220
|
*
|
|
206
221
|
* @memberof VoxelProvider.prototype
|
|
207
|
-
* @type {TimeIntervalCollection}
|
|
222
|
+
* @type {TimeIntervalCollection|undefined}
|
|
208
223
|
* @readonly
|
|
209
224
|
* @private
|
|
210
225
|
*/
|
|
@@ -214,9 +229,7 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
214
229
|
});
|
|
215
230
|
|
|
216
231
|
/**
|
|
217
|
-
* Requests the data for a given tile.
|
|
218
|
-
* This function should not be called before {@link VoxelProvider#ready} returns true.
|
|
219
|
-
* @function
|
|
232
|
+
* Requests the data for a given tile.
|
|
220
233
|
*
|
|
221
234
|
* @param {object} [options] Object with the following properties:
|
|
222
235
|
* @param {number} [options.tileLevel=0] The tile's level.
|
|
@@ -224,8 +237,10 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
224
237
|
* @param {number} [options.tileY=0] The tile's Y coordinate.
|
|
225
238
|
* @param {number} [options.tileZ=0] The tile's Z coordinate.
|
|
226
239
|
* @privateparam {number} [options.keyframe=0] The requested keyframe.
|
|
227
|
-
* @returns {Promise<
|
|
240
|
+
* @returns {Promise<VoxelContent>|undefined} A promise resolving to a VoxelContent containing the data for the tile, or undefined if the request could not be scheduled this frame.
|
|
228
241
|
*/
|
|
229
|
-
VoxelProvider.prototype.requestData =
|
|
242
|
+
VoxelProvider.prototype.requestData = function (options) {
|
|
243
|
+
DeveloperError.throwInstantiationError();
|
|
244
|
+
};
|
|
230
245
|
|
|
231
246
|
export default VoxelProvider;
|
|
@@ -19,6 +19,7 @@ import convertUvToCylinder from "../Shaders/Voxels/convertUvToCylinder.js";
|
|
|
19
19
|
import convertUvToEllipsoid from "../Shaders/Voxels/convertUvToEllipsoid.js";
|
|
20
20
|
import Octree from "../Shaders/Voxels/Octree.js";
|
|
21
21
|
import Megatexture from "../Shaders/Voxels/Megatexture.js";
|
|
22
|
+
import VoxelMetadataOrder from "./VoxelMetadataOrder.js";
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Set up render resources, including basic shader code, for rendering
|
|
@@ -69,7 +70,7 @@ function VoxelRenderResources(primitive) {
|
|
|
69
70
|
/**
|
|
70
71
|
* A dictionary mapping uniform name to functions that return the uniform
|
|
71
72
|
* values.
|
|
72
|
-
*
|
|
73
|
+
* @private
|
|
73
74
|
* @type {Object<string, Function>}
|
|
74
75
|
*/
|
|
75
76
|
this.uniformMap = uniformMap;
|
|
@@ -86,6 +87,34 @@ function VoxelRenderResources(primitive) {
|
|
|
86
87
|
// Build shader
|
|
87
88
|
shaderBuilder.addVertexLines([VoxelVS]);
|
|
88
89
|
|
|
90
|
+
const shapeType = primitive._provider.shape;
|
|
91
|
+
if (primitive.provider.metadataOrder === VoxelMetadataOrder.GLTF) {
|
|
92
|
+
shaderBuilder.addDefine(
|
|
93
|
+
"GLTF_METADATA_ORDER",
|
|
94
|
+
undefined,
|
|
95
|
+
ShaderDestination.FRAGMENT,
|
|
96
|
+
);
|
|
97
|
+
if (shapeType === "BOX") {
|
|
98
|
+
shaderBuilder.addDefine(
|
|
99
|
+
"SHAPE_BOX",
|
|
100
|
+
undefined,
|
|
101
|
+
ShaderDestination.FRAGMENT,
|
|
102
|
+
);
|
|
103
|
+
} else if (shapeType === "CYLINDER") {
|
|
104
|
+
shaderBuilder.addDefine(
|
|
105
|
+
"SHAPE_CYLINDER",
|
|
106
|
+
undefined,
|
|
107
|
+
ShaderDestination.FRAGMENT,
|
|
108
|
+
);
|
|
109
|
+
} else if (shapeType === "ELLIPSOID") {
|
|
110
|
+
shaderBuilder.addDefine(
|
|
111
|
+
"SHAPE_ELLIPSOID",
|
|
112
|
+
undefined,
|
|
113
|
+
ShaderDestination.FRAGMENT,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
89
118
|
shaderBuilder.addFragmentLines([
|
|
90
119
|
customShader.fragmentShaderText,
|
|
91
120
|
"#line 0",
|
|
@@ -124,7 +153,6 @@ function VoxelRenderResources(primitive) {
|
|
|
124
153
|
shaderBuilder.addFragmentLines([IntersectDepth]);
|
|
125
154
|
}
|
|
126
155
|
|
|
127
|
-
const shapeType = primitive._provider.shape;
|
|
128
156
|
if (shapeType === "BOX") {
|
|
129
157
|
shaderBuilder.addFragmentLines([
|
|
130
158
|
convertUvToBox,
|
|
@@ -139,11 +167,6 @@ function VoxelRenderResources(primitive) {
|
|
|
139
167
|
Intersection,
|
|
140
168
|
]);
|
|
141
169
|
} else if (shapeType === "ELLIPSOID") {
|
|
142
|
-
shaderBuilder.addDefine(
|
|
143
|
-
"SHAPE_ELLIPSOID",
|
|
144
|
-
undefined,
|
|
145
|
-
ShaderDestination.FRAGMENT,
|
|
146
|
-
);
|
|
147
170
|
shaderBuilder.addFragmentLines([
|
|
148
171
|
convertUvToEllipsoid,
|
|
149
172
|
IntersectLongitude,
|