use Poly textures
84
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();
|
||||
|
||||
}
|
3
textures/Poly-raft-wood/Made with Poly.txt
Normal file
@ -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
|
BIN
textures/Poly-raft-wood/ao_map.jpg
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
textures/Poly-raft-wood/color_map.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
textures/Poly-raft-wood/displacement_map.jpg
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
textures/Poly-raft-wood/normal_map_opengl.jpg
Normal file
After Width: | Height: | Size: 73 KiB |
BIN
textures/Poly-raft-wood/render_map.jpg
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
textures/Poly-raft-wood/roughness_map.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
22
textures/Poly-raft-wood/settings.json
Normal file
@ -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
|
||||
}
|
3
textures/Poly-stone-retaining-wall/Made with Poly.txt
Normal file
@ -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
|
BIN
textures/Poly-stone-retaining-wall/ao_map.jpg
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
textures/Poly-stone-retaining-wall/color_map.jpg
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
textures/Poly-stone-retaining-wall/displacement_map.jpg
Normal file
After Width: | Height: | Size: 497 KiB |
BIN
textures/Poly-stone-retaining-wall/normal_map_opengl.jpg
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
textures/Poly-stone-retaining-wall/render_map.jpg
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
textures/Poly-stone-retaining-wall/roughness_map.jpg
Normal file
After Width: | Height: | Size: 828 KiB |
23
textures/Poly-stone-retaining-wall/settings.json
Normal file
@ -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
|
||||
}
|