From 728f473518f45b14278d98291379988f7da210b8 Mon Sep 17 00:00:00 2001 From: mgermerie <73115044+mgermerie@users.noreply.github.com> Date: Fri, 2 Jun 2023 17:05:32 +0200 Subject: [PATCH] chore: update three to 0.153.0 --- config/threeExamples.mjs | 1 + examples/itowns-potree.html | 2 +- examples/view_multi_25d.html | 2 +- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- src/Converter/Feature2Texture.js | 2 +- src/Core/Prefab/Globe/SkyShader.js | 2 +- src/Core/Prefab/GlobeView.js | 2 +- src/Core/Prefab/PlanarView.js | 2 +- src/Parser/LASParser.js | 2 +- src/Parser/deprecated/LegacyGLTFLoader.js | 2 +- src/Renderer/OrientedImageMaterial.js | 2 +- src/Utils/CameraUtils.js | 2 +- test/unit/cameraUtils.js | 2 +- 14 files changed, 22 insertions(+), 21 deletions(-) diff --git a/config/threeExamples.mjs b/config/threeExamples.mjs index 86022d1044..e497dcb6e5 100644 --- a/config/threeExamples.mjs +++ b/config/threeExamples.mjs @@ -4,6 +4,7 @@ export default { './loaders/GLTFLoader.js', './loaders/DRACOLoader.js', './loaders/DDSLoader.js', + './utils/BufferGeometryUtils.js', './capabilities/WebGL.js', ], }; diff --git a/examples/itowns-potree.html b/examples/itowns-potree.html index c9f3dd89c0..9c3c5262ee 100644 --- a/examples/itowns-potree.html +++ b/examples/itowns-potree.html @@ -34,7 +34,7 @@ with `itowns.THREE` or `itowns.proj4`. --> diff --git a/examples/view_multi_25d.html b/examples/view_multi_25d.html index dde280775c..7a3671f7ff 100644 --- a/examples/view_multi_25d.html +++ b/examples/view_multi_25d.html @@ -79,7 +79,7 @@ // `viewerDiv` will contain iTowns' rendering area (``) viewerDiv = document.getElementById('viewerDiv'); - itowns.THREE.Object3D.DefaultUp.set(0, 0, 1); + itowns.THREE.Object3D.DEFAULT_UP.set(0, 0, 1); scale = new itowns.THREE.Vector3(1, 1, 1).divideScalar(extent.planarDimensions().x); diff --git a/package-lock.json b/package-lock.json index 01aa7eff79..50e60d2d78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,7 @@ "puppeteer": "^14.1.1", "q": "^1.5.1", "replace-in-file": "^6.3.2", - "three": "0.146.0", + "three": "0.153.0", "url-polyfill": "^1.1.12", "webpack": "^5.72.1", "webpack-cli": "^4.9.2", @@ -67,7 +67,7 @@ }, "peerDependencies": { "proj4": "^2.8.0", - "three": "0.146.0" + "three": "0.153.0" } }, "node_modules/@ampproject/remapping": { @@ -11302,9 +11302,9 @@ "dev": true }, "node_modules/three": { - "version": "0.146.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.146.0.tgz", - "integrity": "sha512-1lvNfLezN6OJ9NaFAhfX4sm5e9YCzHtaRgZ1+B4C+Hv6TibRMsuBAM5/wVKzxjpYIlMymvgsHEFrrigEfXnb2A==", + "version": "0.153.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.153.0.tgz", + "integrity": "sha512-OCP2/uQR6GcDpSLnJt/3a4mdS0kNWcbfUXIwLoEMgLzEUIVIYsSDwskpmOii/AkDM+BBwrl6+CKgrjX9+E2aWg==", "dev": true }, "node_modules/through": { @@ -21004,9 +21004,9 @@ "dev": true }, "three": { - "version": "0.146.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.146.0.tgz", - "integrity": "sha512-1lvNfLezN6OJ9NaFAhfX4sm5e9YCzHtaRgZ1+B4C+Hv6TibRMsuBAM5/wVKzxjpYIlMymvgsHEFrrigEfXnb2A==", + "version": "0.153.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.153.0.tgz", + "integrity": "sha512-OCP2/uQR6GcDpSLnJt/3a4mdS0kNWcbfUXIwLoEMgLzEUIVIYsSDwskpmOii/AkDM+BBwrl6+CKgrjX9+E2aWg==", "dev": true }, "through": { diff --git a/package.json b/package.json index 3c78377365..2ce645b58e 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ }, "peerDependencies": { "proj4": "^2.8.0", - "three": "0.146.0" + "three": "0.153.0" }, "devDependencies": { "@babel/cli": "^7.17.10", @@ -109,7 +109,7 @@ "puppeteer": "^14.1.1", "q": "^1.5.1", "replace-in-file": "^6.3.2", - "three": "0.146.0", + "three": "0.153.0", "url-polyfill": "^1.1.12", "webpack": "^5.72.1", "webpack-cli": "^4.9.2", diff --git a/src/Converter/Feature2Texture.js b/src/Converter/Feature2Texture.js index e3f1945c47..03190bc8aa 100644 --- a/src/Converter/Feature2Texture.js +++ b/src/Converter/Feature2Texture.js @@ -210,7 +210,7 @@ export default { data[0] = backgroundColor.r * 255; data[1] = backgroundColor.g * 255; data[2] = backgroundColor.b * 255; - texture = new THREE.DataTexture(data, 1, 1, THREE.RGBFormat); + texture = new THREE.DataTexture(data, 1, 1, THREE.RGBAFormat); } else { texture = new THREE.Texture(); } diff --git a/src/Core/Prefab/Globe/SkyShader.js b/src/Core/Prefab/Globe/SkyShader.js index c3822504ea..c2c9a5963f 100644 --- a/src/Core/Prefab/Globe/SkyShader.js +++ b/src/Core/Prefab/Globe/SkyShader.js @@ -274,7 +274,7 @@ class Sky extends THREE.Mesh { depthWrite: false, }); - const skyGeo = new THREE.SphereBufferGeometry(40000, 32, 15); + const skyGeo = new THREE.SphereGeometry(40000, 32, 15); super(skyGeo, skyMat); } } diff --git a/src/Core/Prefab/GlobeView.js b/src/Core/Prefab/GlobeView.js index 4327821ed4..2b891756ad 100644 --- a/src/Core/Prefab/GlobeView.js +++ b/src/Core/Prefab/GlobeView.js @@ -94,7 +94,7 @@ class GlobeView extends View { * @param {Object} options.controls - See options of {@link GlobeControls} */ constructor(viewerDiv, placement = {}, options = {}) { - THREE.Object3D.DefaultUp.set(0, 0, 1); + THREE.Object3D.DEFAULT_UP.set(0, 0, 1); // Setup View super('EPSG:4978', viewerDiv, options); this.isGlobeView = true; diff --git a/src/Core/Prefab/PlanarView.js b/src/Core/Prefab/PlanarView.js index 74de41f0b2..f9f1bbcd15 100644 --- a/src/Core/Prefab/PlanarView.js +++ b/src/Core/Prefab/PlanarView.js @@ -33,7 +33,7 @@ class PlanarView extends View { * initialization. By default, camera will display the view's extent (given in `extent` parameter). */ constructor(viewerDiv, extent, options = {}) { - THREE.Object3D.DefaultUp.set(0, 0, 1); + THREE.Object3D.DEFAULT_UP.set(0, 0, 1); // Setup View super(extent.crs, viewerDiv, options); diff --git a/src/Parser/LASParser.js b/src/Parser/LASParser.js index dbe316c9dc..17182a9b95 100644 --- a/src/Parser/LASParser.js +++ b/src/Parser/LASParser.js @@ -45,7 +45,7 @@ export default { geometry.userData.vertexCount = parsedData.header.vertexCount; geometry.userData.boundingBox = parsedData.header.boundingBox; - const positionBuffer = new THREE.BufferAttribute(parsedData.attributes.POSITION.value, 3, false); + const positionBuffer = new THREE.BufferAttribute(parsedData.attributes.POSITION.value, 3); geometry.setAttribute('position', positionBuffer); const intensityBuffer = new THREE.BufferAttribute(parsedData.attributes.intensity.value, 1, true); diff --git a/src/Parser/deprecated/LegacyGLTFLoader.js b/src/Parser/deprecated/LegacyGLTFLoader.js index a4c069c73b..69ce367870 100644 --- a/src/Parser/deprecated/LegacyGLTFLoader.js +++ b/src/Parser/deprecated/LegacyGLTFLoader.js @@ -452,7 +452,7 @@ threeExamples.LegacyGLTFLoader = ( function () { var WEBGL_TEXTURE_FORMATS = { 6406: THREE.AlphaFormat, - 6407: THREE.RGBFormat, + 6407: THREE.RGBAFormat, 6408: THREE.RGBAFormat, 6409: THREE.LuminanceFormat, 6410: THREE.LuminanceAlphaFormat diff --git a/src/Renderer/OrientedImageMaterial.js b/src/Renderer/OrientedImageMaterial.js index d01c78357b..baf7f8b6db 100644 --- a/src/Renderer/OrientedImageMaterial.js +++ b/src/Renderer/OrientedImageMaterial.js @@ -4,7 +4,7 @@ import textureVS from 'Renderer/Shader/ProjectiveTextureVS.glsl'; import textureFS from 'Renderer/Shader/ProjectiveTextureFS.glsl'; import ShaderUtils from 'Renderer/Shader/ShaderUtils'; -const ndcToTextureMatrix = new THREE.Matrix4().set( +const ndcToTextureMatrix = new THREE.Matrix4( 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 2, 0, diff --git a/src/Utils/CameraUtils.js b/src/Utils/CameraUtils.js index ec6a57d7bd..63ecc90607 100644 --- a/src/Utils/CameraUtils.js +++ b/src/Utils/CameraUtils.js @@ -7,7 +7,7 @@ import Ellipsoid from 'Core/Math/Ellipsoid'; import OBB from 'Renderer/OBB'; import { VIEW_EVENTS } from 'Core/View'; -THREE.Object3D.DefaultUp.set(0, 0, 1); +THREE.Object3D.DEFAULT_UP.set(0, 0, 1); const targetPosition = new THREE.Vector3(); const targetCoord = new Coordinates('EPSG:4326', 0, 0, 0); const ellipsoid = new Ellipsoid(); diff --git a/test/unit/cameraUtils.js b/test/unit/cameraUtils.js index f76135b9cf..a8e57c059c 100644 --- a/test/unit/cameraUtils.js +++ b/test/unit/cameraUtils.js @@ -15,7 +15,7 @@ function equalToFixed(value1, value2, toFixed) { } describe('Camera utils unit test', function () { - THREE.Object3D.DefaultUp = new THREE.Vector3(0, 0, 1); + THREE.Object3D.DEFAULT_UP = new THREE.Vector3(0, 0, 1); const original = DEMUtils.getElevationValueAt;