diff --git a/main.js b/main.js index b82300e..27d0e14 100644 --- a/main.js +++ b/main.js @@ -24,7 +24,7 @@ const waves = { C: { direction: 60, steepness: 0.05, wavelength: 1.5 }, }; -const debug = window.location.search.includes("debug") +const dev = window.location.search.includes("dev") const ambiance = new Audio("snd/ambiance.mp3") ambiance.loop = true @@ -96,14 +96,14 @@ const mazeCollisionner = new THREE.Group(); // Maze const wallMaterial = new THREE.MeshStandardMaterial({ - map : loader.load('textures/stonewall/albedo.png'), - normalMap : loader.load('textures/stonewall/normal.png'), - normalScale : new THREE.Vector2(0.6, 0.6), - metalnessMap: loader.load('textures/stonewall/metalness.png'), - aoMap : loader.load('textures/stonewall/ao.png'), - roughnessMap: loader.load('textures/stonewall/roughness.png'), - roughness : 1, - envMapIntensity: 0.4 + 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'), + roughness : 1, + //envMapIntensity: 0.4 }) const maze = new MazeMesh(mazeWidth, mazeWidth, 1, wallMaterial); @@ -114,7 +114,7 @@ scene.add(maze) console.log(String(maze)) -if (!debug) { +if (!dev) { const invisibleWall = new THREE.Mesh(new THREE.BoxGeometry( .9, 1.8, .9 )); invisibleWall.material.visible = false; @@ -172,23 +172,23 @@ const groundMaterial = new THREE.MeshStandardMaterial({ }) 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 + 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 }) 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.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.metalnessMap.repeat.set(mazeWidth, 1) sideGroundMaterial.aoMap.repeat.set(mazeWidth, 1) sideGroundMaterial.roughnessMap.repeat.set(mazeWidth, 1) @@ -314,33 +314,39 @@ function updateSun() { // Raft -const raftGeometry = new THREE.BoxGeometry(1.8, .1, 1.1, 1, 1, 8) -const woodTexture = loader.load('textures/wood.jpg'); +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: woodTexture, - aoMap: woodTexture, - roughnessMap: woodTexture, - color: 0xFFFFFF, - emissive: 0, - bumpMap: woodTexture, + 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"), + 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, depthFunc: 3, depthTest: true, depthWrite: true, - displacementMap: woodTexture, - displacementScale: -0.08 + displacementMap: loader.load("textures/Poly-raft-wood/displacement_map.jpg"), + displacementScale: 0.2, + displacementBias: -0.1, + envMapIntensity: 0.03 }) const raftSideMaterial = new THREE.MeshStandardMaterial({ - map: woodTexture, - aoMap: woodTexture, - roughnessMap: woodTexture, - color: 0xFFFFFF, - emissive: 0, - bumpMap: woodTexture, - bumpScale: .1, + 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, @@ -360,7 +366,7 @@ const raftOctree = new Octree().fromGraphNode(raft); const stats = new Stats(); -if (debug) { +if (dev) { container.appendChild(stats.dom); @@ -789,6 +795,6 @@ function animate() { renderer.render(scene, camera); - if (debug) stats.update(); + if (dev) stats.update(); } \ No newline at end of file diff --git a/textures/Poly-raft-wood/Made with Poly.txt b/textures/Poly-raft-wood/Made with Poly.txt new file mode 100644 index 0000000..b09da3b --- /dev/null +++ b/textures/Poly-raft-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-raft-wood/ao_map.jpg b/textures/Poly-raft-wood/ao_map.jpg new file mode 100644 index 0000000..3c102e6 Binary files /dev/null and b/textures/Poly-raft-wood/ao_map.jpg differ diff --git a/textures/Poly-raft-wood/color_map.jpg b/textures/Poly-raft-wood/color_map.jpg new file mode 100644 index 0000000..267306e Binary files /dev/null and b/textures/Poly-raft-wood/color_map.jpg differ diff --git a/textures/Poly-raft-wood/displacement_map.jpg b/textures/Poly-raft-wood/displacement_map.jpg new file mode 100644 index 0000000..eca033c Binary files /dev/null and b/textures/Poly-raft-wood/displacement_map.jpg differ diff --git a/textures/Poly-raft-wood/normal_map_opengl.jpg b/textures/Poly-raft-wood/normal_map_opengl.jpg new file mode 100644 index 0000000..7ba86e2 Binary files /dev/null and b/textures/Poly-raft-wood/normal_map_opengl.jpg differ diff --git a/textures/Poly-raft-wood/render_map.jpg b/textures/Poly-raft-wood/render_map.jpg new file mode 100644 index 0000000..aa8a63d Binary files /dev/null and b/textures/Poly-raft-wood/render_map.jpg differ diff --git a/textures/Poly-raft-wood/roughness_map.jpg b/textures/Poly-raft-wood/roughness_map.jpg new file mode 100644 index 0000000..9b3e280 Binary files /dev/null and b/textures/Poly-raft-wood/roughness_map.jpg differ diff --git a/textures/Poly-raft-wood/settings.json b/textures/Poly-raft-wood/settings.json new file mode 100644 index 0000000..c599685 --- /dev/null +++ b/textures/Poly-raft-wood/settings.json @@ -0,0 +1,22 @@ +{ + "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-stone-retaining-wall/Made with Poly.txt b/textures/Poly-stone-retaining-wall/Made with Poly.txt new file mode 100644 index 0000000..b09da3b --- /dev/null +++ b/textures/Poly-stone-retaining-wall/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-stone-retaining-wall/ao_map.jpg b/textures/Poly-stone-retaining-wall/ao_map.jpg new file mode 100644 index 0000000..38a0e93 Binary files /dev/null and b/textures/Poly-stone-retaining-wall/ao_map.jpg differ diff --git a/textures/Poly-stone-retaining-wall/color_map.jpg b/textures/Poly-stone-retaining-wall/color_map.jpg new file mode 100644 index 0000000..63eaf6a Binary files /dev/null and b/textures/Poly-stone-retaining-wall/color_map.jpg differ diff --git a/textures/Poly-stone-retaining-wall/displacement_map.jpg b/textures/Poly-stone-retaining-wall/displacement_map.jpg new file mode 100644 index 0000000..47daa96 Binary files /dev/null and b/textures/Poly-stone-retaining-wall/displacement_map.jpg differ diff --git a/textures/Poly-stone-retaining-wall/normal_map_opengl.jpg b/textures/Poly-stone-retaining-wall/normal_map_opengl.jpg new file mode 100644 index 0000000..69c0895 Binary files /dev/null and b/textures/Poly-stone-retaining-wall/normal_map_opengl.jpg differ diff --git a/textures/Poly-stone-retaining-wall/render_map.jpg b/textures/Poly-stone-retaining-wall/render_map.jpg new file mode 100644 index 0000000..6c1ca48 Binary files /dev/null and b/textures/Poly-stone-retaining-wall/render_map.jpg differ diff --git a/textures/Poly-stone-retaining-wall/roughness_map.jpg b/textures/Poly-stone-retaining-wall/roughness_map.jpg new file mode 100644 index 0000000..96b7e8d Binary files /dev/null and b/textures/Poly-stone-retaining-wall/roughness_map.jpg differ diff --git a/textures/Poly-stone-retaining-wall/settings.json b/textures/Poly-stone-retaining-wall/settings.json new file mode 100644 index 0000000..ebf4e97 --- /dev/null +++ b/textures/Poly-stone-retaining-wall/settings.json @@ -0,0 +1,23 @@ +{ + "prompt_text": "stone retaining wall, extreme fine details", + "patch": { + "ext": "png", + "dtype": "uint8", + "width": 512, + "height": 512, + "url": "https://static-dev.withpoly.com/v3-voronoi/textures/patches/909585e0-8b3f-4659-ae84-03f58ceaaaeb.png", + "patch_id": "EbJzaafatu" + }, + "seamless_prompt_text": "stone retaining wall, extreme fine details", + "seamless_patch_scale": 0.8, + "upscale_prompt_text": "stone retaining wall, extreme fine details", + "upscale_resolution": 4096, + "is_seamless": true, + "pbr_mode": "organic", + "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