use Poly textures

This commit is contained in:
Adrien MALINGREY 2023-07-28 19:10:13 +02:00
parent 75f70a1bac
commit acca8eb92b
17 changed files with 96 additions and 39 deletions

84
main.js
View File

@ -24,7 +24,7 @@ const waves = {
C: { direction: 60, steepness: 0.05, wavelength: 1.5 }, 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") const ambiance = new Audio("snd/ambiance.mp3")
ambiance.loop = true ambiance.loop = true
@ -96,14 +96,14 @@ const mazeCollisionner = new THREE.Group();
// Maze // Maze
const wallMaterial = new THREE.MeshStandardMaterial({ const wallMaterial = new THREE.MeshStandardMaterial({
map : loader.load('textures/stonewall/albedo.png'), map : loader.load('textures/Poly-stone-retaining-wall/color_map.jpg'),
normalMap : loader.load('textures/stonewall/normal.png'), normalMap : loader.load('textures/Poly-stone-retaining-wall/normal_map_opengl.jpg'),
normalScale : new THREE.Vector2(0.6, 0.6), //normalScale : new THREE.Vector2(0.6, 0.6),
metalnessMap: loader.load('textures/stonewall/metalness.png'), //metalnessMap : loader.load('textures/stonewall/metalness.png'),
aoMap : loader.load('textures/stonewall/ao.png'), aoMap : loader.load('textures/Poly-stone-retaining-wall/ao_map.jpg'),
roughnessMap: loader.load('textures/stonewall/roughness.png'), roughnessMap : loader.load('textures/Poly-stone-retaining-wall/roughness_map.jpg'),
roughness : 1, roughness : 1,
envMapIntensity: 0.4 //envMapIntensity: 0.4
}) })
const maze = new MazeMesh(mazeWidth, mazeWidth, 1, wallMaterial); const maze = new MazeMesh(mazeWidth, mazeWidth, 1, wallMaterial);
@ -114,7 +114,7 @@ scene.add(maze)
console.log(String(maze)) console.log(String(maze))
if (!debug) { if (!dev) {
const invisibleWall = new THREE.Mesh(new THREE.BoxGeometry( .9, 1.8, .9 )); const invisibleWall = new THREE.Mesh(new THREE.BoxGeometry( .9, 1.8, .9 ));
invisibleWall.material.visible = false; invisibleWall.material.visible = false;
@ -172,23 +172,23 @@ const groundMaterial = new THREE.MeshStandardMaterial({
}) })
const sideGroundMaterial = new THREE.MeshStandardMaterial({ const sideGroundMaterial = new THREE.MeshStandardMaterial({
map : wallMaterial.map.clone(), map : wallMaterial.map.clone(),
normalMap : wallMaterial.normalMap.clone(), normalMap : wallMaterial.normalMap.clone(),
normalScale : new THREE.Vector2(0.6, 0.6), normalScale : new THREE.Vector2(0.6, 0.6),
metalnessMap: wallMaterial.metalnessMap.clone(), //metalnessMap: wallMaterial.metalnessMap.clone(),
aoMap : wallMaterial.aoMap.clone(), aoMap : wallMaterial.aoMap.clone(),
roughnessMap: wallMaterial.roughnessMap.clone(), roughnessMap : wallMaterial.roughnessMap.clone(),
roughness : 1, roughness : 1,
envMapIntensity: 0.4 envMapIntensity : 0.4
}) })
sideGroundMaterial.map.wrapS = sideGroundMaterial.map.wrapT = THREE.RepeatWrapping sideGroundMaterial.map.wrapS = sideGroundMaterial.map.wrapT = THREE.RepeatWrapping
sideGroundMaterial.normalMap.wrapS = sideGroundMaterial.normalMap.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.aoMap.wrapS = sideGroundMaterial.aoMap.wrapT = THREE.RepeatWrapping
sideGroundMaterial.roughnessMap.wrapS = sideGroundMaterial.roughnessMap.wrapT = THREE.RepeatWrapping sideGroundMaterial.roughnessMap.wrapS = sideGroundMaterial.roughnessMap.wrapT = THREE.RepeatWrapping
sideGroundMaterial.map.repeat.set(mazeWidth, 1) sideGroundMaterial.map.repeat.set(mazeWidth, 1)
sideGroundMaterial.normalMap.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.aoMap.repeat.set(mazeWidth, 1)
sideGroundMaterial.roughnessMap.repeat.set(mazeWidth, 1) sideGroundMaterial.roughnessMap.repeat.set(mazeWidth, 1)
@ -314,33 +314,39 @@ function updateSun() {
// Raft // Raft
const raftGeometry = new THREE.BoxGeometry(1.8, .1, 1.1, 1, 1, 8) const raftGeometry = new THREE.BoxGeometry(1.8, .1, 1.1, 1, 1, 16)
const woodTexture = loader.load('textures/wood.jpg'); //const woodTexture = loader.load('textures/wood.jpg');
const raftFaceMaterial = new THREE.MeshStandardMaterial({ const raftFaceMaterial = new THREE.MeshStandardMaterial({
map: woodTexture, map: loader.load("textures/Poly-raft-wood/color_map.jpg"),
aoMap: woodTexture, aoMap: loader.load("textures/Poly-raft-wood/ao_map.jpg"),
roughnessMap: woodTexture, normalMap: loader.load("textures/Poly-raft-wood/normal_map_opengl.jpg"),
color: 0xFFFFFF, normalScale : new THREE.Vector2(2, 2),
emissive: 0, roughnessMap: loader.load("textures/Poly-raft-wood/roughness_map.jpg"),
bumpMap: woodTexture, //color: 0xFFFFFF,
//emissive: 0,
//bumpMap: loader.load("Poly-raft-wood/displacement_map.jpg"),
bumpScale: .1, bumpScale: .1,
depthFunc: 3, depthFunc: 3,
depthTest: true, depthTest: true,
depthWrite: true, depthWrite: true,
displacementMap: woodTexture, displacementMap: loader.load("textures/Poly-raft-wood/displacement_map.jpg"),
displacementScale: -0.08 displacementScale: 0.2,
displacementBias: -0.1,
envMapIntensity: 0.03
}) })
const raftSideMaterial = new THREE.MeshStandardMaterial({ const raftSideMaterial = new THREE.MeshStandardMaterial({
map: woodTexture, map: raftFaceMaterial.map,
aoMap: woodTexture, aoMap: raftFaceMaterial.aoMap,
roughnessMap: woodTexture, normalMap: raftFaceMaterial.normalMap,
color: 0xFFFFFF, roughnessMap: raftFaceMaterial.roughnessMap,
emissive: 0, //color: 0xFFFFFF,
bumpMap: woodTexture, //emissive: 0,
bumpScale: .1, //bumpMap: raftFaceMaterial.bumpMap,
bumpScale: .01,
depthFunc: 3, depthFunc: 3,
depthTest: true, depthTest: true,
depthWrite: true, depthWrite: true,
envMapIntensity: 0.03
}) })
const raft = new THREE.Mesh(raftGeometry, [ const raft = new THREE.Mesh(raftGeometry, [
raftSideMaterial, raftSideMaterial,
@ -360,7 +366,7 @@ const raftOctree = new Octree().fromGraphNode(raft);
const stats = new Stats(); const stats = new Stats();
if (debug) { if (dev) {
container.appendChild(stats.dom); container.appendChild(stats.dom);
@ -789,6 +795,6 @@ function animate() {
renderer.render(scene, camera); renderer.render(scene, camera);
if (debug) stats.update(); if (dev) stats.update();
} }

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View 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
}

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 KiB

View 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
}