From ba2665e741b6ce98a6c580d1258557a4507e2056 Mon Sep 17 00:00:00 2001 From: semleti Date: Wed, 23 Mar 2022 18:04:05 +0000 Subject: [PATCH 1/2] devcontainer node:17 --- .devcontainer/devcontainer.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..fea3398 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,9 @@ +{ + "image": "node:17", + "features": { + "git": "latest" + },"extensions": [ + "johnsoncodehk.volar", + ], + "forwardPorts": [3000] +} From 80ef731a16b25a9949df8c57c279eb8cc11acb8a Mon Sep 17 00:00:00 2001 From: semleti Date: Wed, 23 Mar 2022 18:05:10 +0000 Subject: [PATCH 2/2] upgrade three@138 refactor RGBFormat -> RGBAFormat --- package.json | 4 ++-- src/components/meshes/Gem.js | 4 ++-- src/components/meshes/MirrorMesh.js | 4 ++-- src/components/meshes/RefractionMesh.js | 4 ++-- src/core/CubeCamera.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 0df1cc1..6d0f275 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "devDependencies": { "@rollup/plugin-replace": "^3.0.0", - "@types/three": "^0.136.0", + "@types/three": "^0.138.0", "@typescript-eslint/eslint-plugin": "^5.2.0", "@typescript-eslint/parser": "^5.2.0", "@vitejs/plugin-vue": "^2.2.0", @@ -27,7 +27,7 @@ "rollup-plugin-dts": "^4.0.0", "rollup-plugin-esbuild": "^4.1.0", "stats.js": "0.17.0", - "three": "^0.136.0", + "three": "^0.138.3", "typescript": "^4.1.5", "vite": "^2.6.13", "vue": "^3.2.20", diff --git a/src/components/meshes/Gem.js b/src/components/meshes/Gem.js index 71e37bf..c765413 100644 --- a/src/components/meshes/Gem.js +++ b/src/components/meshes/Gem.js @@ -5,7 +5,7 @@ import { FrontSide, LinearMipmapLinearFilter, Mesh as TMesh, - RGBFormat, + RGBAFormat, WebGLCubeRenderTarget, } from 'three' @@ -32,7 +32,7 @@ export default defineComponent({ }, methods: { initGem() { - const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) + const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBAFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT) bindProp(this, 'position', this.cubeCamera) this.addToParent(this.cubeCamera) diff --git a/src/components/meshes/MirrorMesh.js b/src/components/meshes/MirrorMesh.js index 39d780c..ba9f809 100644 --- a/src/components/meshes/MirrorMesh.js +++ b/src/components/meshes/MirrorMesh.js @@ -2,7 +2,7 @@ import { defineComponent } from 'vue' import { CubeCamera, LinearMipmapLinearFilter, - RGBFormat, + RGBAFormat, WebGLCubeRenderTarget, } from 'three' @@ -27,7 +27,7 @@ export default defineComponent({ }, methods: { initMirrorMesh() { - const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) + const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBAFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT) this.addToParent(this.cubeCamera) diff --git a/src/components/meshes/RefractionMesh.js b/src/components/meshes/RefractionMesh.js index 093563e..66d3dab 100644 --- a/src/components/meshes/RefractionMesh.js +++ b/src/components/meshes/RefractionMesh.js @@ -3,7 +3,7 @@ import { CubeCamera, CubeRefractionMapping, LinearMipmapLinearFilter, - RGBFormat, + RGBAFormat, WebGLCubeRenderTarget, } from 'three' @@ -29,7 +29,7 @@ export default defineComponent({ }, methods: { initMirrorMesh() { - const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { mapping: CubeRefractionMapping, format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) + const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { mapping: CubeRefractionMapping, format: RGBAFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT) bindProp(this, 'position', this.cubeCamera) this.addToParent(this.cubeCamera) diff --git a/src/core/CubeCamera.ts b/src/core/CubeCamera.ts index 58dbf47..3e72655 100644 --- a/src/core/CubeCamera.ts +++ b/src/core/CubeCamera.ts @@ -1,5 +1,5 @@ import { defineComponent, inject, onUnmounted, PropType } from 'vue' -import { CubeCamera, LinearMipmapLinearFilter, Mesh, RGBFormat, WebGLCubeRenderTarget } from 'three' +import { CubeCamera, LinearMipmapLinearFilter, Mesh, RGBAFormat, WebGLCubeRenderTarget } from 'three' import Object3D from './Object3D' import { RendererInjectionKey } from './Renderer' @@ -26,7 +26,7 @@ export default defineComponent({ } const renderer = rendererC.renderer, scene = rendererC.scene - const cubeRT = new WebGLCubeRenderTarget(props.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) + const cubeRT = new WebGLCubeRenderTarget(props.cubeRTSize, { format: RGBAFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }) const cubeCamera = new CubeCamera(props.cubeCameraNear, props.cubeCameraFar, cubeRT) const updateRT = () => { props.hideMeshes.forEach(m => { m.visible = false })