mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
Merge pull request #130 from semleti/master
Upgrade three@138 and devcontainer.json
This commit is contained in:
commit
bfaee20496
9
.devcontainer/devcontainer.json
Normal file
9
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"image": "node:17",
|
||||||
|
"features": {
|
||||||
|
"git": "latest"
|
||||||
|
},"extensions": [
|
||||||
|
"johnsoncodehk.volar",
|
||||||
|
],
|
||||||
|
"forwardPorts": [3000]
|
||||||
|
}
|
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-replace": "^3.0.0",
|
"@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/eslint-plugin": "^5.2.0",
|
||||||
"@typescript-eslint/parser": "^5.2.0",
|
"@typescript-eslint/parser": "^5.2.0",
|
||||||
"@vitejs/plugin-vue": "^2.2.0",
|
"@vitejs/plugin-vue": "^2.2.0",
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"rollup-plugin-dts": "^4.0.0",
|
"rollup-plugin-dts": "^4.0.0",
|
||||||
"rollup-plugin-esbuild": "^4.1.0",
|
"rollup-plugin-esbuild": "^4.1.0",
|
||||||
"stats.js": "0.17.0",
|
"stats.js": "0.17.0",
|
||||||
"three": "^0.136.0",
|
"three": "^0.138.3",
|
||||||
"typescript": "^4.1.5",
|
"typescript": "^4.1.5",
|
||||||
"vite": "^2.6.13",
|
"vite": "^2.6.13",
|
||||||
"vue": "^3.2.20",
|
"vue": "^3.2.20",
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
FrontSide,
|
FrontSide,
|
||||||
LinearMipmapLinearFilter,
|
LinearMipmapLinearFilter,
|
||||||
Mesh as TMesh,
|
Mesh as TMesh,
|
||||||
RGBFormat,
|
RGBAFormat,
|
||||||
WebGLCubeRenderTarget,
|
WebGLCubeRenderTarget,
|
||||||
} from 'three'
|
} from 'three'
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initGem() {
|
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)
|
this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT)
|
||||||
bindProp(this, 'position', this.cubeCamera)
|
bindProp(this, 'position', this.cubeCamera)
|
||||||
this.addToParent(this.cubeCamera)
|
this.addToParent(this.cubeCamera)
|
||||||
|
@ -2,7 +2,7 @@ import { defineComponent } from 'vue'
|
|||||||
import {
|
import {
|
||||||
CubeCamera,
|
CubeCamera,
|
||||||
LinearMipmapLinearFilter,
|
LinearMipmapLinearFilter,
|
||||||
RGBFormat,
|
RGBAFormat,
|
||||||
WebGLCubeRenderTarget,
|
WebGLCubeRenderTarget,
|
||||||
} from 'three'
|
} from 'three'
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initMirrorMesh() {
|
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.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT)
|
||||||
this.addToParent(this.cubeCamera)
|
this.addToParent(this.cubeCamera)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
CubeCamera,
|
CubeCamera,
|
||||||
CubeRefractionMapping,
|
CubeRefractionMapping,
|
||||||
LinearMipmapLinearFilter,
|
LinearMipmapLinearFilter,
|
||||||
RGBFormat,
|
RGBAFormat,
|
||||||
WebGLCubeRenderTarget,
|
WebGLCubeRenderTarget,
|
||||||
} from 'three'
|
} from 'three'
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initMirrorMesh() {
|
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)
|
this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT)
|
||||||
bindProp(this, 'position', this.cubeCamera)
|
bindProp(this, 'position', this.cubeCamera)
|
||||||
this.addToParent(this.cubeCamera)
|
this.addToParent(this.cubeCamera)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { defineComponent, inject, onUnmounted, PropType } from 'vue'
|
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 Object3D from './Object3D'
|
||||||
import { RendererInjectionKey } from './Renderer'
|
import { RendererInjectionKey } from './Renderer'
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const renderer = rendererC.renderer, scene = rendererC.scene
|
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 cubeCamera = new CubeCamera(props.cubeCameraNear, props.cubeCameraFar, cubeRT)
|
||||||
const updateRT = () => {
|
const updateRT = () => {
|
||||||
props.hideMeshes.forEach(m => { m.visible = false })
|
props.hideMeshes.forEach(m => { m.visible = false })
|
||||||
|
Loading…
Reference in New Issue
Block a user