diff --git a/main.js b/main.js index 9d9e4a3..b926986 100644 --- a/main.js +++ b/main.js @@ -1,15 +1,15 @@ -import * as THREE from 'three'; -import { Octree } from 'three/addons/math/Octree.js'; -import { Capsule } from 'three/addons/math/Capsule.js'; -import { Water } from 'three/addons/objects/Water.js'; -import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js'; -import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; -import { OctreeHelper } from 'three/addons/helpers/OctreeHelper.js'; -import Stats from 'three/addons/libs/stats.module.js'; +import * as THREE from 'three' +import { Octree } from 'three/addons/math/Octree.js' +import { Capsule } from 'three/addons/math/Capsule.js' +import { Water } from 'three/addons/objects/Water.js' +import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js' +import { GUI } from 'three/addons/libs/lil-gui.module.min.js' +import { OctreeHelper } from 'three/addons/helpers/OctreeHelper.js' +import Stats from 'three/addons/libs/stats.module.js' -//import 'three-hex-tiling'; +//import 'three-hex-tiling' -import MazeMesh from './MazeMesh.js'; +import MazeMesh from './MazeMesh.js' const playerHeight = 0.5; @@ -80,12 +80,12 @@ const scene = new THREE.Scene(); scene.background = new THREE.CubeTextureLoader(loadMngr) .setPath( 'textures/calm-sea-skybox/' ) .load( [ - 'ft.avif', - 'bk.avif', - 'up.avif', - 'dn.avif', - 'rt.avif', - 'lf.avif', + 'ft.webp', + 'bk.webp', + 'up.webp', + 'dn.webp', + 'rt.webp', + 'lf.webp', ] ); scene.backgroundBlurriness = 0.03; scene.backgroundIntensity = 1.4; @@ -102,10 +102,10 @@ const mazeCollisionner = new THREE.Group(); // Maze const wallMaterial = new THREE.MeshStandardMaterial({ - map : loader.load('textures/Poly-cobblestone-wall/color_map.avif'), - normalMap : loader.load('textures/Poly-cobblestone-wall/normal_map_opengl.avif'), - aoMap : loader.load('textures/Poly-cobblestone-wall/ao_map.avif'), - roughnessMap : loader.load('textures/Poly-cobblestone-wall/roughness_map.avif'), + map : loader.load('textures/Poly-cobblestone-wall/color_map.webp'), + normalMap : loader.load('textures/Poly-cobblestone-wall/normal_map_opengl.webp'), + aoMap : loader.load('textures/Poly-cobblestone-wall/ao_map.webp'), + roughnessMap : loader.load('textures/Poly-cobblestone-wall/roughness_map.webp'), roughness : 1 }) @@ -139,11 +139,11 @@ function repeatGroundMaterial (texture) { texture.repeat.set(mazeWidth / 4, mazeWidth / 4) } const groundMaterial = new THREE.MeshStandardMaterial({ - map : loader.load('textures/angled-blocks-vegetation/albedo.avif', repeatGroundMaterial), - aoMap : loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.avif', repeatGroundMaterial), - metalnessMap: loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.avif', repeatGroundMaterial), - normalMap : loader.load('textures/angled-blocks-vegetation/normal-dx.avif', repeatGroundMaterial), - roughnessMap: loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.avif', repeatGroundMaterial), + map : loader.load('textures/angled-blocks-vegetation/albedo.webp', repeatGroundMaterial), + aoMap : loader.load('textures/angled-blocks-vegetation/ao.webp', repeatGroundMaterial), + metalnessMap: loader.load('textures/angled-blocks-vegetation/metallic.webp', repeatGroundMaterial), + normalMap : loader.load('textures/angled-blocks-vegetation/normal-dx.webp', repeatGroundMaterial), + roughnessMap: loader.load('textures/angled-blocks-vegetation/roughness.webp', repeatGroundMaterial), /*hexTiling : { patchScale: 1, useContrastCorrectedBlending: true, @@ -204,7 +204,7 @@ const ocean = new Water(waterGeometry, { textureWidth : 512, textureHeight: 512, waterNormals : loader.load( - 'textures/waternormals.avif', + 'textures/waternormals.webp', function (texture) { texture.wrapS = texture.wrapT = THREE.RepeatWrapping; } @@ -302,15 +302,15 @@ function repeatRaftMaterial(texture) { texture.repeat.set(2, 1) } const raftMaterial = new THREE.MeshStandardMaterial({ - map: loader.load("textures/Poly-wood/color_map.avif", repeatRaftMaterial), - aoMap: loader.load("textures/Poly-wood/ao_map.avif", repeatRaftMaterial), - normalMap: loader.load("textures/Poly-wood/normal_map_opengl.avif", repeatRaftMaterial), + map: loader.load("textures/Poly-wood/color_map.webp", repeatRaftMaterial), + aoMap: loader.load("textures/Poly-wood/ao_map.webp", repeatRaftMaterial), + normalMap: loader.load("textures/Poly-wood/normal_map_opengl.webp", repeatRaftMaterial), normalScale : new THREE.Vector2(2, 2), - roughnessMap: loader.load("textures/Poly-wood/roughness_map.avif", repeatRaftMaterial), + roughnessMap: loader.load("textures/Poly-wood/roughness_map.webp", repeatRaftMaterial), depthFunc: 3, depthTest: true, depthWrite: true, - displacementMap: loader.load("textures/Poly-wood/displacement_map.avif", repeatRaftMaterial), + displacementMap: loader.load("textures/Poly-wood/displacement_map.webp", repeatRaftMaterial), displacementScale: -0.3, displacementBias: 0.15, }) diff --git a/textures/Poly-cobblestone-wall/ao_map.avif b/textures/Poly-cobblestone-wall/ao_map.avif deleted file mode 100644 index a5744c1..0000000 Binary files a/textures/Poly-cobblestone-wall/ao_map.avif and /dev/null differ diff --git a/textures/Poly-cobblestone-wall/ao_map.webp b/textures/Poly-cobblestone-wall/ao_map.webp new file mode 100644 index 0000000..60e6a20 Binary files /dev/null and b/textures/Poly-cobblestone-wall/ao_map.webp differ diff --git a/textures/Poly-cobblestone-wall/color_map.avif b/textures/Poly-cobblestone-wall/color_map.avif deleted file mode 100644 index 0ce74fd..0000000 Binary files a/textures/Poly-cobblestone-wall/color_map.avif and /dev/null differ diff --git a/textures/Poly-cobblestone-wall/color_map.webp b/textures/Poly-cobblestone-wall/color_map.webp new file mode 100644 index 0000000..bf77830 Binary files /dev/null and b/textures/Poly-cobblestone-wall/color_map.webp differ diff --git a/textures/Poly-cobblestone-wall/displacement_map.avif b/textures/Poly-cobblestone-wall/displacement_map.avif deleted file mode 100644 index b88789a..0000000 Binary files a/textures/Poly-cobblestone-wall/displacement_map.avif and /dev/null differ diff --git a/textures/Poly-cobblestone-wall/displacement_map.webp b/textures/Poly-cobblestone-wall/displacement_map.webp new file mode 100644 index 0000000..312e70d Binary files /dev/null and b/textures/Poly-cobblestone-wall/displacement_map.webp differ diff --git a/textures/Poly-cobblestone-wall/normal_map_opengl.avif b/textures/Poly-cobblestone-wall/normal_map_opengl.avif deleted file mode 100644 index 4209995..0000000 Binary files a/textures/Poly-cobblestone-wall/normal_map_opengl.avif and /dev/null differ diff --git a/textures/Poly-cobblestone-wall/normal_map_opengl.webp b/textures/Poly-cobblestone-wall/normal_map_opengl.webp new file mode 100644 index 0000000..0f7ed16 Binary files /dev/null and b/textures/Poly-cobblestone-wall/normal_map_opengl.webp differ diff --git a/textures/Poly-cobblestone-wall/render_map.avif b/textures/Poly-cobblestone-wall/render_map.avif deleted file mode 100644 index c7b9202..0000000 Binary files a/textures/Poly-cobblestone-wall/render_map.avif and /dev/null differ diff --git a/textures/Poly-cobblestone-wall/render_map.webp b/textures/Poly-cobblestone-wall/render_map.webp new file mode 100644 index 0000000..f391fd9 Binary files /dev/null and b/textures/Poly-cobblestone-wall/render_map.webp differ diff --git a/textures/Poly-cobblestone-wall/roughness_map.avif b/textures/Poly-cobblestone-wall/roughness_map.avif deleted file mode 100644 index 3f21bd7..0000000 Binary files a/textures/Poly-cobblestone-wall/roughness_map.avif and /dev/null differ diff --git a/textures/Poly-cobblestone-wall/roughness_map.webp b/textures/Poly-cobblestone-wall/roughness_map.webp new file mode 100644 index 0000000..146765a Binary files /dev/null and b/textures/Poly-cobblestone-wall/roughness_map.webp differ diff --git a/textures/Poly-wood/ao_map.avif b/textures/Poly-wood/ao_map.avif deleted file mode 100644 index cbcce1f..0000000 Binary files a/textures/Poly-wood/ao_map.avif and /dev/null differ diff --git a/textures/Poly-wood/ao_map.webp b/textures/Poly-wood/ao_map.webp new file mode 100644 index 0000000..56eb2f9 Binary files /dev/null and b/textures/Poly-wood/ao_map.webp differ diff --git a/textures/Poly-wood/color_map.avif b/textures/Poly-wood/color_map.avif deleted file mode 100644 index cc572e8..0000000 Binary files a/textures/Poly-wood/color_map.avif and /dev/null differ diff --git a/textures/Poly-wood/color_map.webp b/textures/Poly-wood/color_map.webp new file mode 100644 index 0000000..a7e005d Binary files /dev/null and b/textures/Poly-wood/color_map.webp differ diff --git a/textures/Poly-wood/displacement_map.avif b/textures/Poly-wood/displacement_map.avif deleted file mode 100644 index 8822b6a..0000000 Binary files a/textures/Poly-wood/displacement_map.avif and /dev/null differ diff --git a/textures/Poly-wood/displacement_map.webp b/textures/Poly-wood/displacement_map.webp new file mode 100644 index 0000000..ca848fd Binary files /dev/null and b/textures/Poly-wood/displacement_map.webp differ diff --git a/textures/Poly-wood/normal_map_opengl.avif b/textures/Poly-wood/normal_map_opengl.avif deleted file mode 100644 index e897ca4..0000000 Binary files a/textures/Poly-wood/normal_map_opengl.avif and /dev/null differ diff --git a/textures/Poly-wood/normal_map_opengl.webp b/textures/Poly-wood/normal_map_opengl.webp new file mode 100644 index 0000000..186cc79 Binary files /dev/null and b/textures/Poly-wood/normal_map_opengl.webp differ diff --git a/textures/Poly-wood/render_map.avif b/textures/Poly-wood/render_map.avif deleted file mode 100644 index e1e2325..0000000 Binary files a/textures/Poly-wood/render_map.avif and /dev/null differ diff --git a/textures/Poly-wood/render_map.webp b/textures/Poly-wood/render_map.webp new file mode 100644 index 0000000..5c8dbef Binary files /dev/null and b/textures/Poly-wood/render_map.webp differ diff --git a/textures/Poly-wood/roughness_map.avif b/textures/Poly-wood/roughness_map.avif deleted file mode 100644 index e616478..0000000 Binary files a/textures/Poly-wood/roughness_map.avif and /dev/null differ diff --git a/textures/Poly-wood/roughness_map.webp b/textures/Poly-wood/roughness_map.webp new file mode 100644 index 0000000..dd498fe Binary files /dev/null and b/textures/Poly-wood/roughness_map.webp differ diff --git a/textures/angled-blocks-vegetation/albedo.avif b/textures/angled-blocks-vegetation/albedo.avif deleted file mode 100644 index 0ac7205..0000000 Binary files a/textures/angled-blocks-vegetation/albedo.avif and /dev/null differ diff --git a/textures/angled-blocks-vegetation/albedo.webp b/textures/angled-blocks-vegetation/albedo.webp new file mode 100644 index 0000000..1d1c76c Binary files /dev/null and b/textures/angled-blocks-vegetation/albedo.webp differ diff --git a/textures/angled-blocks-vegetation/ao-roughness-metalness.avif b/textures/angled-blocks-vegetation/ao-roughness-metalness.avif deleted file mode 100644 index fa3dd64..0000000 Binary files a/textures/angled-blocks-vegetation/ao-roughness-metalness.avif and /dev/null differ diff --git a/textures/angled-blocks-vegetation/ao-roughness-metalness.webp b/textures/angled-blocks-vegetation/ao-roughness-metalness.webp new file mode 100644 index 0000000..7b9421b Binary files /dev/null and b/textures/angled-blocks-vegetation/ao-roughness-metalness.webp differ diff --git a/textures/angled-blocks-vegetation/ao.avif b/textures/angled-blocks-vegetation/ao.avif deleted file mode 100644 index 10a346f..0000000 Binary files a/textures/angled-blocks-vegetation/ao.avif and /dev/null differ diff --git a/textures/angled-blocks-vegetation/ao.webp b/textures/angled-blocks-vegetation/ao.webp new file mode 100644 index 0000000..bd8dad1 Binary files /dev/null and b/textures/angled-blocks-vegetation/ao.webp differ diff --git a/textures/angled-blocks-vegetation/height.avif b/textures/angled-blocks-vegetation/height.avif deleted file mode 100644 index 7c4f62a..0000000 Binary files a/textures/angled-blocks-vegetation/height.avif and /dev/null differ diff --git a/textures/angled-blocks-vegetation/height.webp b/textures/angled-blocks-vegetation/height.webp new file mode 100644 index 0000000..c873414 Binary files /dev/null and b/textures/angled-blocks-vegetation/height.webp differ diff --git a/textures/angled-blocks-vegetation/metallic.avif b/textures/angled-blocks-vegetation/metallic.avif deleted file mode 100644 index 5c5985e..0000000 Binary files a/textures/angled-blocks-vegetation/metallic.avif and /dev/null differ diff --git a/textures/angled-blocks-vegetation/metallic.webp b/textures/angled-blocks-vegetation/metallic.webp new file mode 100644 index 0000000..60cdb51 Binary files /dev/null and b/textures/angled-blocks-vegetation/metallic.webp differ diff --git a/textures/angled-blocks-vegetation/normal-dx.avif b/textures/angled-blocks-vegetation/normal-dx.avif deleted file mode 100644 index b4a764b..0000000 Binary files a/textures/angled-blocks-vegetation/normal-dx.avif and /dev/null differ diff --git a/textures/angled-blocks-vegetation/normal-dx.webp b/textures/angled-blocks-vegetation/normal-dx.webp new file mode 100644 index 0000000..9331aa0 Binary files /dev/null and b/textures/angled-blocks-vegetation/normal-dx.webp differ diff --git a/textures/angled-blocks-vegetation/roughness.avif b/textures/angled-blocks-vegetation/roughness.avif deleted file mode 100644 index 270022a..0000000 Binary files a/textures/angled-blocks-vegetation/roughness.avif and /dev/null differ diff --git a/textures/angled-blocks-vegetation/roughness.webp b/textures/angled-blocks-vegetation/roughness.webp new file mode 100644 index 0000000..49be107 Binary files /dev/null and b/textures/angled-blocks-vegetation/roughness.webp differ diff --git a/textures/calm-sea-skybox/bk.avif b/textures/calm-sea-skybox/bk.avif deleted file mode 100644 index 81b59dd..0000000 Binary files a/textures/calm-sea-skybox/bk.avif and /dev/null differ diff --git a/textures/calm-sea-skybox/bk.webp b/textures/calm-sea-skybox/bk.webp new file mode 100644 index 0000000..91eff44 Binary files /dev/null and b/textures/calm-sea-skybox/bk.webp differ diff --git a/textures/calm-sea-skybox/dn.avif b/textures/calm-sea-skybox/dn.avif deleted file mode 100644 index 49cba5b..0000000 Binary files a/textures/calm-sea-skybox/dn.avif and /dev/null differ diff --git a/textures/calm-sea-skybox/dn.webp b/textures/calm-sea-skybox/dn.webp new file mode 100644 index 0000000..3c90f77 Binary files /dev/null and b/textures/calm-sea-skybox/dn.webp differ diff --git a/textures/calm-sea-skybox/ft.avif b/textures/calm-sea-skybox/ft.avif deleted file mode 100644 index e5aed5e..0000000 Binary files a/textures/calm-sea-skybox/ft.avif and /dev/null differ diff --git a/textures/calm-sea-skybox/ft.webp b/textures/calm-sea-skybox/ft.webp new file mode 100644 index 0000000..db8881a Binary files /dev/null and b/textures/calm-sea-skybox/ft.webp differ diff --git a/textures/calm-sea-skybox/lf.avif b/textures/calm-sea-skybox/lf.avif deleted file mode 100644 index 89c1916..0000000 Binary files a/textures/calm-sea-skybox/lf.avif and /dev/null differ diff --git a/textures/calm-sea-skybox/lf.webp b/textures/calm-sea-skybox/lf.webp new file mode 100644 index 0000000..fb5b4d7 Binary files /dev/null and b/textures/calm-sea-skybox/lf.webp differ diff --git a/textures/calm-sea-skybox/rt.avif b/textures/calm-sea-skybox/rt.avif deleted file mode 100644 index 37960fc..0000000 Binary files a/textures/calm-sea-skybox/rt.avif and /dev/null differ diff --git a/textures/calm-sea-skybox/rt.webp b/textures/calm-sea-skybox/rt.webp new file mode 100644 index 0000000..f0acc4e Binary files /dev/null and b/textures/calm-sea-skybox/rt.webp differ diff --git a/textures/calm-sea-skybox/up.avif b/textures/calm-sea-skybox/up.avif deleted file mode 100644 index 1a5726c..0000000 Binary files a/textures/calm-sea-skybox/up.avif and /dev/null differ diff --git a/textures/calm-sea-skybox/up.webp b/textures/calm-sea-skybox/up.webp new file mode 100644 index 0000000..72790ce Binary files /dev/null and b/textures/calm-sea-skybox/up.webp differ diff --git a/textures/waternormals.avif b/textures/waternormals.avif deleted file mode 100644 index 0bf09d0..0000000 Binary files a/textures/waternormals.avif and /dev/null differ diff --git a/textures/waternormals.webp b/textures/waternormals.webp new file mode 100644 index 0000000..b6672f0 Binary files /dev/null and b/textures/waternormals.webp differ