This commit is contained in:
Adrien MALINGREY 2023-07-14 19:56:28 +02:00
parent 0521e2f0ba
commit c42ee23b5f
4 changed files with 31 additions and 31 deletions

View File

@ -33,27 +33,27 @@ export class TetraGUI extends GUI {
let darkTexture, colorfullTexture let darkTexture, colorfullTexture
switch (background) { switch (background) {
case "Plasma": case "Plasma":
darkTexture = new THREE.TextureLoader(loadingManager).load("./images/plasma2.jpg", texture => { darkTexture = new THREE.TextureLoader(loadingManager).load("./images/plasma.jpg", texture => {
texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(2, 1)
})
colorfullTexture = new THREE.TextureLoader(loadingManager).load("./images/plasma.jpg", texture => {
texture.wrapS = THREE.RepeatWrapping texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(1, 1) texture.repeat.set(1, 1)
}) })
colorfullTexture = new THREE.TextureLoader(loadingManager).load("./images/plasma2.jpg", texture => {
texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(2, 1)
})
loadingManager.onLoad = function() { loadingManager.onLoad = function() {
scene.vortex.darkCylinder.material.map = darkTexture scene.vortex.darkCylinder.material.map = darkTexture
scene.vortex.darkCylinder.material.opacity = 0.75 scene.vortex.darkCylinder.material.opacity = 0.1
scene.vortex.colorFullCylinder.material.map = colorfullTexture scene.vortex.colorFullCylinder.material.map = colorfullTexture
scene.vortex.colorFullCylinder.material.opacity = 0.075 scene.vortex.colorFullCylinder.material.opacity = 0.7
scene.vortex.globalRotation = 0.028 scene.vortex.globalRotation = 0.028
scene.vortex.darkTextureRotation = 0.005 scene.vortex.darkTextureRotation = 0.005
scene.vortex.darkMoveForward = 0.012 scene.vortex.darkMoveForward = 0.009
scene.vortex.colorFullTextureRotation = 0.006 scene.vortex.colorFullTextureRotation = 0.006
scene.vortex.colorFullMoveForward = 0.016 scene.vortex.colorFullMoveForward = 0.013
scene.ambientLight.intensity = 0.5 scene.ambientLight.intensity = 0.5
scene.directionalLight.intensity = 6 scene.directionalLight.intensity = 6
@ -133,6 +133,10 @@ export class TetraGUI extends GUI {
cameraPosition.add(scene.camera.position, "x") cameraPosition.add(scene.camera.position, "x")
cameraPosition.add(scene.camera.position, "y") cameraPosition.add(scene.camera.position, "y")
cameraPosition.add(scene.camera.position, "z") cameraPosition.add(scene.camera.position, "z")
let light = this.debug.addFolder("lights intensity").close()
light.add(scene.ambientLight, "intensity").name("ambient").min(0).max(20)
light.add(scene.directionalLight, "intensity").name("directional").min(0).max(20)
let directionalLightPosition = this.debug.addFolder("directionalLight.position").close() let directionalLightPosition = this.debug.addFolder("directionalLight.position").close()
directionalLightPosition.add(scene.directionalLight.position, "x") directionalLightPosition.add(scene.directionalLight.position, "x")
@ -144,19 +148,15 @@ export class TetraGUI extends GUI {
directionalLightTargetPosition.add(scene.directionalLight.target.position, "y") directionalLightTargetPosition.add(scene.directionalLight.target.position, "y")
directionalLightTargetPosition.add(scene.directionalLight.target.position, "z") directionalLightTargetPosition.add(scene.directionalLight.target.position, "z")
let light = this.debug.addFolder("lights intensity").close()
light.add(scene.ambientLight, "intensity").name("ambient").min(0).max(20)
light.add(scene.directionalLight, "intensity").name("directional").min(0).max(20)
let vortex = this.debug.addFolder("vortex opacity").close() let vortex = this.debug.addFolder("vortex opacity").close()
vortex.add(scene.vortex.darkCylinder.material, "opacity").name("dark").min(0).max(1) vortex.add(scene.vortex.darkCylinder.material, "opacity").name("dark").min(0).max(1)
vortex.add(scene.vortex.colorFullCylinder.material, "opacity").name("colorFull").min(0).max(1) vortex.add(scene.vortex.colorFullCylinder.material, "opacity").name("colorFull").min(0).max(1)
let material = this.debug.addFolder("minoes material").close() let material = this.debug.addFolder("minoes material").close()
material.add(minoMaterial, "opacity").min(0).max(1) material.add(minoMaterial, "opacity").min(0).max(1)
//material.add(minoMaterial, "reflectivity").min(0).max(1) material.add(minoMaterial, "reflectivity").min(0).max(1)
material.add(minoMaterial, "roughness").min(0).max(1) //material.add(minoMaterial, "roughness").min(0).max(1)
material.add(minoMaterial, "metalness").min(0).max(1) //material.add(minoMaterial, "metalness").min(0).max(1)
//material.add(minoMaterial, "attenuationDistance").min(0).max(1).hide() //material.add(minoMaterial, "attenuationDistance").min(0).max(1).hide()
//material.add(minoMaterial, "ior").min(1).max(2).hide() //material.add(minoMaterial, "ior").min(1).max(2).hide()
//material.add(minoMaterial, "sheen").min(0).max(1).hide() //material.add(minoMaterial, "sheen").min(0).max(1).hide()

View File

@ -16,10 +16,10 @@ export class TetraScene extends THREE.Scene {
this.add(this.ambientLight) this.add(this.ambientLight)
this.directionalLight = new THREE.DirectionalLight(0xffffff, 6) this.directionalLight = new THREE.DirectionalLight(0xffffff, 6)
this.directionalLight.position.set(5, -20, 0) this.directionalLight.position.set(5, -100, -20)
this.add(this.directionalLight) this.add(this.directionalLight)
this.directionalLight.target = new THREE.Object3D() this.directionalLight.target = new THREE.Object3D()
this.directionalLight.target.position.set(5, -10, 20) this.directionalLight.target.position.set(5, 0, 0)
this.add(this.directionalLight.target) this.add(this.directionalLight.target)

View File

@ -8,10 +8,10 @@ export class Vortex extends THREE.Group {
this.globalRotation = 0.028 this.globalRotation = 0.028
this.darkTextureRotation = 0.006 this.darkTextureRotation = 0.006
this.darkMoveForward = 0.011 this.darkMoveForward = 0.009
this.colorFullTextureRotation = 0.006 this.colorFullTextureRotation = 0.006
this.colorFullMoveForward = 0.09 this.colorFullMoveForward = 0.013
const commonCylinderGeometry = new THREE.CylinderGeometry(35, 35, 500, 12, 1, true) const commonCylinderGeometry = new THREE.CylinderGeometry(35, 35, 500, 12, 1, true)
@ -21,13 +21,13 @@ export class Vortex extends THREE.Group {
commonCylinderGeometry, commonCylinderGeometry,
new THREE.MeshLambertMaterial({ new THREE.MeshLambertMaterial({
side: THREE.BackSide, side: THREE.BackSide,
map: new THREE.TextureLoader(loadingManager).load("./images/plasma.jpg", (texture) => { map: new THREE.TextureLoader(loadingManager).load("./images/plasma2.jpg", (texture) => {
texture.wrapS = THREE.RepeatWrapping texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(2, 1) texture.repeat.set(1, 1)
}), }),
blending: THREE.AdditiveBlending, blending: THREE.AdditiveBlending,
opacity: 0.75 opacity: 0.1
}) })
) )
this.add(this.darkCylinder) this.add(this.darkCylinder)
@ -36,13 +36,13 @@ export class Vortex extends THREE.Group {
commonCylinderGeometry, commonCylinderGeometry,
new THREE.MeshBasicMaterial({ new THREE.MeshBasicMaterial({
side: THREE.BackSide, side: THREE.BackSide,
map: new THREE.TextureLoader(loadingManager).load("./images/plasma2.jpg", (texture) => { map: new THREE.TextureLoader(loadingManager).load("./images/plasma.jpg", (texture) => {
texture.wrapS = THREE.RepeatWrapping texture.wrapS = THREE.RepeatWrapping
texture.wrapT = THREE.MirroredRepeatWrapping texture.wrapT = THREE.MirroredRepeatWrapping
texture.repeat.set(1, 1) texture.repeat.set(2, 1)
}), }),
blending: THREE.AdditiveBlending, blending: THREE.AdditiveBlending,
opacity: 0.075 opacity: 0.7
}) })
) )
this.add(this.colorFullCylinder) this.add(this.colorFullCylinder)

View File

@ -71,21 +71,21 @@ const minoExtrudeSettings = {
} }
let minoGeometry = new THREE.ExtrudeGeometry(minoFaceShape, minoExtrudeSettings) let minoGeometry = new THREE.ExtrudeGeometry(minoFaceShape, minoExtrudeSettings)
/*let minoMaterial = new THREE.MeshBasicMaterial({ let minoMaterial = new THREE.MeshBasicMaterial({
envMap: environnement, envMap: environnement,
side: THREE.DoubleSide, side: THREE.DoubleSide,
transparent: true, transparent: true,
opacity: 0.8, opacity: 0.8,
reflectivity: 0.9, reflectivity: 0.9,
})*/ })
let minoMaterial = new THREE.MeshStandardMaterial({ /*let minoMaterial = new THREE.MeshStandardMaterial({
envMap: environnement, envMap: environnement,
side: THREE.DoubleSide, side: THREE.DoubleSide,
transparent: true, transparent: true,
opacity: 0.6, opacity: 0.6,
roughness: 0.1, roughness: 0.1,
metalness: 0.9, metalness: 0.9,
}) })/*
/* /*
let minoMaterial = new THREE.MeshPhysicalMaterial({ let minoMaterial = new THREE.MeshPhysicalMaterial({
envMap: environnement, envMap: environnement,