@cesium/engine 10.0.0 → 11.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.
Files changed (234) hide show
  1. package/Build/Workers/{chunk-AA4GZKOT.js → chunk-2EDC3QGH.js} +1 -1
  2. package/Build/Workers/{chunk-DKVHRNFY.js → chunk-2MKRG7L7.js} +5 -5
  3. package/Build/Workers/{chunk-X23FRWHJ.js → chunk-2RZYNSMR.js} +6 -6
  4. package/Build/Workers/{chunk-TO2PVHKI.js → chunk-4NBRIKB3.js} +2 -2
  5. package/Build/Workers/{chunk-GRAT5GE7.js → chunk-4TK5YR6Q.js} +5 -5
  6. package/Build/Workers/{chunk-XD445VDH.js → chunk-54VC7SCM.js} +7 -7
  7. package/Build/Workers/{chunk-G3YR53LY.js → chunk-5IY5BXCT.js} +13 -13
  8. package/Build/Workers/{chunk-O3JCMSS3.js → chunk-6FFGOENI.js} +54 -7
  9. package/Build/Workers/{chunk-7XGC6YB2.js → chunk-6PJIHPQB.js} +13 -13
  10. package/Build/Workers/{chunk-GR3CDLCP.js → chunk-6ZREIBKS.js} +7 -7
  11. package/Build/Workers/{chunk-4MSUJ4I7.js → chunk-AI3O7UN2.js} +6 -6
  12. package/Build/Workers/{chunk-COYFZ5VA.js → chunk-AS7P4BHI.js} +6 -6
  13. package/Build/Workers/{chunk-JYAHOGGL.js → chunk-AUM45VEG.js} +16 -15
  14. package/Build/Workers/{chunk-BDFNKFOE.js → chunk-BBO6BGLC.js} +13 -13
  15. package/Build/Workers/{chunk-AVI4IUWC.js → chunk-BH5ZEN4I.js} +10 -10
  16. package/Build/Workers/{chunk-4BAE4PWO.js → chunk-BJ3WF5RW.js} +6 -6
  17. package/Build/Workers/{chunk-Q55ECN3Y.js → chunk-BUOFSNFW.js} +1 -1
  18. package/Build/Workers/{chunk-QX5XS4LC.js → chunk-BZXF3GNX.js} +2 -2
  19. package/Build/Workers/{chunk-PYHLO636.js → chunk-DJXXI7UF.js} +5 -5
  20. package/Build/Workers/{chunk-LCLJJ2MZ.js → chunk-DVAIU7A4.js} +17 -17
  21. package/Build/Workers/{chunk-SYCPRK3D.js → chunk-FJT3ERV7.js} +9 -9
  22. package/Build/Workers/{chunk-L6RTJ3RE.js → chunk-GOHDOWU5.js} +14 -14
  23. package/Build/Workers/{chunk-MSKXMXJI.js → chunk-HA6TZ3XT.js} +4 -4
  24. package/Build/Workers/{chunk-PCP4YQST.js → chunk-HBZSCVZC.js} +11 -11
  25. package/Build/Workers/{chunk-5S7OLEPK.js → chunk-HC7RYWPZ.js} +12 -12
  26. package/Build/Workers/{chunk-VE7BFUIX.js → chunk-HFMJM3SX.js} +1 -1
  27. package/Build/Workers/{chunk-OOK53QUQ.js → chunk-HFPMX5L2.js} +1 -1
  28. package/Build/Workers/{chunk-VFBNELXB.js → chunk-HO2NTC7I.js} +6 -6
  29. package/Build/Workers/{chunk-DOXCPOG4.js → chunk-HZPMWR4H.js} +7 -7
  30. package/Build/Workers/{chunk-I2RC4XVN.js → chunk-IBG5FVXC.js} +4 -4
  31. package/Build/Workers/{chunk-LEABCTLP.js → chunk-IXLNNST6.js} +4 -4
  32. package/Build/Workers/{chunk-4YSNMHZ4.js → chunk-JYUCC5NV.js} +6 -6
  33. package/Build/Workers/{chunk-BCL4PHHT.js → chunk-KFW4UNQH.js} +10 -10
  34. package/Build/Workers/{chunk-R6B7UCQB.js → chunk-KKAEXHDY.js} +2 -2
  35. package/Build/Workers/{chunk-BJF5LOWE.js → chunk-L6FARMF6.js} +7 -7
  36. package/Build/Workers/{chunk-C2CGMAIU.js → chunk-N3BIL6WA.js} +13 -13
  37. package/Build/Workers/{chunk-STBBMQGG.js → chunk-O5SSW3B3.js} +6 -6
  38. package/Build/Workers/{chunk-S3PI2KFM.js → chunk-OC4MYPVW.js} +2 -2
  39. package/Build/Workers/{chunk-MDHQR3ZS.js → chunk-OOA6GXKD.js} +7 -7
  40. package/Build/Workers/{chunk-AD5HBJ2F.js → chunk-OSCHEWSG.js} +7 -7
  41. package/Build/Workers/{chunk-NTXTUNEF.js → chunk-QGT2GMOK.js} +4 -4
  42. package/Build/Workers/{chunk-VO3ACQB2.js → chunk-RFQYEYAL.js} +17 -17
  43. package/Build/Workers/{chunk-KUN2ZA5X.js → chunk-RJF5ZP76.js} +4 -4
  44. package/Build/Workers/{chunk-QD4KM3GO.js → chunk-SIZXFNJY.js} +6 -5
  45. package/Build/Workers/{chunk-FXIHSF7O.js → chunk-SRZJCF7G.js} +9 -9
  46. package/Build/Workers/{chunk-T77JILCU.js → chunk-T4MB73MC.js} +2 -2
  47. package/Build/Workers/{chunk-3WUV74WM.js → chunk-TTI2SUWJ.js} +2 -2
  48. package/Build/Workers/{chunk-QMLTCCYG.js → chunk-VHJ5ESXF.js} +1 -1
  49. package/Build/Workers/{chunk-2J3JKXCP.js → chunk-VSFFJGTA.js} +9 -5
  50. package/Build/Workers/{chunk-DGS5QNIO.js → chunk-WQRXRDCZ.js} +11 -11
  51. package/Build/Workers/{chunk-OORVMGDU.js → chunk-WXDGOYTT.js} +12 -7
  52. package/Build/Workers/{chunk-RJYML24O.js → chunk-XLCZE6DD.js} +423 -448
  53. package/Build/Workers/combineGeometry.js +22 -22
  54. package/Build/Workers/createBoxGeometry.js +16 -16
  55. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  56. package/Build/Workers/createCircleGeometry.js +24 -24
  57. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  58. package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
  59. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  60. package/Build/Workers/createCorridorGeometry.js +27 -27
  61. package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
  62. package/Build/Workers/createCylinderGeometry.js +18 -18
  63. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  64. package/Build/Workers/createEllipseGeometry.js +24 -24
  65. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  66. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  67. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  68. package/Build/Workers/createFrustumGeometry.js +16 -16
  69. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  70. package/Build/Workers/createGeometry.js +22 -22
  71. package/Build/Workers/createGroundPolylineGeometry.js +20 -20
  72. package/Build/Workers/createPlaneGeometry.js +14 -14
  73. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  74. package/Build/Workers/createPolygonGeometry.js +30 -30
  75. package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
  76. package/Build/Workers/createPolylineGeometry.js +23 -23
  77. package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
  78. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
  79. package/Build/Workers/createRectangleGeometry.js +25 -25
  80. package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
  81. package/Build/Workers/createSimplePolylineGeometry.js +21 -21
  82. package/Build/Workers/createSphereGeometry.js +17 -17
  83. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  84. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  85. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  86. package/Build/Workers/createVectorTileGeometries.js +22 -22
  87. package/Build/Workers/createVectorTilePoints.js +12 -12
  88. package/Build/Workers/createVectorTilePolygons.js +20 -20
  89. package/Build/Workers/createVectorTilePolylines.js +13 -13
  90. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  91. package/Build/Workers/createVerticesFromHeightmap.js +24 -20
  92. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  93. package/Build/Workers/createWallGeometry.js +22 -22
  94. package/Build/Workers/createWallOutlineGeometry.js +21 -21
  95. package/Build/Workers/decodeDraco.js +11 -11
  96. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +28 -5
  97. package/Build/Workers/decodeI3S.js +10 -10
  98. package/Build/Workers/transcodeKTX2.js +20 -22
  99. package/Build/Workers/transferTypedArrayTest.js +1 -1
  100. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  101. package/Source/Core/CompressedTextureBuffer.js +11 -0
  102. package/Source/Core/Ion.js +1 -1
  103. package/Source/Core/KTX2Transcoder.js +9 -16
  104. package/Source/Core/PixelFormat.js +1 -15
  105. package/Source/Core/Simon1994PlanetaryPositions.js +2 -1
  106. package/Source/Core/Transforms.js +137 -2
  107. package/Source/DataSources/BillboardGraphics.js +16 -0
  108. package/Source/DataSources/BillboardVisualizer.js +7 -0
  109. package/Source/DataSources/CallbackProperty.js +8 -2
  110. package/Source/DataSources/CheckerboardMaterialProperty.js +7 -1
  111. package/Source/DataSources/ColorMaterialProperty.js +7 -1
  112. package/Source/DataSources/CompositeMaterialProperty.js +5 -4
  113. package/Source/DataSources/CompositePositionProperty.js +7 -1
  114. package/Source/DataSources/CompositeProperty.js +5 -5
  115. package/Source/DataSources/ConstantPositionProperty.js +7 -1
  116. package/Source/DataSources/Entity.js +1 -1
  117. package/Source/DataSources/GridMaterialProperty.js +7 -1
  118. package/Source/DataSources/ImageMaterialProperty.js +8 -1
  119. package/Source/DataSources/MaterialProperty.js +7 -1
  120. package/Source/DataSources/NodeTransformationProperty.js +7 -1
  121. package/Source/DataSources/PathVisualizer.js +4 -4
  122. package/Source/DataSources/PointGraphics.js +17 -0
  123. package/Source/DataSources/PointVisualizer.js +12 -0
  124. package/Source/DataSources/PolylineArrowMaterialProperty.js +7 -1
  125. package/Source/DataSources/PolylineDashMaterialProperty.js +7 -1
  126. package/Source/DataSources/PolylineGlowMaterialProperty.js +7 -1
  127. package/Source/DataSources/PolylineOutlineMaterialProperty.js +7 -1
  128. package/Source/DataSources/PositionProperty.js +5 -8
  129. package/Source/DataSources/PositionPropertyArray.js +7 -1
  130. package/Source/DataSources/Property.js +1 -1
  131. package/Source/DataSources/PropertyArray.js +5 -5
  132. package/Source/DataSources/PropertyBag.js +5 -4
  133. package/Source/DataSources/ReferenceProperty.js +7 -1
  134. package/Source/DataSources/SampledPositionProperty.js +7 -1
  135. package/Source/DataSources/SampledProperty.js +6 -4
  136. package/Source/DataSources/ScaledPositionProperty.js +6 -0
  137. package/Source/DataSources/StripeMaterialProperty.js +7 -1
  138. package/Source/DataSources/TerrainOffsetProperty.js +9 -0
  139. package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +7 -1
  140. package/Source/DataSources/TimeIntervalCollectionProperty.js +5 -5
  141. package/Source/DataSources/VelocityOrientationProperty.js +6 -1
  142. package/Source/DataSources/VelocityVectorProperty.js +3 -5
  143. package/Source/Renderer/AutomaticUniforms.js +3 -18
  144. package/Source/Renderer/Context.js +15 -0
  145. package/Source/Renderer/CubeMap.js +326 -348
  146. package/Source/Renderer/CubeMapFace.js +26 -48
  147. package/Source/Renderer/PixelDatatype.js +23 -0
  148. package/Source/Renderer/Sampler.js +7 -13
  149. package/Source/Renderer/ShaderProgram.js +7 -0
  150. package/Source/Renderer/Texture.js +396 -332
  151. package/Source/Renderer/UniformState.js +8 -33
  152. package/Source/Renderer/demodernizeShader.js +2 -0
  153. package/Source/Renderer/loadCubeMap.js +3 -8
  154. package/Source/Scene/ArcGisMapService.js +1 -1
  155. package/Source/Scene/Billboard.js +29 -2
  156. package/Source/Scene/BillboardCollection.js +49 -0
  157. package/Source/Scene/BingMapsImageryProvider.js +10 -1
  158. package/Source/Scene/CameraEventAggregator.js +49 -5
  159. package/Source/Scene/Globe.js +1 -1
  160. package/Source/Scene/GlobeSurfaceShaderSet.js +29 -24
  161. package/Source/Scene/GlobeSurfaceTileProvider.js +5 -3
  162. package/Source/Scene/ImageBasedLighting.js +36 -36
  163. package/Source/Scene/Label.js +2 -2
  164. package/Source/Scene/Material.js +24 -2
  165. package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +7 -15
  166. package/Source/Scene/Model/Model.js +1 -1
  167. package/Source/Scene/PointPrimitive.js +28 -2
  168. package/Source/Scene/PointPrimitiveCollection.js +22 -9
  169. package/Source/Scene/PostProcessStageCollection.js +45 -15
  170. package/Source/Scene/PostProcessStageLibrary.js +26 -0
  171. package/Source/Scene/Scene.js +20 -22
  172. package/Source/Scene/SceneTransforms.js +0 -62
  173. package/Source/Scene/ScreenSpaceCameraController.js +11 -4
  174. package/Source/Scene/SkyBox.js +13 -19
  175. package/Source/Scene/SpecularEnvironmentCubeMap.js +240 -0
  176. package/Source/Scene/Tonemapper.js +35 -23
  177. package/Source/Scene/VoxelPrimitive.js +0 -29
  178. package/Source/Scene/VoxelRenderResources.js +0 -3
  179. package/Source/Shaders/BillboardCollectionFS.glsl +4 -0
  180. package/Source/Shaders/BillboardCollectionFS.js +4 -0
  181. package/Source/Shaders/BillboardCollectionVS.glsl +3 -1
  182. package/Source/Shaders/BillboardCollectionVS.js +3 -1
  183. package/Source/Shaders/BrdfLutGeneratorFS.glsl +30 -13
  184. package/Source/Shaders/BrdfLutGeneratorFS.js +30 -13
  185. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -2
  186. package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +42 -41
  187. package/Source/Shaders/Builtin/Functions/pbrLighting.js +42 -41
  188. package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.glsl +23 -0
  189. package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.js +25 -0
  190. package/Source/Shaders/Builtin/Functions/textureCube.glsl +21 -2
  191. package/Source/Shaders/Builtin/Functions/textureCube.js +21 -2
  192. package/Source/Shaders/Builtin/Structs/materialInput.glsl +2 -0
  193. package/Source/Shaders/Builtin/Structs/materialInput.js +2 -0
  194. package/Source/Shaders/GlobeFS.glsl +10 -4
  195. package/Source/Shaders/GlobeFS.js +10 -4
  196. package/Source/Shaders/Materials/WaterMaskMaterial.glsl +15 -0
  197. package/Source/Shaders/Materials/WaterMaskMaterial.js +17 -0
  198. package/Source/Shaders/Model/AtmosphereStageFS.glsl +1 -1
  199. package/Source/Shaders/Model/AtmosphereStageFS.js +1 -1
  200. package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +57 -46
  201. package/Source/Shaders/Model/ImageBasedLightingStageFS.js +57 -46
  202. package/Source/Shaders/Model/LightingStageFS.glsl +8 -7
  203. package/Source/Shaders/Model/LightingStageFS.js +8 -7
  204. package/Source/Shaders/Model/MaterialStageFS.glsl +10 -14
  205. package/Source/Shaders/Model/MaterialStageFS.js +10 -14
  206. package/Source/Shaders/PointPrimitiveCollectionFS.glsl +4 -0
  207. package/Source/Shaders/PointPrimitiveCollectionFS.js +4 -0
  208. package/Source/Shaders/PointPrimitiveCollectionVS.glsl +9 -7
  209. package/Source/Shaders/PointPrimitiveCollectionVS.js +9 -7
  210. package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +4 -0
  211. package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +4 -0
  212. package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +4 -0
  213. package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +4 -0
  214. package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +4 -0
  215. package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +4 -0
  216. package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.glsl +25 -0
  217. package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.js +27 -0
  218. package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +4 -0
  219. package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +4 -0
  220. package/Source/Shaders/SkyAtmosphereFS.glsl +1 -1
  221. package/Source/Shaders/SkyAtmosphereFS.js +1 -1
  222. package/Source/Widget/CesiumWidget.js +1 -1
  223. package/index.d.ts +191 -106
  224. package/index.js +133 -134
  225. package/package.json +4 -4
  226. package/Source/Scene/OctahedralProjectedCubeMap.js +0 -445
  227. package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +0 -78
  228. package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +0 -80
  229. package/Source/Shaders/OctahedralProjectionAtlasFS.glsl +0 -89
  230. package/Source/Shaders/OctahedralProjectionAtlasFS.js +0 -91
  231. package/Source/Shaders/OctahedralProjectionFS.glsl +0 -14
  232. package/Source/Shaders/OctahedralProjectionFS.js +0 -16
  233. package/Source/Shaders/OctahedralProjectionVS.glsl +0 -10
  234. package/Source/Shaders/OctahedralProjectionVS.js +0 -12
