@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.
- package/Build/Workers/{chunk-AA4GZKOT.js → chunk-2EDC3QGH.js} +1 -1
- package/Build/Workers/{chunk-DKVHRNFY.js → chunk-2MKRG7L7.js} +5 -5
- package/Build/Workers/{chunk-X23FRWHJ.js → chunk-2RZYNSMR.js} +6 -6
- package/Build/Workers/{chunk-TO2PVHKI.js → chunk-4NBRIKB3.js} +2 -2
- package/Build/Workers/{chunk-GRAT5GE7.js → chunk-4TK5YR6Q.js} +5 -5
- package/Build/Workers/{chunk-XD445VDH.js → chunk-54VC7SCM.js} +7 -7
- package/Build/Workers/{chunk-G3YR53LY.js → chunk-5IY5BXCT.js} +13 -13
- package/Build/Workers/{chunk-O3JCMSS3.js → chunk-6FFGOENI.js} +54 -7
- package/Build/Workers/{chunk-7XGC6YB2.js → chunk-6PJIHPQB.js} +13 -13
- package/Build/Workers/{chunk-GR3CDLCP.js → chunk-6ZREIBKS.js} +7 -7
- package/Build/Workers/{chunk-4MSUJ4I7.js → chunk-AI3O7UN2.js} +6 -6
- package/Build/Workers/{chunk-COYFZ5VA.js → chunk-AS7P4BHI.js} +6 -6
- package/Build/Workers/{chunk-JYAHOGGL.js → chunk-AUM45VEG.js} +16 -15
- package/Build/Workers/{chunk-BDFNKFOE.js → chunk-BBO6BGLC.js} +13 -13
- package/Build/Workers/{chunk-AVI4IUWC.js → chunk-BH5ZEN4I.js} +10 -10
- package/Build/Workers/{chunk-4BAE4PWO.js → chunk-BJ3WF5RW.js} +6 -6
- package/Build/Workers/{chunk-Q55ECN3Y.js → chunk-BUOFSNFW.js} +1 -1
- package/Build/Workers/{chunk-QX5XS4LC.js → chunk-BZXF3GNX.js} +2 -2
- package/Build/Workers/{chunk-PYHLO636.js → chunk-DJXXI7UF.js} +5 -5
- package/Build/Workers/{chunk-LCLJJ2MZ.js → chunk-DVAIU7A4.js} +17 -17
- package/Build/Workers/{chunk-SYCPRK3D.js → chunk-FJT3ERV7.js} +9 -9
- package/Build/Workers/{chunk-L6RTJ3RE.js → chunk-GOHDOWU5.js} +14 -14
- package/Build/Workers/{chunk-MSKXMXJI.js → chunk-HA6TZ3XT.js} +4 -4
- package/Build/Workers/{chunk-PCP4YQST.js → chunk-HBZSCVZC.js} +11 -11
- package/Build/Workers/{chunk-5S7OLEPK.js → chunk-HC7RYWPZ.js} +12 -12
- package/Build/Workers/{chunk-VE7BFUIX.js → chunk-HFMJM3SX.js} +1 -1
- package/Build/Workers/{chunk-OOK53QUQ.js → chunk-HFPMX5L2.js} +1 -1
- package/Build/Workers/{chunk-VFBNELXB.js → chunk-HO2NTC7I.js} +6 -6
- package/Build/Workers/{chunk-DOXCPOG4.js → chunk-HZPMWR4H.js} +7 -7
- package/Build/Workers/{chunk-I2RC4XVN.js → chunk-IBG5FVXC.js} +4 -4
- package/Build/Workers/{chunk-LEABCTLP.js → chunk-IXLNNST6.js} +4 -4
- package/Build/Workers/{chunk-4YSNMHZ4.js → chunk-JYUCC5NV.js} +6 -6
- package/Build/Workers/{chunk-BCL4PHHT.js → chunk-KFW4UNQH.js} +10 -10
- package/Build/Workers/{chunk-R6B7UCQB.js → chunk-KKAEXHDY.js} +2 -2
- package/Build/Workers/{chunk-BJF5LOWE.js → chunk-L6FARMF6.js} +7 -7
- package/Build/Workers/{chunk-C2CGMAIU.js → chunk-N3BIL6WA.js} +13 -13
- package/Build/Workers/{chunk-STBBMQGG.js → chunk-O5SSW3B3.js} +6 -6
- package/Build/Workers/{chunk-S3PI2KFM.js → chunk-OC4MYPVW.js} +2 -2
- package/Build/Workers/{chunk-MDHQR3ZS.js → chunk-OOA6GXKD.js} +7 -7
- package/Build/Workers/{chunk-AD5HBJ2F.js → chunk-OSCHEWSG.js} +7 -7
- package/Build/Workers/{chunk-NTXTUNEF.js → chunk-QGT2GMOK.js} +4 -4
- package/Build/Workers/{chunk-VO3ACQB2.js → chunk-RFQYEYAL.js} +17 -17
- package/Build/Workers/{chunk-KUN2ZA5X.js → chunk-RJF5ZP76.js} +4 -4
- package/Build/Workers/{chunk-QD4KM3GO.js → chunk-SIZXFNJY.js} +6 -5
- package/Build/Workers/{chunk-FXIHSF7O.js → chunk-SRZJCF7G.js} +9 -9
- package/Build/Workers/{chunk-T77JILCU.js → chunk-T4MB73MC.js} +2 -2
- package/Build/Workers/{chunk-3WUV74WM.js → chunk-TTI2SUWJ.js} +2 -2
- package/Build/Workers/{chunk-QMLTCCYG.js → chunk-VHJ5ESXF.js} +1 -1
- package/Build/Workers/{chunk-2J3JKXCP.js → chunk-VSFFJGTA.js} +9 -5
- package/Build/Workers/{chunk-DGS5QNIO.js → chunk-WQRXRDCZ.js} +11 -11
- package/Build/Workers/{chunk-OORVMGDU.js → chunk-WXDGOYTT.js} +12 -7
- package/Build/Workers/{chunk-RJYML24O.js → chunk-XLCZE6DD.js} +423 -448
- 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 +24 -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 +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +28 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +20 -22
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/CompressedTextureBuffer.js +11 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/KTX2Transcoder.js +9 -16
- package/Source/Core/PixelFormat.js +1 -15
- package/Source/Core/Simon1994PlanetaryPositions.js +2 -1
- package/Source/Core/Transforms.js +137 -2
- package/Source/DataSources/BillboardGraphics.js +16 -0
- package/Source/DataSources/BillboardVisualizer.js +7 -0
- package/Source/DataSources/CallbackProperty.js +8 -2
- package/Source/DataSources/CheckerboardMaterialProperty.js +7 -1
- package/Source/DataSources/ColorMaterialProperty.js +7 -1
- package/Source/DataSources/CompositeMaterialProperty.js +5 -4
- package/Source/DataSources/CompositePositionProperty.js +7 -1
- package/Source/DataSources/CompositeProperty.js +5 -5
- package/Source/DataSources/ConstantPositionProperty.js +7 -1
- package/Source/DataSources/Entity.js +1 -1
- package/Source/DataSources/GridMaterialProperty.js +7 -1
- package/Source/DataSources/ImageMaterialProperty.js +8 -1
- package/Source/DataSources/MaterialProperty.js +7 -1
- package/Source/DataSources/NodeTransformationProperty.js +7 -1
- package/Source/DataSources/PathVisualizer.js +4 -4
- package/Source/DataSources/PointGraphics.js +17 -0
- package/Source/DataSources/PointVisualizer.js +12 -0
- package/Source/DataSources/PolylineArrowMaterialProperty.js +7 -1
- package/Source/DataSources/PolylineDashMaterialProperty.js +7 -1
- package/Source/DataSources/PolylineGlowMaterialProperty.js +7 -1
- package/Source/DataSources/PolylineOutlineMaterialProperty.js +7 -1
- package/Source/DataSources/PositionProperty.js +5 -8
- package/Source/DataSources/PositionPropertyArray.js +7 -1
- package/Source/DataSources/Property.js +1 -1
- package/Source/DataSources/PropertyArray.js +5 -5
- package/Source/DataSources/PropertyBag.js +5 -4
- package/Source/DataSources/ReferenceProperty.js +7 -1
- package/Source/DataSources/SampledPositionProperty.js +7 -1
- package/Source/DataSources/SampledProperty.js +6 -4
- package/Source/DataSources/ScaledPositionProperty.js +6 -0
- package/Source/DataSources/StripeMaterialProperty.js +7 -1
- package/Source/DataSources/TerrainOffsetProperty.js +9 -0
- package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +7 -1
- package/Source/DataSources/TimeIntervalCollectionProperty.js +5 -5
- package/Source/DataSources/VelocityOrientationProperty.js +6 -1
- package/Source/DataSources/VelocityVectorProperty.js +3 -5
- package/Source/Renderer/AutomaticUniforms.js +3 -18
- package/Source/Renderer/Context.js +15 -0
- package/Source/Renderer/CubeMap.js +326 -348
- package/Source/Renderer/CubeMapFace.js +26 -48
- package/Source/Renderer/PixelDatatype.js +23 -0
- package/Source/Renderer/Sampler.js +7 -13
- package/Source/Renderer/ShaderProgram.js +7 -0
- package/Source/Renderer/Texture.js +396 -332
- package/Source/Renderer/UniformState.js +8 -33
- package/Source/Renderer/demodernizeShader.js +2 -0
- package/Source/Renderer/loadCubeMap.js +3 -8
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +29 -2
- package/Source/Scene/BillboardCollection.js +49 -0
- package/Source/Scene/BingMapsImageryProvider.js +10 -1
- package/Source/Scene/CameraEventAggregator.js +49 -5
- package/Source/Scene/Globe.js +1 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +29 -24
- package/Source/Scene/GlobeSurfaceTileProvider.js +5 -3
- package/Source/Scene/ImageBasedLighting.js +36 -36
- package/Source/Scene/Label.js +2 -2
- package/Source/Scene/Material.js +24 -2
- package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +7 -15
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/PointPrimitive.js +28 -2
- package/Source/Scene/PointPrimitiveCollection.js +22 -9
- package/Source/Scene/PostProcessStageCollection.js +45 -15
- package/Source/Scene/PostProcessStageLibrary.js +26 -0
- package/Source/Scene/Scene.js +20 -22
- package/Source/Scene/SceneTransforms.js +0 -62
- package/Source/Scene/ScreenSpaceCameraController.js +11 -4
- package/Source/Scene/SkyBox.js +13 -19
- package/Source/Scene/SpecularEnvironmentCubeMap.js +240 -0
- package/Source/Scene/Tonemapper.js +35 -23
- package/Source/Scene/VoxelPrimitive.js +0 -29
- package/Source/Scene/VoxelRenderResources.js +0 -3
- package/Source/Shaders/BillboardCollectionFS.glsl +4 -0
- package/Source/Shaders/BillboardCollectionFS.js +4 -0
- package/Source/Shaders/BillboardCollectionVS.glsl +3 -1
- package/Source/Shaders/BillboardCollectionVS.js +3 -1
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +30 -13
- package/Source/Shaders/BrdfLutGeneratorFS.js +30 -13
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -2
- package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +42 -41
- package/Source/Shaders/Builtin/Functions/pbrLighting.js +42 -41
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.glsl +23 -0
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.js +25 -0
- package/Source/Shaders/Builtin/Functions/textureCube.glsl +21 -2
- package/Source/Shaders/Builtin/Functions/textureCube.js +21 -2
- package/Source/Shaders/Builtin/Structs/materialInput.glsl +2 -0
- package/Source/Shaders/Builtin/Structs/materialInput.js +2 -0
- package/Source/Shaders/GlobeFS.glsl +10 -4
- package/Source/Shaders/GlobeFS.js +10 -4
- package/Source/Shaders/Materials/WaterMaskMaterial.glsl +15 -0
- package/Source/Shaders/Materials/WaterMaskMaterial.js +17 -0
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +1 -1
- package/Source/Shaders/Model/AtmosphereStageFS.js +1 -1
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +57 -46
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +57 -46
- package/Source/Shaders/Model/LightingStageFS.glsl +8 -7
- package/Source/Shaders/Model/LightingStageFS.js +8 -7
- package/Source/Shaders/Model/MaterialStageFS.glsl +10 -14
- package/Source/Shaders/Model/MaterialStageFS.js +10 -14
- package/Source/Shaders/PointPrimitiveCollectionFS.glsl +4 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.js +4 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +9 -7
- package/Source/Shaders/PointPrimitiveCollectionVS.js +9 -7
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +4 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +4 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +4 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +4 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +4 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +4 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.glsl +25 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.js +27 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +4 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +4 -0
- package/Source/Shaders/SkyAtmosphereFS.glsl +1 -1
- package/Source/Shaders/SkyAtmosphereFS.js +1 -1
- package/Source/Widget/CesiumWidget.js +1 -1
- package/index.d.ts +191 -106
- package/index.js +133 -134
- package/package.json +4 -4
- package/Source/Scene/OctahedralProjectedCubeMap.js +0 -445
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +0 -78
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +0 -80
- package/Source/Shaders/OctahedralProjectionAtlasFS.glsl +0 -89
- package/Source/Shaders/OctahedralProjectionAtlasFS.js +0 -91
- package/Source/Shaders/OctahedralProjectionFS.glsl +0 -14
- package/Source/Shaders/OctahedralProjectionFS.js +0 -16
- package/Source/Shaders/OctahedralProjectionVS.glsl +0 -10
- 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
|
|
90
|
-
|
|
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",
|
|
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 +
|
|
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 +
|
|
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
|
|
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
|
-
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
}
|