@cesium/engine 22.2.0 → 22.3.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-C35SJ4QP.js → chunk-2MLJ46ZZ.js} +13 -13
- package/Build/Workers/{chunk-JERDRSEI.js → chunk-4BBANFU6.js} +1 -1
- package/Build/Workers/{chunk-JONWM4IO.js → chunk-4O2ARYS7.js} +1 -1
- package/Build/Workers/{chunk-VGH2CSC7.js → chunk-4R6FGUFP.js} +9 -9
- package/Build/Workers/{chunk-IVN5HSOI.js → chunk-5PJB7ASO.js} +6 -6
- package/Build/Workers/{chunk-35J4D6PX.js → chunk-6GBGEUWR.js} +2 -2
- package/Build/Workers/{chunk-DCR62BCO.js → chunk-6WDMPXQ7.js} +12 -12
- package/Build/Workers/{chunk-4ZQN7M7E.js → chunk-7ATKQRBM.js} +10 -10
- package/Build/Workers/{chunk-FPRM6PCE.js → chunk-7SLNBIZS.js} +5 -34
- package/Build/Workers/{chunk-VSZ5DB2W.js → chunk-7U5YNLF3.js} +1 -1
- package/Build/Workers/{chunk-I4D5IP46.js → chunk-AFGP5BXS.js} +7 -7
- package/Build/Workers/{chunk-IWOSJVFQ.js → chunk-AWELU5C6.js} +14 -14
- package/Build/Workers/{chunk-LDSQMLRC.js → chunk-BO22JHBX.js} +3 -3
- package/Build/Workers/{chunk-2YVTOY5Z.js → chunk-D2PEV362.js} +10 -10
- package/Build/Workers/{chunk-PSHZAHFE.js → chunk-D63Z7KKL.js} +11 -11
- package/Build/Workers/{chunk-AMWXJ5A7.js → chunk-D6OKR3BQ.js} +2 -2
- package/Build/Workers/{chunk-I45CATZK.js → chunk-E4YDCSQK.js} +9 -9
- package/Build/Workers/{chunk-YFEZPDAY.js → chunk-EAAH543Q.js} +11 -11
- package/Build/Workers/{chunk-SDUH3N6G.js → chunk-EOSX23OS.js} +4 -4
- package/Build/Workers/{chunk-A3NUMZBG.js → chunk-EUDHHS7K.js} +6 -6
- package/Build/Workers/{chunk-BKYJBTHW.js → chunk-EY5HOJFQ.js} +5 -5
- package/Build/Workers/{chunk-64PJ4MTB.js → chunk-FDOLXORR.js} +7 -7
- package/Build/Workers/{chunk-WH4HDRGN.js → chunk-FS42VX2H.js} +2 -2
- package/Build/Workers/{chunk-ED4UXMYY.js → chunk-FUDC3KOT.js} +5 -5
- package/Build/Workers/{chunk-CQCEPC6N.js → chunk-HWGP4GVC.js} +13 -13
- package/Build/Workers/{chunk-QO6Z5UJE.js → chunk-IHFAFGR2.js} +2 -2
- package/Build/Workers/{chunk-72LZ3FN6.js → chunk-IXL46IYV.js} +12 -12
- package/Build/Workers/{chunk-JFN2DQHY.js → chunk-K2PLKJJG.js} +5 -5
- package/Build/Workers/{chunk-NY3CWLIZ.js → chunk-K4PGSAR5.js} +8 -8
- package/Build/Workers/{chunk-UBJYWGMV.js → chunk-KIJR26N3.js} +16 -16
- package/Build/Workers/{chunk-MWGB6DLR.js → chunk-L4OFWHNI.js} +1 -1
- package/Build/Workers/{chunk-XPNY2VY3.js → chunk-LK7GEFGB.js} +2 -2
- package/Build/Workers/{chunk-3JB2X2PR.js → chunk-LWZHJWYK.js} +6 -6
- package/Build/Workers/{chunk-ZGWX2R5I.js → chunk-LYBNPUEI.js} +4 -4
- package/Build/Workers/{chunk-4I7BCCNU.js → chunk-M5DVYXJJ.js} +6 -6
- package/Build/Workers/{chunk-4MCPC4TE.js → chunk-MASEF4OV.js} +8 -8
- package/Build/Workers/{chunk-FM5XPC2E.js → chunk-N66PIK46.js} +4 -4
- package/Build/Workers/{chunk-C6FTHSJA.js → chunk-N6XBJBI7.js} +6 -6
- package/Build/Workers/{chunk-7OPRTZBT.js → chunk-NO3LMU7T.js} +7 -7
- package/Build/Workers/{chunk-DIJ7IG5D.js → chunk-NVL7JXAQ.js} +10 -10
- package/Build/Workers/{chunk-O3GWUTWM.js → chunk-OOYICVOK.js} +1 -1
- package/Build/Workers/{chunk-K6BXEBAF.js → chunk-PJLRXIMS.js} +17 -17
- package/Build/Workers/{chunk-7CDQUIP5.js → chunk-S2KVL7OJ.js} +8 -8
- package/Build/Workers/{chunk-PMDPP22G.js → chunk-T5MJDW43.js} +7 -7
- package/Build/Workers/{chunk-GMHDOQPH.js → chunk-TCOUGKXF.js} +4 -4
- package/Build/Workers/{chunk-ZUWF63QU.js → chunk-TMGLPEZW.js} +4 -4
- package/Build/Workers/{chunk-JUOSYFXT.js → chunk-TY5JXMVO.js} +1 -1
- package/Build/Workers/{chunk-3HUEBDFC.js → chunk-VIQIKMTZ.js} +14 -14
- package/Build/Workers/{chunk-N5MNKWED.js → chunk-VRAAQ3FS.js} +2 -2
- package/Build/Workers/{chunk-K64RQCRK.js → chunk-W5NV72VR.js} +17 -17
- package/Build/Workers/{chunk-G6WQA27G.js → chunk-WHLGBMBC.js} +5 -5
- package/Build/Workers/{chunk-2JNPWPLE.js → chunk-WUWPKBOZ.js} +6 -6
- package/Build/Workers/{chunk-MSTAVM2N.js → chunk-XLIJV3YZ.js} +10 -10
- package/Build/Workers/{chunk-V26Y7ZQL.js → chunk-Y5MRBKQN.js} +37 -27
- package/Build/Workers/{chunk-L2FSBEW2.js → chunk-YHPBT4I5.js} +5 -5
- package/Build/Workers/{chunk-7MGTX4WP.js → chunk-ZGGVEGTA.js} +12 -12
- package/Build/Workers/{chunk-P7ISUYLW.js → chunk-ZWWN2CQH.js} +4 -4
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/BoxGeometry.js +1 -1
- package/Source/Core/CornerType.js +1 -1
- package/Source/Core/CorridorGeometry.js +1 -1
- package/Source/Core/FeatureDetection.js +1 -32
- package/Source/Core/Geometry.js +1 -1
- package/Source/Core/IntersectionTests.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PinBuilder.js +1 -1
- package/Source/Core/PolygonGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometry.js +1 -1
- package/Source/Core/RectangleGeometry.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +4 -8
- package/Source/Core/TerrainMesh.js +11 -8
- package/Source/Core/TerrainPicker.js +24 -7
- package/Source/Core/VideoSynchronizer.js +1 -1
- package/Source/Core/WallGeometry.js +1 -1
- package/Source/Core/writeTextToCanvas.js +40 -86
- package/Source/DataSources/BillboardGraphics.js +1 -1
- package/Source/DataSources/BoxGraphics.js +1 -1
- package/Source/DataSources/CallbackPositionProperty.js +1 -1
- package/Source/DataSources/CorridorGraphics.js +1 -1
- package/Source/DataSources/CzmlDataSource.js +1 -1
- package/Source/DataSources/EllipseGraphics.js +1 -1
- package/Source/DataSources/EllipsoidGraphics.js +1 -1
- package/Source/DataSources/Entity.js +1 -1
- package/Source/DataSources/EntityCluster.js +2 -2
- package/Source/DataSources/GeoJsonDataSource.js +2 -2
- package/Source/DataSources/GpxDataSource.js +1 -1
- package/Source/DataSources/KmlDataSource.js +1 -1
- package/Source/DataSources/KmlTour.js +1 -1
- package/Source/DataSources/LabelGraphics.js +1 -1
- package/Source/DataSources/ModelGraphics.js +1 -1
- package/Source/DataSources/PlaneGraphics.js +1 -1
- package/Source/DataSources/PolygonGraphics.js +1 -1
- package/Source/DataSources/PolylineGraphics.js +1 -1
- package/Source/DataSources/PolylineVolumeGraphics.js +1 -1
- package/Source/DataSources/RectangleGraphics.js +1 -1
- package/Source/DataSources/WallGraphics.js +1 -1
- package/Source/DataSources/exportKml.js +1 -1
- package/Source/Renderer/Context.js +11 -10
- package/Source/Renderer/ContextLimits.js +66 -33
- package/Source/Renderer/ShaderSource.js +19 -18
- package/Source/Renderer/Texture.js +1 -1
- package/Source/Renderer/Texture3D.js +166 -7
- package/Source/Renderer/TextureAtlas.js +2 -2
- package/Source/Scene/Appearance.js +1 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +1 -1
- package/Source/Scene/BillboardCollection.js +1 -1
- package/Source/Scene/BillboardTexture.js +4 -1
- package/Source/Scene/Camera.js +13 -2
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/CloudCollection.js +2 -2
- package/Source/Scene/CumulusCloud.js +1 -1
- package/Source/Scene/DynamicEnvironmentMapManager.js +41 -26
- package/Source/Scene/Fog.js +1 -1
- package/Source/Scene/GaussianSplatPrimitive.js +1 -1
- package/Source/Scene/Globe.js +3 -10
- package/Source/Scene/GltfLoader.js +10 -0
- package/Source/Scene/ImageBasedLighting.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/ImageryProvider.js +2 -2
- package/Source/Scene/Label.js +1 -1
- package/Source/Scene/LabelCollection.js +1 -1
- package/Source/Scene/Material.js +1 -1
- package/Source/Scene/MaterialAppearance.js +1 -1
- package/Source/Scene/Megatexture.js +174 -242
- package/Source/Scene/Model/MaterialPipelineStage.js +17 -0
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/ModelComponents.js +10 -0
- package/Source/Scene/ParticleSystem.js +2 -2
- package/Source/Scene/PointPrimitive.js +1 -1
- package/Source/Scene/Polyline.js +0 -1
- package/Source/Scene/PolylineCollection.js +1 -4
- package/Source/Scene/PolylineColorAppearance.js +1 -6
- package/Source/Scene/PolylineMaterialAppearance.js +1 -6
- package/Source/Scene/PostProcessStageCollection.js +1 -1
- package/Source/Scene/QuadtreePrimitive.js +6 -3
- package/Source/Scene/ShadowMap.js +1 -2
- package/Source/Scene/Vector3DTileClampedPolylines.js +1 -5
- package/Source/Scene/Vector3DTilePolylines.js +1 -5
- package/Source/Scene/VoxelPrimitive.js +16 -33
- package/Source/Scene/VoxelRenderResources.js +1 -8
- package/Source/Scene/VoxelTraversal.js +16 -61
- package/Source/Scene/WebMapTileServiceImageryProvider.js +1 -1
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/processVoxelProperties.js +1 -1
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +8 -1
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
- package/Source/Shaders/Model/ModelFS.glsl +8 -0
- package/Source/Shaders/Model/ModelFS.js +8 -0
- package/Source/Shaders/Model/ModelVS.glsl +2 -0
- package/Source/Shaders/Model/ModelVS.js +2 -0
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +1 -1
- package/Source/Shaders/Voxels/IntersectionUtils.js +1 -1
- package/Source/Shaders/Voxels/Megatexture.glsl +15 -83
- package/Source/Shaders/Voxels/Megatexture.js +15 -83
- package/Source/Shaders/Voxels/Octree.glsl +6 -9
- package/Source/Shaders/Voxels/Octree.js +6 -9
- package/Source/Widget/CesiumWidget.js +1 -1
- package/Source/Workers/incrementallyBuildTerrainPicker.js +16 -2
- package/index.d.ts +18 -4
- package/index.js +90 -90
- package/package.json +2 -1
|
@@ -10,6 +10,7 @@ const ContextLimits = {
|
|
|
10
10
|
_maximumTextureImageUnits: 0,
|
|
11
11
|
_maximumRenderbufferSize: 0,
|
|
12
12
|
_maximumTextureSize: 0,
|
|
13
|
+
_maximum3DTextureSize: 0,
|
|
13
14
|
_maximumVaryingVectors: 0,
|
|
14
15
|
_maximumVertexAttributes: 0,
|
|
15
16
|
_maximumVertexTextureImageUnits: 0,
|
|
@@ -31,11 +32,13 @@ const ContextLimits = {
|
|
|
31
32
|
Object.defineProperties(ContextLimits, {
|
|
32
33
|
/**
|
|
33
34
|
* The maximum number of texture units that can be used from the vertex and fragment
|
|
34
|
-
* shader with this WebGL implementation.
|
|
35
|
-
* same texture unit, this counts as two texture units.
|
|
35
|
+
* shader with this WebGL implementation.
|
|
36
|
+
* If both shaders access the same texture unit, this counts as two texture units.
|
|
37
|
+
* The minimum in WebGL2 contexts is 32, or 8 in WebGL1 contexts.
|
|
36
38
|
* @memberof ContextLimits
|
|
37
39
|
* @type {number}
|
|
38
|
-
* @see {@link https://
|
|
40
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_COMBINED_TEXTURE_IMAGE_UNITS</code>.
|
|
41
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
39
42
|
*/
|
|
40
43
|
maximumCombinedTextureImageUnits: {
|
|
41
44
|
get: function () {
|
|
@@ -45,10 +48,12 @@ Object.defineProperties(ContextLimits, {
|
|
|
45
48
|
|
|
46
49
|
/**
|
|
47
50
|
* The approximate maximum cube map width and height supported by this WebGL implementation.
|
|
48
|
-
* The minimum is
|
|
51
|
+
* The minimum in WebGL2 contexts is 2048, but most desktop and laptop implementations will support much larger sizes like 8192.
|
|
52
|
+
* The minimum in WebGL1 contexts is 16.
|
|
49
53
|
* @memberof ContextLimits
|
|
50
54
|
* @type {number}
|
|
51
|
-
* @see {@link https://
|
|
55
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_CUBE_MAP_TEXTURE_SIZE</code>.
|
|
56
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
52
57
|
*/
|
|
53
58
|
maximumCubeMapSize: {
|
|
54
59
|
get: function () {
|
|
@@ -58,10 +63,12 @@ Object.defineProperties(ContextLimits, {
|
|
|
58
63
|
|
|
59
64
|
/**
|
|
60
65
|
* The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>
|
|
61
|
-
* uniforms that can be used by a fragment shader with this WebGL implementation.
|
|
66
|
+
* uniforms that can be used by a fragment shader with this WebGL implementation.
|
|
67
|
+
* The minimum in WebGL2 contexts is 224, or 16 in WebGL1 contexts.
|
|
62
68
|
* @memberof ContextLimits
|
|
63
69
|
* @type {number}
|
|
64
|
-
* @see {@link https://
|
|
70
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_FRAGMENT_UNIFORM_VECTORS</code>.
|
|
71
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
65
72
|
*/
|
|
66
73
|
maximumFragmentUniformVectors: {
|
|
67
74
|
get: function () {
|
|
@@ -70,10 +77,12 @@ Object.defineProperties(ContextLimits, {
|
|
|
70
77
|
},
|
|
71
78
|
|
|
72
79
|
/**
|
|
73
|
-
* The maximum number of texture units that can be used from the fragment shader with this WebGL implementation.
|
|
80
|
+
* The maximum number of texture units that can be used from the fragment shader with this WebGL implementation.
|
|
81
|
+
* The minimum in WebGL2 contexts is 16, or 8 in WebGL1 contexts.
|
|
74
82
|
* @memberof ContextLimits
|
|
75
83
|
* @type {number}
|
|
76
|
-
* @see {@link https://
|
|
84
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_TEXTURE_IMAGE_UNITS</code>.
|
|
85
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
77
86
|
*/
|
|
78
87
|
maximumTextureImageUnits: {
|
|
79
88
|
get: function () {
|
|
@@ -83,10 +92,12 @@ Object.defineProperties(ContextLimits, {
|
|
|
83
92
|
|
|
84
93
|
/**
|
|
85
94
|
* The maximum renderbuffer width and height supported by this WebGL implementation.
|
|
86
|
-
* The minimum is
|
|
95
|
+
* The minimum in WebGL2 contexts is 2048, but most desktop and laptop implementations will support much larger sizes like 8192.
|
|
96
|
+
* The minimum in WebGL1 contexts is 1.
|
|
87
97
|
* @memberof ContextLimits
|
|
88
98
|
* @type {number}
|
|
89
|
-
* @see {@link https://
|
|
99
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_RENDERBUFFER_SIZE</code>.
|
|
100
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
90
101
|
*/
|
|
91
102
|
maximumRenderbufferSize: {
|
|
92
103
|
get: function () {
|
|
@@ -96,10 +107,12 @@ Object.defineProperties(ContextLimits, {
|
|
|
96
107
|
|
|
97
108
|
/**
|
|
98
109
|
* The approximate maximum texture width and height supported by this WebGL implementation.
|
|
99
|
-
* The minimum is
|
|
110
|
+
* The minimum in WebGL2 contexts is 2048, but most desktop and laptop implementations will support much larger sizes like 8192.
|
|
111
|
+
* The minimum in WebGL1 contexts is 64.
|
|
100
112
|
* @memberof ContextLimits
|
|
101
113
|
* @type {number}
|
|
102
|
-
* @see {@link https://
|
|
114
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_TEXTURE_SIZE</code>.
|
|
115
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
103
116
|
*/
|
|
104
117
|
maximumTextureSize: {
|
|
105
118
|
get: function () {
|
|
@@ -107,12 +120,27 @@ Object.defineProperties(ContextLimits, {
|
|
|
107
120
|
},
|
|
108
121
|
},
|
|
109
122
|
|
|
123
|
+
/**
|
|
124
|
+
* The approximate maximum texture width, height, and depth supported by this WebGL2 implementation.
|
|
125
|
+
* The minimum is 256, but most desktop and laptop implementations will support much larger sizes like 2048.
|
|
126
|
+
* 3D textures are not supported in WebGL1 contexts.
|
|
127
|
+
* @memberof ContextLimits
|
|
128
|
+
* @type {number}
|
|
129
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_3D_TEXTURE_SIZE</code>.
|
|
130
|
+
*/
|
|
131
|
+
maximum3DTextureSize: {
|
|
132
|
+
get: function () {
|
|
133
|
+
return ContextLimits._maximum3DTextureSize;
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
|
|
110
137
|
/**
|
|
111
138
|
* The maximum number of <code>vec4</code> varying variables supported by this WebGL implementation.
|
|
112
|
-
* The minimum is
|
|
139
|
+
* The minimum is 15 in WebGL2 contexts, or 8 in WebGL1 contexts. Matrices and arrays count as multiple <code>vec4</code>s.
|
|
113
140
|
* @memberof ContextLimits
|
|
114
141
|
* @type {number}
|
|
115
|
-
* @see {@link https://
|
|
142
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VARYING_VECTORS</code>.
|
|
143
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
116
144
|
*/
|
|
117
145
|
maximumVaryingVectors: {
|
|
118
146
|
get: function () {
|
|
@@ -121,10 +149,12 @@ Object.defineProperties(ContextLimits, {
|
|
|
121
149
|
},
|
|
122
150
|
|
|
123
151
|
/**
|
|
124
|
-
* The maximum number of <code>vec4</code> vertex attributes supported by this WebGL implementation.
|
|
152
|
+
* The maximum number of <code>vec4</code> vertex attributes supported by this WebGL implementation.
|
|
153
|
+
* The minimum is 16 in WebGL2 contexts, or 8 in WebGL1 contexts.
|
|
125
154
|
* @memberof ContextLimits
|
|
126
155
|
* @type {number}
|
|
127
|
-
* @see {@link https://
|
|
156
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VERTEX_ATTRIBS</code>.
|
|
157
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
128
158
|
*/
|
|
129
159
|
maximumVertexAttributes: {
|
|
130
160
|
get: function () {
|
|
@@ -134,10 +164,11 @@ Object.defineProperties(ContextLimits, {
|
|
|
134
164
|
|
|
135
165
|
/**
|
|
136
166
|
* The maximum number of texture units that can be used from the vertex shader with this WebGL implementation.
|
|
137
|
-
* The minimum is
|
|
167
|
+
* The minimum is 16 in WebGL2 contexts, or 0 in WebGL1 contexts.
|
|
138
168
|
* @memberof ContextLimits
|
|
139
169
|
* @type {number}
|
|
140
|
-
* @see {@link https://
|
|
170
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VERTEX_TEXTURE_IMAGE_UNITS</code>.
|
|
171
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
141
172
|
*/
|
|
142
173
|
maximumVertexTextureImageUnits: {
|
|
143
174
|
get: function () {
|
|
@@ -147,10 +178,12 @@ Object.defineProperties(ContextLimits, {
|
|
|
147
178
|
|
|
148
179
|
/**
|
|
149
180
|
* The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>
|
|
150
|
-
* uniforms that can be used by a vertex shader with this WebGL implementation.
|
|
181
|
+
* uniforms that can be used by a vertex shader with this WebGL implementation.
|
|
182
|
+
* The minimum is 256 in WebGL2 contexts, or 128 in WebGL1 contexts.
|
|
151
183
|
* @memberof ContextLimits
|
|
152
184
|
* @type {number}
|
|
153
|
-
* @see {@link https://
|
|
185
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VERTEX_UNIFORM_VECTORS</code>.
|
|
186
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
|
|
154
187
|
*/
|
|
155
188
|
maximumVertexUniformVectors: {
|
|
156
189
|
get: function () {
|
|
@@ -159,10 +192,10 @@ Object.defineProperties(ContextLimits, {
|
|
|
159
192
|
},
|
|
160
193
|
|
|
161
194
|
/**
|
|
162
|
-
* The minimum aliased line width, in pixels, supported by this WebGL implementation.
|
|
195
|
+
* The minimum aliased line width, in pixels, supported by this WebGL implementation. It will be at most one.
|
|
196
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_LINE_WIDTH_RANGE</code>.
|
|
163
197
|
* @memberof ContextLimits
|
|
164
198
|
* @type {number}
|
|
165
|
-
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.
|
|
166
199
|
*/
|
|
167
200
|
minimumAliasedLineWidth: {
|
|
168
201
|
get: function () {
|
|
@@ -171,10 +204,10 @@ Object.defineProperties(ContextLimits, {
|
|
|
171
204
|
},
|
|
172
205
|
|
|
173
206
|
/**
|
|
174
|
-
* The maximum aliased line width, in pixels, supported by this WebGL implementation.
|
|
207
|
+
* The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
|
|
208
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_LINE_WIDTH_RANGE</code>.
|
|
175
209
|
* @memberof ContextLimits
|
|
176
210
|
* @type {number}
|
|
177
|
-
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.
|
|
178
211
|
*/
|
|
179
212
|
maximumAliasedLineWidth: {
|
|
180
213
|
get: function () {
|
|
@@ -183,10 +216,10 @@ Object.defineProperties(ContextLimits, {
|
|
|
183
216
|
},
|
|
184
217
|
|
|
185
218
|
/**
|
|
186
|
-
* The minimum aliased point size, in pixels, supported by this WebGL implementation.
|
|
219
|
+
* The minimum aliased point size, in pixels, supported by this WebGL implementation. It will be at most one.
|
|
220
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_POINT_SIZE_RANGE</code>.
|
|
187
221
|
* @memberof ContextLimits
|
|
188
222
|
* @type {number}
|
|
189
|
-
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_POINT_SIZE_RANGE</code>.
|
|
190
223
|
*/
|
|
191
224
|
minimumAliasedPointSize: {
|
|
192
225
|
get: function () {
|
|
@@ -195,10 +228,10 @@ Object.defineProperties(ContextLimits, {
|
|
|
195
228
|
},
|
|
196
229
|
|
|
197
230
|
/**
|
|
198
|
-
* The maximum aliased point size, in pixels, supported by this WebGL implementation.
|
|
231
|
+
* The maximum aliased point size, in pixels, supported by this WebGL implementation. It will be at least one.
|
|
232
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_POINT_SIZE_RANGE</code>.
|
|
199
233
|
* @memberof ContextLimits
|
|
200
234
|
* @type {number}
|
|
201
|
-
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_POINT_SIZE_RANGE</code>.
|
|
202
235
|
*/
|
|
203
236
|
maximumAliasedPointSize: {
|
|
204
237
|
get: function () {
|
|
@@ -207,10 +240,10 @@ Object.defineProperties(ContextLimits, {
|
|
|
207
240
|
},
|
|
208
241
|
|
|
209
242
|
/**
|
|
210
|
-
* The maximum supported width of the viewport.
|
|
243
|
+
* The maximum supported width of the viewport. It will be at least as large as the visible width of the associated canvas.
|
|
244
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VIEWPORT_DIMS</code>.
|
|
211
245
|
* @memberof ContextLimits
|
|
212
246
|
* @type {number}
|
|
213
|
-
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VIEWPORT_DIMS</code>.
|
|
214
247
|
*/
|
|
215
248
|
maximumViewportWidth: {
|
|
216
249
|
get: function () {
|
|
@@ -219,10 +252,10 @@ Object.defineProperties(ContextLimits, {
|
|
|
219
252
|
},
|
|
220
253
|
|
|
221
254
|
/**
|
|
222
|
-
* The maximum supported height of the viewport.
|
|
255
|
+
* The maximum supported height of the viewport. It will be at least as large as the visible height of the associated canvas.
|
|
256
|
+
* @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VIEWPORT_DIMS</code>.
|
|
223
257
|
* @memberof ContextLimits
|
|
224
258
|
* @type {number}
|
|
225
|
-
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VIEWPORT_DIMS</code>.
|
|
226
259
|
*/
|
|
227
260
|
maximumViewportHeight: {
|
|
228
261
|
get: function () {
|
|
@@ -153,14 +153,11 @@ function getBuiltinsAndAutomaticUniforms(shaderSource) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
function combineShader(shaderSource, isFragmentShader, context) {
|
|
156
|
-
let i;
|
|
157
|
-
let length;
|
|
158
|
-
|
|
159
156
|
// Combine shader sources, generally for pseudo-polymorphism, e.g., czm_getMaterial.
|
|
160
157
|
let combinedSources = "";
|
|
161
158
|
const sources = shaderSource.sources;
|
|
162
159
|
if (defined(sources)) {
|
|
163
|
-
for (i = 0
|
|
160
|
+
for (let i = 0; i < sources.length; ++i) {
|
|
164
161
|
// #line needs to be on its own line.
|
|
165
162
|
combinedSources += `\n#line 0\n${sources[i]}`;
|
|
166
163
|
}
|
|
@@ -225,30 +222,34 @@ function combineShader(shaderSource, isFragmentShader, context) {
|
|
|
225
222
|
let result = "";
|
|
226
223
|
|
|
227
224
|
const extensionsLength = extensions.length;
|
|
228
|
-
for (i = 0; i < extensionsLength; i++) {
|
|
225
|
+
for (let i = 0; i < extensionsLength; i++) {
|
|
229
226
|
result += extensions[i];
|
|
230
227
|
}
|
|
231
228
|
|
|
232
229
|
if (isFragmentShader) {
|
|
233
|
-
// If high precision isn't
|
|
234
|
-
// The highp keyword is not always available on older mobile devices
|
|
230
|
+
// If high precision isn't supported, replace occurrences of highp with mediump.
|
|
231
|
+
// The highp keyword is not always available on older mobile devices.
|
|
235
232
|
// See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#In_WebGL_1_highp_float_support_is_optional_in_fragment_shaders
|
|
236
|
-
result +=
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
precision highp
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
precision mediump
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
233
|
+
result += `
|
|
234
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
235
|
+
precision highp float;
|
|
236
|
+
precision highp int;
|
|
237
|
+
#else
|
|
238
|
+
precision mediump float;
|
|
239
|
+
precision mediump int;
|
|
240
|
+
#define highp mediump
|
|
241
|
+
#endif
|
|
242
|
+
`;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (context.webgl2) {
|
|
246
|
+
result += `precision highp sampler3D;\n\n`;
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
// Prepend #defines for uber-shaders
|
|
249
250
|
const defines = shaderSource.defines;
|
|
250
251
|
if (defined(defines)) {
|
|
251
|
-
for (i = 0, length = defines.length; i < length; ++i) {
|
|
252
|
+
for (let i = 0, length = defines.length; i < length; ++i) {
|
|
252
253
|
const define = defines[i];
|
|
253
254
|
if (define.length !== 0) {
|
|
254
255
|
result += `#define ${define}\n`;
|
|
@@ -398,7 +398,7 @@ function loadBufferSource(texture, source) {
|
|
|
398
398
|
* @param {number} xOffset The texel x coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
399
399
|
* @param {number} yOffset The texel y coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
400
400
|
* @param {number} width The width of the source data, in pixels.
|
|
401
|
-
* @param {number}
|
|
401
|
+
* @param {number} height The height of the source data, in pixels.
|
|
402
402
|
*
|
|
403
403
|
* @private
|
|
404
404
|
*/
|
|
@@ -68,7 +68,8 @@ function Texture3D(options) {
|
|
|
68
68
|
sampler = new Sampler(),
|
|
69
69
|
} = options;
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
// 3D textures are not supported in a WebGL1 context. But we allow a stub context for testing.
|
|
72
|
+
if (!context.webgl2 && !defined(context.options.getWebGLStub)) {
|
|
72
73
|
throw new DeveloperError(
|
|
73
74
|
"WebGL1 does not support texture3D. Please use a WebGL2 context.",
|
|
74
75
|
);
|
|
@@ -113,25 +114,25 @@ function Texture3D(options) {
|
|
|
113
114
|
|
|
114
115
|
Check.typeOf.number.greaterThan("width", width, 0);
|
|
115
116
|
|
|
116
|
-
if (width > ContextLimits.
|
|
117
|
+
if (width > ContextLimits.maximum3DTextureSize) {
|
|
117
118
|
throw new DeveloperError(
|
|
118
|
-
`Width must be less than or equal to the maximum texture3D size (${ContextLimits.
|
|
119
|
+
`Width must be less than or equal to the maximum texture3D size (${ContextLimits.maximum3DTextureSize}). Check maximum3DTextureSize.`,
|
|
119
120
|
);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
Check.typeOf.number.greaterThan("height", height, 0);
|
|
123
124
|
|
|
124
|
-
if (height > ContextLimits.
|
|
125
|
+
if (height > ContextLimits.maximum3DTextureSize) {
|
|
125
126
|
throw new DeveloperError(
|
|
126
|
-
`Height must be less than or equal to the maximum texture3D size (${ContextLimits.
|
|
127
|
+
`Height must be less than or equal to the maximum texture3D size (${ContextLimits.maximum3DTextureSize}). Check maximum3DTextureSize.`,
|
|
127
128
|
);
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
Check.typeOf.number.greaterThan("depth", depth, 0);
|
|
131
132
|
|
|
132
|
-
if (depth > ContextLimits.
|
|
133
|
+
if (depth > ContextLimits.maximum3DTextureSize) {
|
|
133
134
|
throw new DeveloperError(
|
|
134
|
-
`Depth must be less than or equal to the maximum texture3D size (${ContextLimits.
|
|
135
|
+
`Depth must be less than or equal to the maximum texture3D size (${ContextLimits.maximum3DTextureSize}). Check maximum3DTextureSize.`,
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -333,6 +334,164 @@ function loadBufferSource(texture3D, source) {
|
|
|
333
334
|
}
|
|
334
335
|
}
|
|
335
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Copy new image data into this texture, from a source object with width, height, depth, and arrayBufferView properties.
|
|
339
|
+
* @param {object} options Object with the following properties:
|
|
340
|
+
* @param {object} options.source The source object with width, height, depth, and arrayBufferView properties.
|
|
341
|
+
* @param {number} [options.xOffset=0] The offset in the x direction within the texture to copy into.
|
|
342
|
+
* @param {number} [options.yOffset=0] The offset in the y direction within the texture to copy into.
|
|
343
|
+
* @param {number} [options.zOffset=0] The offset in the z direction within the texture to copy into.
|
|
344
|
+
* @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the texture will be ignored.
|
|
345
|
+
*
|
|
346
|
+
* @exception {DeveloperError} Unsupported copyFrom with a compressed texture pixel format.
|
|
347
|
+
* @exception {DeveloperError} xOffset must be greater than or equal to zero.
|
|
348
|
+
* @exception {DeveloperError} yOffset must be greater than or equal to zero.
|
|
349
|
+
* @exception {DeveloperError} zOffset must be greater than or equal to zero.
|
|
350
|
+
* @exception {DeveloperError} xOffset + source.width must be less than or equal to width.
|
|
351
|
+
* @exception {DeveloperError} yOffset + source.height must be less than or equal to height.
|
|
352
|
+
* @exception {DeveloperError} zOffset + source.depth must be less than or equal to depth.
|
|
353
|
+
* @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.
|
|
354
|
+
* @private
|
|
355
|
+
* @example
|
|
356
|
+
* texture.copyFrom({
|
|
357
|
+
* source: {
|
|
358
|
+
* width : 1,
|
|
359
|
+
* height : 1,
|
|
360
|
+
* depth : 1,
|
|
361
|
+
* arrayBufferView : new Uint8Array([255, 0, 0, 255])
|
|
362
|
+
* }
|
|
363
|
+
* });
|
|
364
|
+
*/
|
|
365
|
+
Texture3D.prototype.copyFrom = function (options) {
|
|
366
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
367
|
+
|
|
368
|
+
const { source, xOffset = 0, yOffset = 0, zOffset = 0 } = options;
|
|
369
|
+
|
|
370
|
+
//>>includeStart('debug', pragmas.debug);
|
|
371
|
+
Check.defined("options.source", source);
|
|
372
|
+
Check.defined("options.source.arrayBufferView", source.arrayBufferView);
|
|
373
|
+
if (PixelFormat.isCompressedFormat(this._pixelFormat)) {
|
|
374
|
+
throw new DeveloperError(
|
|
375
|
+
"Unsupported copyFrom with a compressed texture pixel format.",
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
Check.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
|
|
379
|
+
Check.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
|
|
380
|
+
Check.typeOf.number.greaterThanOrEquals("zOffset", zOffset, 0);
|
|
381
|
+
Check.typeOf.number.lessThanOrEquals(
|
|
382
|
+
"xOffset + options.source.width",
|
|
383
|
+
xOffset + source.width,
|
|
384
|
+
this._width,
|
|
385
|
+
);
|
|
386
|
+
Check.typeOf.number.lessThanOrEquals(
|
|
387
|
+
"yOffset + options.source.height",
|
|
388
|
+
yOffset + source.height,
|
|
389
|
+
this._height,
|
|
390
|
+
);
|
|
391
|
+
Check.typeOf.number.lessThanOrEquals(
|
|
392
|
+
"zOffset + options.source.depth",
|
|
393
|
+
zOffset + source.depth,
|
|
394
|
+
this._depth,
|
|
395
|
+
);
|
|
396
|
+
//>>includeEnd('debug');
|
|
397
|
+
|
|
398
|
+
const context = this._context;
|
|
399
|
+
const gl = context._gl;
|
|
400
|
+
const target = this._textureTarget;
|
|
401
|
+
|
|
402
|
+
gl.activeTexture(gl.TEXTURE0);
|
|
403
|
+
gl.bindTexture(target, this._texture);
|
|
404
|
+
|
|
405
|
+
const { width, height, depth } = source;
|
|
406
|
+
let uploaded = false;
|
|
407
|
+
if (!this._initialized) {
|
|
408
|
+
if (
|
|
409
|
+
xOffset === 0 &&
|
|
410
|
+
yOffset === 0 &&
|
|
411
|
+
zOffset === 0 &&
|
|
412
|
+
width === this._width &&
|
|
413
|
+
height === this._height &&
|
|
414
|
+
depth === this._depth
|
|
415
|
+
) {
|
|
416
|
+
loadBufferSource(this, source);
|
|
417
|
+
uploaded = true;
|
|
418
|
+
} else {
|
|
419
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
|
420
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
421
|
+
loadNull(this);
|
|
422
|
+
}
|
|
423
|
+
this._initialized = true;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (!uploaded) {
|
|
427
|
+
loadPartialBufferSource(
|
|
428
|
+
this,
|
|
429
|
+
source.arrayBufferView,
|
|
430
|
+
xOffset,
|
|
431
|
+
yOffset,
|
|
432
|
+
zOffset,
|
|
433
|
+
width,
|
|
434
|
+
height,
|
|
435
|
+
depth,
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
gl.bindTexture(target, null);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Load texel data from a buffer into part of a 3D texture
|
|
444
|
+
*
|
|
445
|
+
* @param {Texture3D} texture3D The texture3D to which texel values will be loaded.
|
|
446
|
+
* @param {TypedArray} arrayBufferView The texel values to be loaded into the texture3D.
|
|
447
|
+
* @param {number} xOffset The texel x coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
448
|
+
* @param {number} yOffset The texel y coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
449
|
+
* @param {number} zOffset The texel z coordinate of the lower left corner of the subregion of the texture to be updated.
|
|
450
|
+
* @param {number} width The width of the source data, in pixels.
|
|
451
|
+
* @param {number} height The height of the source data, in pixels.
|
|
452
|
+
* @param {number} depth The depth of the source data, in pixels.
|
|
453
|
+
*
|
|
454
|
+
* @private
|
|
455
|
+
*/
|
|
456
|
+
function loadPartialBufferSource(
|
|
457
|
+
texture3D,
|
|
458
|
+
arrayBufferView,
|
|
459
|
+
xOffset,
|
|
460
|
+
yOffset,
|
|
461
|
+
zOffset,
|
|
462
|
+
width,
|
|
463
|
+
height,
|
|
464
|
+
depth,
|
|
465
|
+
) {
|
|
466
|
+
const context = texture3D._context;
|
|
467
|
+
const gl = context._gl;
|
|
468
|
+
|
|
469
|
+
const { pixelFormat, pixelDatatype } = texture3D;
|
|
470
|
+
|
|
471
|
+
const unpackAlignment = PixelFormat.alignmentInBytes(
|
|
472
|
+
pixelFormat,
|
|
473
|
+
pixelDatatype,
|
|
474
|
+
width,
|
|
475
|
+
);
|
|
476
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
|
|
477
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
|
478
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
479
|
+
|
|
480
|
+
gl.texSubImage3D(
|
|
481
|
+
texture3D._textureTarget,
|
|
482
|
+
0,
|
|
483
|
+
xOffset,
|
|
484
|
+
yOffset,
|
|
485
|
+
zOffset,
|
|
486
|
+
width,
|
|
487
|
+
height,
|
|
488
|
+
depth,
|
|
489
|
+
pixelFormat,
|
|
490
|
+
PixelDatatype.toWebGLConstant(pixelDatatype, context),
|
|
491
|
+
arrayBufferView,
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
336
495
|
/**
|
|
337
496
|
* Compute a dimension of the image for the next mip level.
|
|
338
497
|
*
|
|
@@ -641,7 +641,7 @@ async function resolveImage(image, id) {
|
|
|
641
641
|
* or a URL to an Image, or a Promise for an image, or a function that creates an image.
|
|
642
642
|
* @param {number} width A number specifying the width of the texture. If undefined, the image width will be used.
|
|
643
643
|
* @param {number} height A number specifying the height of the texture. If undefined, the image height will be used.
|
|
644
|
-
* @returns {Promise<number>
|
|
644
|
+
* @returns {Promise<number> | number} The image region index or a promise that resolves to it. -1 is returned if resources are in the process of being destroyed.
|
|
645
645
|
*/
|
|
646
646
|
TextureAtlas.prototype.addImage = function (id, image, width, height) {
|
|
647
647
|
//>>includeStart('debug', pragmas.debug);
|
|
@@ -657,7 +657,7 @@ TextureAtlas.prototype.addImage = function (id, image, width, height) {
|
|
|
657
657
|
}
|
|
658
658
|
if (defined(index)) {
|
|
659
659
|
// This image has already been added and resolved
|
|
660
|
-
return
|
|
660
|
+
return index;
|
|
661
661
|
}
|
|
662
662
|
|
|
663
663
|
index = this._nextIndex++;
|
|
@@ -28,7 +28,7 @@ import CullFace from "./CullFace.js";
|
|
|
28
28
|
* @see PolylineColorAppearance
|
|
29
29
|
* @see PolylineMaterialAppearance
|
|
30
30
|
*
|
|
31
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
31
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=geometry-and-appearances|Geometry and Appearances Demo}
|
|
32
32
|
*/
|
|
33
33
|
function Appearance(options) {
|
|
34
34
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"
|
|
7
|
+
"AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQBN5OwMQnvqcM3GTdzwDusCXj4eE5jKKONHLoPEAvNXnML4d2_ObFMHiYtbS6gOWoNlH6cNDium9FLGy4eRBK7mcDQKdokYzlY27y-WPo25dgjAfx6C0rbvGsk0yn7FHPv8yDcsW5frQhhXIJ48lW5UcbIlpxY_j-Im5MJfxgIQuUA_m0tvy4rxbkTMNS26yA.AT1_DJvNEaWq";
|
|
8
8
|
/**
|
|
9
9
|
* Default options for accessing the ArcGIS image tile service.
|
|
10
10
|
*
|
|
@@ -93,7 +93,7 @@ import isDataUri from "../Core/isDataUri.js";
|
|
|
93
93
|
* @param {Billboard.ConstructorOptions} options Object describing initialization options
|
|
94
94
|
* @param {BillboardCollection} billboardCollection Instance of BillboardCollection
|
|
95
95
|
*
|
|
96
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
96
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=billboards|Cesium Sandcastle Billboard Demo}
|
|
97
97
|
*/
|
|
98
98
|
function Billboard(options, billboardCollection) {
|
|
99
99
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
@@ -130,7 +130,7 @@ const attributeLocationsInstanced = {
|
|
|
130
130
|
* @see Billboard
|
|
131
131
|
* @see LabelCollection
|
|
132
132
|
*
|
|
133
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
133
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=billboards|Cesium Sandcastle Billboard Demo}
|
|
134
134
|
*
|
|
135
135
|
* @example
|
|
136
136
|
* // Create a billboard collection with two billboards
|
|
@@ -199,7 +199,10 @@ BillboardTexture.prototype.loadImage = async function (
|
|
|
199
199
|
let index;
|
|
200
200
|
const atlas = this._billboardCollection.textureAtlas;
|
|
201
201
|
try {
|
|
202
|
-
index =
|
|
202
|
+
index = atlas.addImage(id, image, width, height);
|
|
203
|
+
if (index instanceof Promise) {
|
|
204
|
+
index = await index;
|
|
205
|
+
}
|
|
203
206
|
} catch (error) {
|
|
204
207
|
// There was an error loading the image
|
|
205
208
|
billboardTexture._loadState = BillboardLoadState.ERROR;
|
package/Source/Scene/Camera.js
CHANGED
|
@@ -63,8 +63,8 @@ import SceneMode from "./SceneMode.js";
|
|
|
63
63
|
*
|
|
64
64
|
* @param {Scene} scene The scene.
|
|
65
65
|
*
|
|
66
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
67
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
66
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=camera|Cesium Sandcastle Camera Demo}
|
|
67
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=camera-tutorial|Cesium Sandcastle Camera Tutorial Example}
|
|
68
68
|
* @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera|Camera Tutorial}
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
@@ -3005,6 +3005,17 @@ function getPickRayOrthographic(camera, windowPosition, result) {
|
|
|
3005
3005
|
|
|
3006
3006
|
Cartesian3.clone(camera.directionWC, result.direction);
|
|
3007
3007
|
|
|
3008
|
+
// Account for wrap-around in 2D infinite scroll mode
|
|
3009
|
+
if (
|
|
3010
|
+
camera._mode === SceneMode.SCENE2D &&
|
|
3011
|
+
camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL
|
|
3012
|
+
) {
|
|
3013
|
+
const maxHorizontal = camera._maxCoord.x;
|
|
3014
|
+
origin.y =
|
|
3015
|
+
CesiumMath.mod(origin.y + maxHorizontal, 2.0 * maxHorizontal) -
|
|
3016
|
+
maxHorizontal;
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3008
3019
|
return result;
|
|
3009
3020
|
}
|
|
3010
3021
|
|
|
@@ -41,8 +41,8 @@ import ClippingPlane from "./ClippingPlane.js";
|
|
|
41
41
|
* @param {Color} [options.edgeColor=Color.WHITE] The color applied to highlight the edge along which an object is clipped.
|
|
42
42
|
* @param {number} [options.edgeWidth=0.0] The width, in pixels, of the highlight applied to the edge along which an object is clipped.
|
|
43
43
|
*
|
|
44
|
-
* @demo {@link https://sandcastle.cesium.com/?
|
|
45
|
-
* @demo {@link https://sandcastle.cesium.com/?
|
|
44
|
+
* @demo {@link https://sandcastle.cesium.com/?id=3d-tiles-clipping-planes|Clipping 3D Tiles and glTF models.}
|
|
45
|
+
* @demo {@link https://sandcastle.cesium.com/?id=terrain-clipping-planes|Clipping the Globe.}
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* // This clipping plane's distance is positive, which means its normal
|
|
@@ -86,8 +86,8 @@ const COLOR_INDEX = CumulusCloud.COLOR_INDEX;
|
|
|
86
86
|
* @see CloudCollection#remove
|
|
87
87
|
* @see CumulusCloud
|
|
88
88
|
*
|
|
89
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
90
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
89
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=clouds|Cesium Sandcastle Clouds Demo}
|
|
90
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=cloud-parameters|Cesium Sandcastle Cloud Parameters Demo}
|
|
91
91
|
*
|
|
92
92
|
* @example
|
|
93
93
|
* // Create a cloud collection with two cumulus clouds
|