From 8b9f8b5ebcbd745769dbc397c50aafa78f1a5d9e Mon Sep 17 00:00:00 2001 From: rtm516 Date: Fri, 29 Sep 2023 12:55:22 +0100 Subject: [PATCH] Fix imports for viewer (#149) --- package-lock.json | 54 +++++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- src/viewer.ts | 5 +++-- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a9f48d..64ec80e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "3.0.1", "license": "MIT", "dependencies": { - "@types/three": "^0.142.0", + "@types/three": "^0.156.0", "skinview-utils": "^0.7.1", "three": "^0.156.1" }, @@ -503,12 +503,20 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "node_modules/@types/stats.js": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.1.tgz", + "integrity": "sha512-OgfYE1x2w1jRUXzzKABX+kOdwz2y9PE0uSwnZabkWfJTWOzm7Pvfm4JI2xqRE0q2nwUe2jZLWcrcnhd9lQU63w==" + }, "node_modules/@types/three": { - "version": "0.142.0", - "resolved": "https://registry.npmjs.org/@types/three/-/three-0.142.0.tgz", - "integrity": "sha512-YNVnlqthfgqsxKuSNbT/G2r+ha/6x+aJm7kvjT+sxa4jUROw/KOPm5xzGj33sk1+Librg6NwH/wJ6LCDX33UZg==", + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.156.0.tgz", + "integrity": "sha512-733bXDSRdlrxqOmQuOmfC1UBRuJ2pREPk8sWnx9MtIJEVDQMx8U0NQO5MVVaOrjzDPyLI+cFPim2X/ss9v0+LQ==", "dependencies": { - "@types/webxr": "*" + "@types/stats.js": "*", + "@types/webxr": "*", + "fflate": "~0.6.10", + "meshoptimizer": "~0.18.1" } }, "node_modules/@types/webxr": { @@ -1826,6 +1834,11 @@ "reusify": "^1.0.4" } }, + "node_modules/fflate": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz", + "integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==" + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -3126,6 +3139,11 @@ "node": ">= 8" } }, + "node_modules/meshoptimizer": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", + "integrity": "sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==" + }, "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -4883,12 +4901,20 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "@types/stats.js": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.1.tgz", + "integrity": "sha512-OgfYE1x2w1jRUXzzKABX+kOdwz2y9PE0uSwnZabkWfJTWOzm7Pvfm4JI2xqRE0q2nwUe2jZLWcrcnhd9lQU63w==" + }, "@types/three": { - "version": "0.142.0", - "resolved": "https://registry.npmjs.org/@types/three/-/three-0.142.0.tgz", - "integrity": "sha512-YNVnlqthfgqsxKuSNbT/G2r+ha/6x+aJm7kvjT+sxa4jUROw/KOPm5xzGj33sk1+Librg6NwH/wJ6LCDX33UZg==", + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.156.0.tgz", + "integrity": "sha512-733bXDSRdlrxqOmQuOmfC1UBRuJ2pREPk8sWnx9MtIJEVDQMx8U0NQO5MVVaOrjzDPyLI+cFPim2X/ss9v0+LQ==", "requires": { - "@types/webxr": "*" + "@types/stats.js": "*", + "@types/webxr": "*", + "fflate": "~0.6.10", + "meshoptimizer": "~0.18.1" } }, "@types/webxr": { @@ -5854,6 +5880,11 @@ "reusify": "^1.0.4" } }, + "fflate": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz", + "integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==" + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -6863,6 +6894,11 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, + "meshoptimizer": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", + "integrity": "sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==" + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", diff --git a/package.json b/package.json index 896c2e8..c51ce23 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "assets" ], "dependencies": { - "@types/three": "^0.142.0", + "@types/three": "^0.156.0", "skinview-utils": "^0.7.1", "three": "^0.156.1" }, diff --git a/src/viewer.ts b/src/viewer.ts index 1519a69..0fa43a7 100644 --- a/src/viewer.ts +++ b/src/viewer.ts @@ -23,7 +23,7 @@ import { Vector2, WebGLRenderer, AmbientLight, - Mapping, + type Mapping, CanvasTexture, WebGLRenderTarget, FloatType, @@ -32,7 +32,8 @@ import { Object3D, } from "three"; import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js"; -import { EffectComposer, FullScreenQuad } from "three/examples/jsm/postprocessing/EffectComposer.js"; +import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer.js"; +import { FullScreenQuad } from "three/examples/jsm/postprocessing/Pass.js"; import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass.js"; import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass.js"; import { FXAAShader } from "three/examples/jsm/shaders/FXAAShader.js";