new texture again

This commit is contained in:
Adrien MALINGREY 2023-07-28 22:35:12 +02:00
parent cd313b363c
commit cee4d886c0
24 changed files with 87 additions and 71 deletions

87
main.js
View File

@ -42,7 +42,7 @@ loadMngr.onProgress = function (url, itemsLoaded, itemsTotal) {
progressCircle.style.setProperty("--progress", Math.floor(360 * itemsLoaded / itemsTotal)+"deg") progressCircle.style.setProperty("--progress", Math.floor(360 * itemsLoaded / itemsTotal)+"deg")
} }
loadMngr.onError = function (url) { loadMngr.onError = function (url) {
message.innerHTML = 'Erreur de chargement' message.innerHTML = `Erreur de chargement :<br/>${url}`
} }
loadMngr.onLoad = () => { loadMngr.onLoad = () => {
message.innerHTML = "" message.innerHTML = ""
@ -65,8 +65,8 @@ renderer.toneMapping = THREE.ACESFilmicToneMapping;
//renderer.toneMappingExposure = 0.5; //renderer.toneMappingExposure = 0.5;
renderer.shadowMap.enabled = true; renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap; renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.physicallyCorrectLights = true; renderer.useLegacyLights = false;
renderer.outputEncoding = THREE.sRGBEncoding; //renderer.outputColorSpace = THREE.sRGBEncoding;
container.appendChild(renderer.domElement); container.appendChild(renderer.domElement);
@ -96,12 +96,10 @@ const mazeCollisionner = new THREE.Group();
// Maze // Maze
const wallMaterial = new THREE.MeshStandardMaterial({ const wallMaterial = new THREE.MeshStandardMaterial({
map : loader.load('textures/Poly-stone-retaining-wall/color_map.jpg'), map : loader.load('textures/Poly-cobblestone-wall/color_map.jpg'),
normalMap : loader.load('textures/Poly-stone-retaining-wall/normal_map_opengl.jpg'), normalMap : loader.load('textures/Poly-cobblestone-wall/normal_map_opengl.jpg'),
//normalScale : new THREE.Vector2(0.6, 0.6), aoMap : loader.load('textures/Poly-cobblestone-wall/ao_map.jpg'),
//metalnessMap : loader.load('textures/stonewall/metalness.png'), roughnessMap : loader.load('textures/Poly-cobblestone-wall/roughness_map.jpg'),
aoMap : loader.load('textures/Poly-stone-retaining-wall/ao_map.jpg'),
roughnessMap : loader.load('textures/Poly-stone-retaining-wall/roughness_map.jpg'),
roughness : 1, roughness : 1,
envMapIntensity: 0.5 envMapIntensity: 0.5
}) })
@ -169,28 +167,30 @@ const groundMaterial = new THREE.MeshStandardMaterial({
texture.repeat.set(mazeWidth / 4, mazeWidth / 4) texture.repeat.set(mazeWidth / 4, mazeWidth / 4)
} }
), ),
envMapIntensity : 0.5
}) })
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(),
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.5
}) })
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.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.aoMap.repeat.set(mazeWidth, 1) sideGroundMaterial.aoMap.repeat.set(mazeWidth, 1)
sideGroundMaterial.roughnessMap.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( const ground = new THREE.Mesh(
groundGeometry, groundGeometry,
@ -315,47 +315,36 @@ function updateSun() {
// Raft // Raft
const raftGeometry = new THREE.BoxGeometry(1.8, .1, 1.1, 1, 1, 16) const raftGeometry = new THREE.BoxGeometry(1.8, .1, 1.1, 1, 1, 16)
//const woodTexture = loader.load('textures/wood.jpg'); const raftMaterial = new THREE.MeshStandardMaterial({
const raftFaceMaterial = new THREE.MeshStandardMaterial({ map: loader.load("textures/Poly-wood/color_map.jpg", texture => {
map: loader.load("textures/Poly-raft-wood/color_map.jpg"), texture.wrapS = texture.wrapT = THREE.RepeatWrapping
aoMap: loader.load("textures/Poly-raft-wood/ao_map.jpg"), texture.repeat.set(2, 1)
normalMap: loader.load("textures/Poly-raft-wood/normal_map_opengl.jpg"), }),
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), normalScale : new THREE.Vector2(2, 2),
roughnessMap: loader.load("textures/Poly-raft-wood/roughness_map.jpg"), roughnessMap: loader.load("textures/Poly-wood/roughness_map.jpg", texture => {
//color: 0xFFFFFF, texture.wrapS = texture.wrapT = THREE.RepeatWrapping
//emissive: 0, texture.repeat.set(2, 1)
//bumpMap: loader.load("Poly-raft-wood/displacement_map.jpg"), }),
bumpScale: .1,
depthFunc: 3, depthFunc: 3,
depthTest: true, depthTest: true,
depthWrite: true, depthWrite: true,
displacementMap: loader.load("textures/Poly-raft-wood/displacement_map.jpg"), displacementMap: loader.load("textures/Poly-wood/displacement_map.jpg", texture => {
displacementScale: 0.2, texture.wrapS = texture.wrapT = THREE.RepeatWrapping
displacementBias: -0.1, texture.repeat.set(2, 1)
envMapIntensity: 0.03 }),
displacementScale: -0.2,
displacementBias: 0.1,
envMapIntensity: 0.5
}) })
const raftSideMaterial = new THREE.MeshStandardMaterial({ const raft = new THREE.Mesh(raftGeometry, raftMaterial)
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,
])
raft.position.set( .25, ocean.position.y, -mazeWidth/2 - 1.1 ); raft.position.set( .25, ocean.position.y, -mazeWidth/2 - 1.1 );
raft.castShadow = true; raft.castShadow = true;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

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

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.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

View File

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