diff --git a/main.js b/main.js index f96f3d1..4640389 100644 --- a/main.js +++ b/main.js @@ -42,7 +42,7 @@ loadMngr.onProgress = function (url, itemsLoaded, itemsTotal) { progressCircle.style.setProperty("--progress", Math.floor(360 * itemsLoaded / itemsTotal)+"deg") } loadMngr.onError = function (url) { - message.innerHTML = 'Erreur de chargement' + message.innerHTML = `Erreur de chargement :
${url}` } loadMngr.onLoad = () => { message.innerHTML = "" @@ -65,8 +65,8 @@ renderer.toneMapping = THREE.ACESFilmicToneMapping; //renderer.toneMappingExposure = 0.5; renderer.shadowMap.enabled = true; renderer.shadowMap.type = THREE.PCFSoftShadowMap; -renderer.physicallyCorrectLights = true; -renderer.outputEncoding = THREE.sRGBEncoding; +renderer.useLegacyLights = false; +//renderer.outputColorSpace = THREE.sRGBEncoding; container.appendChild(renderer.domElement); @@ -96,12 +96,10 @@ const mazeCollisionner = new THREE.Group(); // Maze const wallMaterial = new THREE.MeshStandardMaterial({ - map : loader.load('textures/Poly-stone-retaining-wall/color_map.jpg'), - normalMap : loader.load('textures/Poly-stone-retaining-wall/normal_map_opengl.jpg'), - //normalScale : new THREE.Vector2(0.6, 0.6), - //metalnessMap : loader.load('textures/stonewall/metalness.png'), - aoMap : loader.load('textures/Poly-stone-retaining-wall/ao_map.jpg'), - roughnessMap : loader.load('textures/Poly-stone-retaining-wall/roughness_map.jpg'), + map : loader.load('textures/Poly-cobblestone-wall/color_map.jpg'), + normalMap : loader.load('textures/Poly-cobblestone-wall/normal_map_opengl.jpg'), + aoMap : loader.load('textures/Poly-cobblestone-wall/ao_map.jpg'), + roughnessMap : loader.load('textures/Poly-cobblestone-wall/roughness_map.jpg'), roughness : 1, envMapIntensity: 0.5 }) @@ -169,28 +167,30 @@ const groundMaterial = new THREE.MeshStandardMaterial({ texture.repeat.set(mazeWidth / 4, mazeWidth / 4) } ), + envMapIntensity : 0.5 }) const sideGroundMaterial = new THREE.MeshStandardMaterial({ map : wallMaterial.map.clone(), normalMap : wallMaterial.normalMap.clone(), normalScale : new THREE.Vector2(0.6, 0.6), - //metalnessMap: wallMaterial.metalnessMap.clone(), aoMap : wallMaterial.aoMap.clone(), roughnessMap : wallMaterial.roughnessMap.clone(), roughness : 1, - envMapIntensity : 0.4 + envMapIntensity : 0.5 }) sideGroundMaterial.map.wrapS = sideGroundMaterial.map.wrapT = THREE.RepeatWrapping sideGroundMaterial.normalMap.wrapS = sideGroundMaterial.normalMap.wrapT = THREE.RepeatWrapping -//sideGroundMaterial.metalnessMap.wrapS = sideGroundMaterial.metalnessMap.wrapT = THREE.RepeatWrapping sideGroundMaterial.aoMap.wrapS = sideGroundMaterial.aoMap.wrapT = THREE.RepeatWrapping sideGroundMaterial.roughnessMap.wrapS = sideGroundMaterial.roughnessMap.wrapT = THREE.RepeatWrapping sideGroundMaterial.map.repeat.set(mazeWidth, 1) sideGroundMaterial.normalMap.repeat.set(mazeWidth, 1) -//sideGroundMaterial.metalnessMap.repeat.set(mazeWidth, 1) sideGroundMaterial.aoMap.repeat.set(mazeWidth, 1) sideGroundMaterial.roughnessMap.repeat.set(mazeWidth, 1) +sideGroundMaterial.map.rotation = Math.PI +sideGroundMaterial.normalMap.rotation = Math.PI +sideGroundMaterial.aoMap.rotation = Math.PI +sideGroundMaterial.roughnessMap.rotation = Math.PI const ground = new THREE.Mesh( groundGeometry, @@ -315,47 +315,36 @@ function updateSun() { // Raft const raftGeometry = new THREE.BoxGeometry(1.8, .1, 1.1, 1, 1, 16) -//const woodTexture = loader.load('textures/wood.jpg'); -const raftFaceMaterial = new THREE.MeshStandardMaterial({ - map: loader.load("textures/Poly-raft-wood/color_map.jpg"), - aoMap: loader.load("textures/Poly-raft-wood/ao_map.jpg"), - normalMap: loader.load("textures/Poly-raft-wood/normal_map_opengl.jpg"), +const raftMaterial = new THREE.MeshStandardMaterial({ + map: loader.load("textures/Poly-wood/color_map.jpg", texture => { + texture.wrapS = texture.wrapT = THREE.RepeatWrapping + texture.repeat.set(2, 1) + }), + aoMap: loader.load("textures/Poly-wood/ao_map.jpg", texture => { + texture.wrapS = texture.wrapT = THREE.RepeatWrapping + texture.repeat.set(2, 1) + }), + normalMap: loader.load("textures/Poly-wood/normal_map_opengl.jpg", texture => { + texture.wrapS = texture.wrapT = THREE.RepeatWrapping + texture.repeat.set(2, 1) + }), normalScale : new THREE.Vector2(2, 2), - roughnessMap: loader.load("textures/Poly-raft-wood/roughness_map.jpg"), - //color: 0xFFFFFF, - //emissive: 0, - //bumpMap: loader.load("Poly-raft-wood/displacement_map.jpg"), - bumpScale: .1, + roughnessMap: loader.load("textures/Poly-wood/roughness_map.jpg", texture => { + texture.wrapS = texture.wrapT = THREE.RepeatWrapping + texture.repeat.set(2, 1) + }), depthFunc: 3, depthTest: true, depthWrite: true, - displacementMap: loader.load("textures/Poly-raft-wood/displacement_map.jpg"), - displacementScale: 0.2, - displacementBias: -0.1, - envMapIntensity: 0.03 + displacementMap: loader.load("textures/Poly-wood/displacement_map.jpg", texture => { + texture.wrapS = texture.wrapT = THREE.RepeatWrapping + texture.repeat.set(2, 1) + }), + displacementScale: -0.2, + displacementBias: 0.1, + envMapIntensity: 0.5 }) -const raftSideMaterial = new THREE.MeshStandardMaterial({ - map: raftFaceMaterial.map, - aoMap: raftFaceMaterial.aoMap, - normalMap: raftFaceMaterial.normalMap, - roughnessMap: raftFaceMaterial.roughnessMap, - //color: 0xFFFFFF, - //emissive: 0, - //bumpMap: raftFaceMaterial.bumpMap, - bumpScale: .01, - depthFunc: 3, - depthTest: true, - depthWrite: true, - envMapIntensity: 0.03 -}) -const raft = new THREE.Mesh(raftGeometry, [ - raftSideMaterial, - raftSideMaterial, - raftFaceMaterial, - raftSideMaterial, - raftFaceMaterial, - raftFaceMaterial, -]) +const raft = new THREE.Mesh(raftGeometry, raftMaterial) raft.position.set( .25, ocean.position.y, -mazeWidth/2 - 1.1 ); raft.castShadow = true; diff --git a/textures/Poly-raft-wood/Made with Poly.txt b/textures/Poly-cobblestone-wall/Made with Poly.txt similarity index 100% rename from textures/Poly-raft-wood/Made with Poly.txt rename to textures/Poly-cobblestone-wall/Made with Poly.txt diff --git a/textures/Poly-cobblestone-wall/ao_map.jpg b/textures/Poly-cobblestone-wall/ao_map.jpg new file mode 100644 index 0000000..125b5bd Binary files /dev/null and b/textures/Poly-cobblestone-wall/ao_map.jpg differ diff --git a/textures/Poly-cobblestone-wall/color_map.jpg b/textures/Poly-cobblestone-wall/color_map.jpg new file mode 100644 index 0000000..f58398e Binary files /dev/null and b/textures/Poly-cobblestone-wall/color_map.jpg differ diff --git a/textures/Poly-cobblestone-wall/displacement_map.jpg b/textures/Poly-cobblestone-wall/displacement_map.jpg new file mode 100644 index 0000000..9773129 Binary files /dev/null and b/textures/Poly-cobblestone-wall/displacement_map.jpg differ diff --git a/textures/Poly-cobblestone-wall/normal_map_opengl.jpg b/textures/Poly-cobblestone-wall/normal_map_opengl.jpg new file mode 100644 index 0000000..d96f2fc Binary files /dev/null and b/textures/Poly-cobblestone-wall/normal_map_opengl.jpg differ diff --git a/textures/Poly-cobblestone-wall/render_map.jpg b/textures/Poly-cobblestone-wall/render_map.jpg new file mode 100644 index 0000000..c5199ef Binary files /dev/null and b/textures/Poly-cobblestone-wall/render_map.jpg differ diff --git a/textures/Poly-cobblestone-wall/roughness_map.jpg b/textures/Poly-cobblestone-wall/roughness_map.jpg new file mode 100644 index 0000000..89ca36c Binary files /dev/null and b/textures/Poly-cobblestone-wall/roughness_map.jpg differ diff --git a/textures/Poly-cobblestone-wall/settings.json b/textures/Poly-cobblestone-wall/settings.json new file mode 100644 index 0000000..c0326b5 --- /dev/null +++ b/textures/Poly-cobblestone-wall/settings.json @@ -0,0 +1,23 @@ +{ + "prompt_text": "cobblestone wall with grass and flowers between rocks", + "patch": { + "ext": "png", + "dtype": "uint8", + "width": 512, + "height": 512, + "url": "https://static-dev.withpoly.com/v3-voronoi/textures/patches/486f8eed-0dfd-4bdc-9dee-3776fc72b1f1.png", + "patch_id": "GVpEsGuQ8S" + }, + "seamless_prompt_text": "cobblestone wall with grass and flowers between rocks", + "seamless_patch_scale": 0.98, + "upscale_prompt_text": "cobblestone wall with grass and flowers between rocks", + "upscale_resolution": 4096, + "is_seamless": true, + "pbr_mode": "organic", + "pbr_use_render_as_color": true, + "pbr_generate_normal": true, + "pbr_generate_height": true, + "pbr_generate_ao": true, + "pbr_generate_roughness": true, + "pbr_generate_metallic": false +} \ No newline at end of file diff --git a/textures/Poly-raft-wood/ao_map.jpg b/textures/Poly-raft-wood/ao_map.jpg deleted file mode 100644 index 3c102e6..0000000 Binary files a/textures/Poly-raft-wood/ao_map.jpg and /dev/null differ diff --git a/textures/Poly-raft-wood/color_map.jpg b/textures/Poly-raft-wood/color_map.jpg deleted file mode 100644 index 267306e..0000000 Binary files a/textures/Poly-raft-wood/color_map.jpg and /dev/null differ diff --git a/textures/Poly-raft-wood/displacement_map.jpg b/textures/Poly-raft-wood/displacement_map.jpg deleted file mode 100644 index eca033c..0000000 Binary files a/textures/Poly-raft-wood/displacement_map.jpg and /dev/null differ diff --git a/textures/Poly-raft-wood/normal_map_opengl.jpg b/textures/Poly-raft-wood/normal_map_opengl.jpg deleted file mode 100644 index 7ba86e2..0000000 Binary files a/textures/Poly-raft-wood/normal_map_opengl.jpg and /dev/null differ diff --git a/textures/Poly-raft-wood/render_map.jpg b/textures/Poly-raft-wood/render_map.jpg deleted file mode 100644 index aa8a63d..0000000 Binary files a/textures/Poly-raft-wood/render_map.jpg and /dev/null differ diff --git a/textures/Poly-raft-wood/roughness_map.jpg b/textures/Poly-raft-wood/roughness_map.jpg deleted file mode 100644 index 9b3e280..0000000 Binary files a/textures/Poly-raft-wood/roughness_map.jpg and /dev/null differ diff --git a/textures/Poly-raft-wood/settings.json b/textures/Poly-raft-wood/settings.json deleted file mode 100644 index c599685..0000000 --- a/textures/Poly-raft-wood/settings.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "prompt_text": "raft wood", - "patch": { - "ext": "png", - "dtype": "uint8", - "width": 512, - "height": 512, - "url": "https://static.withpoly.com/v3-voronoi/textures/patches/43d5b37f-e2e2-4f85-b2a9-b9135346748e.png", - "patch_id": "Td9yL3mXYo" - }, - "seamless_prompt_text": "raft wood", - "seamless_patch_scale": 0.8, - "upscale_prompt_text": "raft wood", - "upscale_resolution": 1024, - "is_seamless": true, - "pbr_mode": "general", - "pbr_generate_color": true, - "pbr_generate_normal": true, - "pbr_generate_height": true, - "pbr_generate_ao": true, - "pbr_generate_roughness": true -} \ No newline at end of file diff --git a/textures/Poly-wood/Made with Poly.txt b/textures/Poly-wood/Made with Poly.txt new file mode 100644 index 0000000..b09da3b --- /dev/null +++ b/textures/Poly-wood/Made with Poly.txt @@ -0,0 +1,3 @@ +This asset was made with Poly, an AI-generated design asset marketplace that lets you find and create incredibly life-like, detailed, and artistic assets for your next project, in seconds. + +Get started for free at https://withpoly.com \ No newline at end of file diff --git a/textures/Poly-wood/ao_map.jpg b/textures/Poly-wood/ao_map.jpg new file mode 100644 index 0000000..dc64283 Binary files /dev/null and b/textures/Poly-wood/ao_map.jpg differ diff --git a/textures/Poly-wood/color_map.jpg b/textures/Poly-wood/color_map.jpg new file mode 100644 index 0000000..3529486 Binary files /dev/null and b/textures/Poly-wood/color_map.jpg differ diff --git a/textures/Poly-wood/displacement_map.jpg b/textures/Poly-wood/displacement_map.jpg new file mode 100644 index 0000000..14cd50c Binary files /dev/null and b/textures/Poly-wood/displacement_map.jpg differ diff --git a/textures/Poly-wood/normal_map_opengl.jpg b/textures/Poly-wood/normal_map_opengl.jpg new file mode 100644 index 0000000..79efc2b Binary files /dev/null and b/textures/Poly-wood/normal_map_opengl.jpg differ diff --git a/textures/Poly-wood/render_map.jpg b/textures/Poly-wood/render_map.jpg new file mode 100644 index 0000000..d0aef52 Binary files /dev/null and b/textures/Poly-wood/render_map.jpg differ diff --git a/textures/Poly-wood/roughness_map.jpg b/textures/Poly-wood/roughness_map.jpg new file mode 100644 index 0000000..bba3258 Binary files /dev/null and b/textures/Poly-wood/roughness_map.jpg differ diff --git a/textures/Poly-wood/settings.json b/textures/Poly-wood/settings.json new file mode 100644 index 0000000..0c3a4c7 --- /dev/null +++ b/textures/Poly-wood/settings.json @@ -0,0 +1,23 @@ +{ + "prompt_text": "wood, planks, wooden, green paint, painted wood, paint, scrathes, raw wood, peeling paint", + "patch": { + "ext": "png", + "dtype": "uint8", + "width": 512, + "height": 512, + "url": "https://static-dev.withpoly.com/v3-voronoi/textures/patches/0ddfc901-a5dd-40f0-993b-8de3ccefb7f7.png", + "patch_id": "a79eceALs5" + }, + "seamless_prompt_text": "wood, planks, wooden, green paint, painted wood, paint, scrathes, raw wood, peeling paint", + "seamless_patch_scale": 0.8, + "upscale_prompt_text": "wood, planks, wooden, green paint, painted wood, paint, scrathes, raw wood, peeling paint", + "upscale_resolution": 4096, + "is_seamless": true, + "pbr_mode": "matte", + "pbr_generate_color": true, + "pbr_generate_normal": true, + "pbr_generate_height": true, + "pbr_generate_ao": true, + "pbr_generate_roughness": true, + "pbr_generate_metallic": false +} \ No newline at end of file