From c42ee23b5fbab45322c034888ed5088918547692 Mon Sep 17 00:00:00 2001 From: adrien Date: Fri, 14 Jul 2023 19:56:28 +0200 Subject: [PATCH] tweaking --- jsm/TetraGUI.js | 34 +++++++++++++++++----------------- jsm/TetraScene.js | 4 ++-- jsm/Vortex.js | 16 ++++++++-------- jsm/gamelogic.js | 8 ++++---- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/jsm/TetraGUI.js b/jsm/TetraGUI.js index a4b9cb8..721868c 100644 --- a/jsm/TetraGUI.js +++ b/jsm/TetraGUI.js @@ -33,27 +33,27 @@ export class TetraGUI extends GUI { let darkTexture, colorfullTexture switch (background) { case "Plasma": - darkTexture = new THREE.TextureLoader(loadingManager).load("./images/plasma2.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 => { + darkTexture = new THREE.TextureLoader(loadingManager).load("./images/plasma.jpg", texture => { texture.wrapS = THREE.RepeatWrapping texture.wrapT = THREE.MirroredRepeatWrapping 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() { 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.opacity = 0.075 + scene.vortex.colorFullCylinder.material.opacity = 0.7 scene.vortex.globalRotation = 0.028 scene.vortex.darkTextureRotation = 0.005 - scene.vortex.darkMoveForward = 0.012 + scene.vortex.darkMoveForward = 0.009 scene.vortex.colorFullTextureRotation = 0.006 - scene.vortex.colorFullMoveForward = 0.016 + scene.vortex.colorFullMoveForward = 0.013 scene.ambientLight.intensity = 0.5 scene.directionalLight.intensity = 6 @@ -133,6 +133,10 @@ export class TetraGUI extends GUI { cameraPosition.add(scene.camera.position, "x") cameraPosition.add(scene.camera.position, "y") 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() 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, "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() 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) let material = this.debug.addFolder("minoes material").close() material.add(minoMaterial, "opacity").min(0).max(1) - //material.add(minoMaterial, "reflectivity").min(0).max(1) - material.add(minoMaterial, "roughness").min(0).max(1) - material.add(minoMaterial, "metalness").min(0).max(1) + material.add(minoMaterial, "reflectivity").min(0).max(1) + //material.add(minoMaterial, "roughness").min(0).max(1) + //material.add(minoMaterial, "metalness").min(0).max(1) //material.add(minoMaterial, "attenuationDistance").min(0).max(1).hide() //material.add(minoMaterial, "ior").min(1).max(2).hide() //material.add(minoMaterial, "sheen").min(0).max(1).hide() diff --git a/jsm/TetraScene.js b/jsm/TetraScene.js index 44cca81..e7690bb 100644 --- a/jsm/TetraScene.js +++ b/jsm/TetraScene.js @@ -16,10 +16,10 @@ export class TetraScene extends THREE.Scene { this.add(this.ambientLight) 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.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) diff --git a/jsm/Vortex.js b/jsm/Vortex.js index 58143bc..aebeb90 100644 --- a/jsm/Vortex.js +++ b/jsm/Vortex.js @@ -8,10 +8,10 @@ export class Vortex extends THREE.Group { this.globalRotation = 0.028 this.darkTextureRotation = 0.006 - this.darkMoveForward = 0.011 + this.darkMoveForward = 0.009 this.colorFullTextureRotation = 0.006 - this.colorFullMoveForward = 0.09 + this.colorFullMoveForward = 0.013 const commonCylinderGeometry = new THREE.CylinderGeometry(35, 35, 500, 12, 1, true) @@ -21,13 +21,13 @@ export class Vortex extends THREE.Group { commonCylinderGeometry, new THREE.MeshLambertMaterial({ 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.wrapT = THREE.MirroredRepeatWrapping - texture.repeat.set(2, 1) + texture.repeat.set(1, 1) }), blending: THREE.AdditiveBlending, - opacity: 0.75 + opacity: 0.1 }) ) this.add(this.darkCylinder) @@ -36,13 +36,13 @@ export class Vortex extends THREE.Group { commonCylinderGeometry, new THREE.MeshBasicMaterial({ 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.wrapT = THREE.MirroredRepeatWrapping - texture.repeat.set(1, 1) + texture.repeat.set(2, 1) }), blending: THREE.AdditiveBlending, - opacity: 0.075 + opacity: 0.7 }) ) this.add(this.colorFullCylinder) diff --git a/jsm/gamelogic.js b/jsm/gamelogic.js index b27920f..c882607 100644 --- a/jsm/gamelogic.js +++ b/jsm/gamelogic.js @@ -71,21 +71,21 @@ const minoExtrudeSettings = { } let minoGeometry = new THREE.ExtrudeGeometry(minoFaceShape, minoExtrudeSettings) -/*let minoMaterial = new THREE.MeshBasicMaterial({ +let minoMaterial = new THREE.MeshBasicMaterial({ envMap: environnement, side: THREE.DoubleSide, transparent: true, opacity: 0.8, reflectivity: 0.9, -})*/ -let minoMaterial = new THREE.MeshStandardMaterial({ +}) +/*let minoMaterial = new THREE.MeshStandardMaterial({ envMap: environnement, side: THREE.DoubleSide, transparent: true, opacity: 0.6, roughness: 0.1, metalness: 0.9, -}) +})/* /* let minoMaterial = new THREE.MeshPhysicalMaterial({ envMap: environnement,