@@ -86,26 +86,30 @@ CubeMapFace.prototype.copyFrom = function (options) {
86
86
  Check.defined("options", options);
87
87
  //>>includeEnd('debug');
88
88
 
89
- const xOffset = defaultValue(options.xOffset, 0);
90
- const yOffset = defaultValue(options.yOffset, 0);
89
+ const {
90
+ xOffset = 0,
91
+ yOffset = 0,
92
+ source,
93
+ skipColorSpaceConversion = false,
94
+ } = options;
91
95
 
92
96
  //>>includeStart('debug', pragmas.debug);
93
- Check.defined("options.source", options.source);
97
+ Check.defined("options.source", source);
94
98
  Check.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
95
99
  Check.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
96
- if (xOffset + options.source.width > this._size) {
100
+ if (xOffset + source.width > this._size) {
97
101
  throw new DeveloperError(
98
102
  "xOffset + options.source.width must be less than or equal to width."
99
103
  );
100
104
  }
101
- if (yOffset + options.source.height > this._size) {
105
+ if (yOffset + source.height > this._size) {
102
106
  throw new DeveloperError(
103
107
  "yOffset + options.source.height must be less than or equal to height."
104
108
  );
105
109
  }
106
110
  //>>includeEnd('debug');
107
111
 
108
- const source = options.source;
112
+ const { width, height } = source;
109
113
 
110
114
  const gl = this._context._gl;
111
115
  const target = this._textureTarget;
@@ -114,8 +118,6 @@ CubeMapFace.prototype.copyFrom = function (options) {
114
118
  gl.activeTexture(gl.TEXTURE0);
115
119
  gl.bindTexture(target, this._texture);
116
120
 
117
- const width = source.width;
118
- const height = source.height;
119
121
  let arrayBufferView = source.arrayBufferView;
120
122
 
121
123
  const size = this._size;
@@ -125,10 +127,6 @@ CubeMapFace.prototype.copyFrom = function (options) {
125
127
 
126
128
  const preMultiplyAlpha = this._preMultiplyAlpha;
127
129
  const flipY = this._flipY;
128
- const skipColorSpaceConversion = defaultValue(
129
- options.skipColorSpaceConversion,
130
- false
131
- );
132
130
 
133
131
  let unpackAlignment = 4;
134
132
  if (defined(arrayBufferView)) {
@@ -138,7 +136,6 @@ CubeMapFace.prototype.copyFrom = function (options) {
138
136
  width
139
137
  );
140
138
  }
141
-
142
139
  gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
143
140
 
144
141
  if (skipColorSpaceConversion) {
@@ -152,12 +149,12 @@ CubeMapFace.prototype.copyFrom = function (options) {
152
149
 
153
150
  let uploaded = false;
154
151
  if (!this._initialized) {
152
+ let pixels;
155
153
  if (xOffset === 0 && yOffset === 0 && width === size && height === size) {
156
154
  // initialize the entire texture
157
155
  if (defined(arrayBufferView)) {
158
156
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
159
157
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
160
-
161
158
  if (flipY) {
162
159
  arrayBufferView = PixelFormat.flipY(
163
160
  arrayBufferView,
@@ -167,55 +164,36 @@ CubeMapFace.prototype.copyFrom = function (options) {
167
164
  size
168
165
  );
169
166
  }
170
- gl.texImage2D(
171
- targetFace,
172
- 0,
173
- internalFormat,
174
- size,
175
- size,
176
- 0,
177
- pixelFormat,
178
- PixelDatatype.toWebGLConstant(pixelDatatype, this._context),
179
- arrayBufferView
180
- );
167
+ pixels = arrayBufferView;
181
168
  } else {
182
169
  // Only valid for DOM-Element uploads
183
170
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);
184
171
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
185
-
186
- gl.texImage2D(
187
- targetFace,
188
- 0,
189
- internalFormat,
190
- pixelFormat,
191
- PixelDatatype.toWebGLConstant(pixelDatatype, this._context),
192
- source
193
- );
172
+ pixels = source;
194
173
  }
195
174
  uploaded = true;
196
175
  } else {
176
+ // initialize the entire texture to zero
197
177
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
198
178
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
199
-
200
- // initialize the entire texture to zero
201
- const bufferView = PixelFormat.createTypedArray(
179
+ pixels = PixelFormat.createTypedArray(
202
180
  pixelFormat,
203
181
  pixelDatatype,
204
182
  size,
205
183
  size
206
184
  );
207
- gl.texImage2D(
208
- targetFace,
209
- 0,
210
- internalFormat,
211
- size,
212
- size,
213
- 0,
214
- pixelFormat,
215
- PixelDatatype.toWebGLConstant(pixelDatatype, this._context),
216
- bufferView
217
- );
218
185
  }
186
+ gl.texImage2D(
187
+ targetFace,
188
+ 0,
189
+ internalFormat,
190
+ size,
191
+ size,
192
+ 0,
193
+ pixelFormat,
194
+ PixelDatatype.toWebGLConstant(pixelDatatype, this._context),
195
+ pixels
196
+ );
219
197
  this._initialized = true;
220
198
  }
221
199
 
@@ -95,4 +95,27 @@ PixelDatatype.validate = function (pixelDatatype) {
95
95
  );
96
96
  };
97
97
 
98
+ /**
99
+ * Determine which TypedArray class should be used for a given PixelDatatype.
100
+ *
101
+ * @param {PixelDatatype} pixelDatatype The pixel datatype.
102
+ * @returns {function} The constructor for the appropriate TypedArray class.
103
+ *
104
+ * @private
105
+ */
106
+ PixelDatatype.getTypedArrayConstructor = function (pixelDatatype) {
107
+ const sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype);
108
+ if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) {
109
+ return Uint8Array;
110
+ } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) {
111
+ return Uint16Array;
112
+ } else if (
113
+ sizeInBytes === Float32Array.BYTES_PER_ELEMENT &&
114
+ pixelDatatype === PixelDatatype.FLOAT
115
+ ) {
116
+ return Float32Array;
117
+ }
118
+ return Uint32Array;
119
+ };
120
+
98
121
  export default Object.freeze(PixelDatatype);
@@ -12,19 +12,13 @@ import TextureWrap from "./TextureWrap.js";
12
12
  function Sampler(options) {
13
13
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
14
14
 
15
- const wrapS = defaultValue(options.wrapS, TextureWrap.CLAMP_TO_EDGE);
16
- const wrapT = defaultValue(options.wrapT, TextureWrap.CLAMP_TO_EDGE);
17
- const minificationFilter = defaultValue(
18
- options.minificationFilter,
19
- TextureMinificationFilter.LINEAR
20
- );
21
- const magnificationFilter = defaultValue(
22
- options.magnificationFilter,
23
- TextureMagnificationFilter.LINEAR
24
- );
25
- const maximumAnisotropy = defined(options.maximumAnisotropy)
26
- ? options.maximumAnisotropy
27
- : 1.0;
15
+ const {
16
+ wrapS = TextureWrap.CLAMP_TO_EDGE,
17
+ wrapT = TextureWrap.CLAMP_TO_EDGE,
18
+ minificationFilter = TextureMinificationFilter.LINEAR,
19
+ magnificationFilter = TextureMagnificationFilter.LINEAR,
20
+ maximumAnisotropy = 1.0,
21
+ } = options;
28
22
 
29
23
  //>>includeStart('debug', pragmas.debug);
30
24
  if (!TextureWrap.validate(wrapS)) {
@@ -556,6 +556,13 @@ ShaderProgram.prototype._setUniforms = function (
556
556
  len = manualUniforms.length;
557
557
  for (i = 0; i < len; ++i) {
558
558
  const mu = manualUniforms[i];
559
+
560
+ //>>includeStart('debug', pragmas.debug);
561
+ if (!defined(uniformMap[mu.name])) {
562
+ throw new DeveloperError(`Unknown uniform: ${mu.name}`);
563
+ }
564
+ //>>includeEnd('debug');
565
+
559
566
  mu.value = uniformMap[mu.name]();
560
567
  }
561
568
  }