threejs v155
This commit is contained in:
parent
b227690b31
commit
92d953ef62
@ -12,8 +12,8 @@
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
"three": "https://unpkg.com/three@0.152.2/build/three.module.js?module",
|
||||
"three/addons/": "https://unpkg.com/three@0.152.2/examples/jsm/"
|
||||
"three": "https://unpkg.com/three@0.155/build/three.module.js?module",
|
||||
"three/addons/": "https://unpkg.com/three@0.155/examples/jsm/"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -54,19 +54,19 @@ export class TetraGUI extends GUI {
|
||||
scene.vortex.colorFullTextureRotation = 0.006
|
||||
scene.vortex.colorFullMoveForward = 0.015
|
||||
|
||||
scene.ambientLight.intensity = 1
|
||||
scene.directionalLight.intensity = 1
|
||||
scene.ambientLight.intensity = 4
|
||||
scene.directionalLight.intensity = 4
|
||||
|
||||
Mino.material.opacity = 0.6
|
||||
Mino.material.roughness = 0.4
|
||||
Mino.material.metalness = 0.95
|
||||
Mino.mesh.material.opacity = 0.6
|
||||
Mino.mesh.material.roughness = 0.4
|
||||
Mino.mesh.material.metalness = 0.95
|
||||
}
|
||||
break
|
||||
case "Espace":
|
||||
darkTexture = new THREE.TextureLoader(loadingManager).load("./images/dark.jpg", texture => {
|
||||
texture.wrapS = THREE.RepeatWrapping
|
||||
texture.wrapT = THREE.MirroredRepeatWrapping
|
||||
texture.repeat.set(2, 4)
|
||||
texture.repeat.set(1, 2)
|
||||
})
|
||||
colorfullTexture = new THREE.TextureLoader(loadingManager).load("./images/colorfull.jpg", texture => {
|
||||
texture.wrapS = THREE.RepeatWrapping
|
||||
@ -75,18 +75,22 @@ export class TetraGUI extends GUI {
|
||||
})
|
||||
loadingManager.onLoad = function() {
|
||||
scene.vortex.darkCylinder.material.map = darkTexture
|
||||
scene.vortex.darkCylinder.material.opacity = 0.055
|
||||
scene.vortex.darkCylinder.material.opacity = 0.1
|
||||
scene.vortex.colorFullCylinder.material.map = colorfullTexture
|
||||
scene.vortex.colorFullCylinder.material.opacity = 0.6
|
||||
scene.vortex.colorFullCylinder.material.opacity = 0.4
|
||||
|
||||
scene.vortex.globalRotation = 0.028
|
||||
scene.vortex.darkTextureRotation = 0.006
|
||||
scene.vortex.darkMoveForward = 0.007
|
||||
scene.vortex.darkMoveForward = 0.02
|
||||
scene.vortex.colorFullTextureRotation = 0.006
|
||||
scene.vortex.colorFullMoveForward = 0.02
|
||||
scene.vortex.colorFullMoveForward = 0.007
|
||||
|
||||
scene.ambientLight.intensity = 0.6
|
||||
scene.directionalLight.intensity = 1
|
||||
scene.ambientLight.intensity = 20
|
||||
scene.directionalLight.intensity = 10
|
||||
|
||||
Mino.mesh.material.opacity = 0.6
|
||||
Mino.mesh.material.roughness = 0.08
|
||||
Mino.mesh.material.metalness = 0.98
|
||||
}
|
||||
break
|
||||
}
|
||||
|
@ -14,10 +14,10 @@ export class TetraScene extends THREE.Scene {
|
||||
this.vortex = new Vortex(this.loadingManager)
|
||||
this.add(this.vortex)
|
||||
|
||||
this.ambientLight = new THREE.AmbientLight(0xffffff, 1)
|
||||
this.ambientLight = new THREE.AmbientLight(0xffffff, 4)
|
||||
this.add(this.ambientLight)
|
||||
|
||||
this.directionalLight = new THREE.DirectionalLight(0xffffff, 1)
|
||||
this.directionalLight = new THREE.DirectionalLight(0xffffff, 4)
|
||||
this.directionalLight.position.set(5, 0, 20)
|
||||
this.add(this.directionalLight)
|
||||
|
||||
|
@ -57,7 +57,7 @@ const envRenderTarget = new THREE.WebGLCubeRenderTarget(256)
|
||||
const environnement = envRenderTarget.texture
|
||||
environnement.type = THREE.HalfFloatType
|
||||
environnement.camera = new THREE.CubeCamera(1, 1000, envRenderTarget)
|
||||
environnement.camera.position.set(5, 10)
|
||||
environnement.camera.position.set(5, 10, 0)
|
||||
|
||||
|
||||
class InstancedMino extends THREE.InstancedMesh {
|
||||
@ -121,7 +121,7 @@ class Mino extends THREE.Object3D {
|
||||
side: THREE.DoubleSide,
|
||||
transparent: true,
|
||||
opacity: 0.6,
|
||||
roughness: 0.06,
|
||||
roughness: 0.4,
|
||||
metalness: 0.95,
|
||||
})
|
||||
this.mesh = new InstancedMino(minoGeometry, minoMaterial, 2*ROWS*COLUMNS)
|
||||
|
@ -127,6 +127,7 @@ body {
|
||||
padding: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
cursor: progress;
|
||||
}
|
||||
|
||||
.e-loadholder {
|
||||
|
Loading…
x
Reference in New Issue
Block a user