use avif to reduce textures size
42
main.js
@ -80,12 +80,12 @@ const scene = new THREE.Scene();
|
|||||||
scene.background = new THREE.CubeTextureLoader(loadMngr)
|
scene.background = new THREE.CubeTextureLoader(loadMngr)
|
||||||
.setPath( 'textures/calm-sea-skybox/' )
|
.setPath( 'textures/calm-sea-skybox/' )
|
||||||
.load( [
|
.load( [
|
||||||
'ft.jpg',
|
'ft.avif',
|
||||||
'bk.jpg',
|
'bk.avif',
|
||||||
'up.jpg',
|
'up.avif',
|
||||||
'dn.jpg',
|
'dn.avif',
|
||||||
'rt.jpg',
|
'rt.avif',
|
||||||
'lf.jpg',
|
'lf.avif',
|
||||||
] );
|
] );
|
||||||
scene.backgroundBlurriness = 0.03;
|
scene.backgroundBlurriness = 0.03;
|
||||||
scene.backgroundIntensity = 1.4;
|
scene.backgroundIntensity = 1.4;
|
||||||
@ -102,10 +102,10 @@ const mazeCollisionner = new THREE.Group();
|
|||||||
// Maze
|
// Maze
|
||||||
|
|
||||||
const wallMaterial = new THREE.MeshStandardMaterial({
|
const wallMaterial = new THREE.MeshStandardMaterial({
|
||||||
map : loader.load('textures/Poly-cobblestone-wall/color_map.jpg'),
|
map : loader.load('textures/Poly-cobblestone-wall/color_map.avif'),
|
||||||
normalMap : loader.load('textures/Poly-cobblestone-wall/normal_map_opengl.jpg'),
|
normalMap : loader.load('textures/Poly-cobblestone-wall/normal_map_opengl.avif'),
|
||||||
aoMap : loader.load('textures/Poly-cobblestone-wall/ao_map.jpg'),
|
aoMap : loader.load('textures/Poly-cobblestone-wall/ao_map.avif'),
|
||||||
roughnessMap : loader.load('textures/Poly-cobblestone-wall/roughness_map.jpg'),
|
roughnessMap : loader.load('textures/Poly-cobblestone-wall/roughness_map.avif'),
|
||||||
roughness : 1
|
roughness : 1
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -139,11 +139,11 @@ function repeatGroundMaterial (texture) {
|
|||||||
texture.repeat.set(mazeWidth / 4, mazeWidth / 4)
|
texture.repeat.set(mazeWidth / 4, mazeWidth / 4)
|
||||||
}
|
}
|
||||||
const groundMaterial = new THREE.MeshStandardMaterial({
|
const groundMaterial = new THREE.MeshStandardMaterial({
|
||||||
map : loader.load('textures/angled-blocks-vegetation/albedo.png', repeatGroundMaterial),
|
map : loader.load('textures/angled-blocks-vegetation/albedo.avif', repeatGroundMaterial),
|
||||||
aoMap : loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.png', repeatGroundMaterial),
|
aoMap : loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.avif', repeatGroundMaterial),
|
||||||
metalnessMap: loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.png', repeatGroundMaterial),
|
metalnessMap: loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.avif', repeatGroundMaterial),
|
||||||
normalMap : loader.load('textures/angled-blocks-vegetation/normal-dx.png', repeatGroundMaterial),
|
normalMap : loader.load('textures/angled-blocks-vegetation/normal-dx.avif', repeatGroundMaterial),
|
||||||
roughnessMap: loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.png', repeatGroundMaterial),
|
roughnessMap: loader.load('textures/angled-blocks-vegetation/ao-roughness-metalness.avif', repeatGroundMaterial),
|
||||||
/*hexTiling : {
|
/*hexTiling : {
|
||||||
patchScale: 1,
|
patchScale: 1,
|
||||||
useContrastCorrectedBlending: true,
|
useContrastCorrectedBlending: true,
|
||||||
@ -204,7 +204,7 @@ const ocean = new Water(waterGeometry, {
|
|||||||
textureWidth : 512,
|
textureWidth : 512,
|
||||||
textureHeight: 512,
|
textureHeight: 512,
|
||||||
waterNormals : loader.load(
|
waterNormals : loader.load(
|
||||||
'textures/waternormals.jpg',
|
'textures/waternormals.avif',
|
||||||
function (texture) {
|
function (texture) {
|
||||||
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
|
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
|
||||||
}
|
}
|
||||||
@ -302,15 +302,15 @@ function repeatRaftMaterial(texture) {
|
|||||||
texture.repeat.set(2, 1)
|
texture.repeat.set(2, 1)
|
||||||
}
|
}
|
||||||
const raftMaterial = new THREE.MeshStandardMaterial({
|
const raftMaterial = new THREE.MeshStandardMaterial({
|
||||||
map: loader.load("textures/Poly-wood/color_map.jpg", repeatRaftMaterial),
|
map: loader.load("textures/Poly-wood/color_map.avif", repeatRaftMaterial),
|
||||||
aoMap: loader.load("textures/Poly-wood/ao_map.jpg", repeatRaftMaterial),
|
aoMap: loader.load("textures/Poly-wood/ao_map.avif", repeatRaftMaterial),
|
||||||
normalMap: loader.load("textures/Poly-wood/normal_map_opengl.jpg", repeatRaftMaterial),
|
normalMap: loader.load("textures/Poly-wood/normal_map_opengl.avif", repeatRaftMaterial),
|
||||||
normalScale : new THREE.Vector2(2, 2),
|
normalScale : new THREE.Vector2(2, 2),
|
||||||
roughnessMap: loader.load("textures/Poly-wood/roughness_map.jpg", repeatRaftMaterial),
|
roughnessMap: loader.load("textures/Poly-wood/roughness_map.avif", repeatRaftMaterial),
|
||||||
depthFunc: 3,
|
depthFunc: 3,
|
||||||
depthTest: true,
|
depthTest: true,
|
||||||
depthWrite: true,
|
depthWrite: true,
|
||||||
displacementMap: loader.load("textures/Poly-wood/displacement_map.jpg", repeatRaftMaterial),
|
displacementMap: loader.load("textures/Poly-wood/displacement_map.avif", repeatRaftMaterial),
|
||||||
displacementScale: -0.3,
|
displacementScale: -0.3,
|
||||||
displacementBias: 0.15,
|
displacementBias: 0.15,
|
||||||
})
|
})
|
||||||
|
BIN
textures/Poly-cobblestone-wall/ao_map.avif
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
textures/Poly-cobblestone-wall/color_map.avif
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
textures/Poly-cobblestone-wall/displacement_map.avif
Normal file
After Width: | Height: | Size: 147 KiB |
BIN
textures/Poly-cobblestone-wall/normal_map_opengl.avif
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
textures/Poly-cobblestone-wall/render_map.avif
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
textures/Poly-cobblestone-wall/roughness_map.avif
Normal file
After Width: | Height: | Size: 349 KiB |
BIN
textures/Poly-wood/ao_map.avif
Normal file
After Width: | Height: | Size: 377 KiB |
BIN
textures/Poly-wood/color_map.avif
Normal file
After Width: | Height: | Size: 635 KiB |
BIN
textures/Poly-wood/displacement_map.avif
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
textures/Poly-wood/normal_map_opengl.avif
Normal file
After Width: | Height: | Size: 904 KiB |
BIN
textures/Poly-wood/render_map.avif
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
textures/Poly-wood/roughness_map.avif
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
textures/angled-blocks-vegetation/albedo.avif
Normal file
After Width: | Height: | Size: 542 KiB |
BIN
textures/angled-blocks-vegetation/ao-roughness-metalness.avif
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
textures/angled-blocks-vegetation/ao.avif
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
textures/angled-blocks-vegetation/height.avif
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
textures/angled-blocks-vegetation/metallic.avif
Normal file
After Width: | Height: | Size: 582 B |
BIN
textures/angled-blocks-vegetation/normal-dx.avif
Normal file
After Width: | Height: | Size: 2.0 MiB |
BIN
textures/angled-blocks-vegetation/roughness.avif
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
textures/calm-sea-skybox/bk.avif
Normal file
After Width: | Height: | Size: 165 KiB |
BIN
textures/calm-sea-skybox/dn.avif
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
textures/calm-sea-skybox/ft.avif
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
textures/calm-sea-skybox/lf.avif
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
textures/calm-sea-skybox/rt.avif
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
textures/calm-sea-skybox/up.avif
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
textures/waternormals.avif
Normal file
After Width: | Height: | Size: 97 KiB |