Compare commits
3 Commits
e928eb3f01
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
fa2bd33b98
|
|||
| 27e9e30cbc | |||
| 2c3b0b06bb |
52
main.js
@@ -5,7 +5,6 @@ import { Water } from 'three/addons/objects/Water.js'
|
|||||||
import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js'
|
import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js'
|
||||||
import { GUI } from 'three/addons/libs/lil-gui.module.min.js'
|
import { GUI } from 'three/addons/libs/lil-gui.module.min.js'
|
||||||
import { OctreeHelper } from 'three/addons/helpers/OctreeHelper.js'
|
import { OctreeHelper } from 'three/addons/helpers/OctreeHelper.js'
|
||||||
import { CSM } from 'three/addons/csm/CSM.js';
|
|
||||||
import Stats from 'three/addons/libs/stats.module.js'
|
import Stats from 'three/addons/libs/stats.module.js'
|
||||||
|
|
||||||
import MazeMesh from './MazeMesh.js'
|
import MazeMesh from './MazeMesh.js'
|
||||||
@@ -184,6 +183,16 @@ const sideGroundMaterial = new THREE.MeshStandardMaterial({
|
|||||||
roughness : wallMaterial.roughness,
|
roughness : wallMaterial.roughness,
|
||||||
metalness : wallMaterial.metalness,
|
metalness : wallMaterial.metalness,
|
||||||
})
|
})
|
||||||
|
sideGroundMaterial.map.wrapS = sideGroundMaterial.map.wrapT = THREE.RepeatWrapping
|
||||||
|
sideGroundMaterial.map.repeat.set(mazeWidth, 20)
|
||||||
|
sideGroundMaterial.map.rotation = Math.PI
|
||||||
|
sideGroundMaterial.normalMap.wrapS = sideGroundMaterial.normalMap.wrapT = THREE.RepeatWrapping
|
||||||
|
sideGroundMaterial.normalMap.repeat.set(mazeWidth, 20)
|
||||||
|
sideGroundMaterial.normalMap.rotation = Math.PI
|
||||||
|
sideGroundMaterial.roughnessMap.wrapS = sideGroundMaterial.roughnessMap.wrapT = THREE.RepeatWrapping
|
||||||
|
sideGroundMaterial.roughnessMap.repeat.set(mazeWidth, 20)
|
||||||
|
sideGroundMaterial.roughnessMap.rotation = Math.PI
|
||||||
|
|
||||||
loader.load('Poly-cobblestone-wall/ao_map.jpg', (texture) => {
|
loader.load('Poly-cobblestone-wall/ao_map.jpg', (texture) => {
|
||||||
wallMaterial.aoMap = texture
|
wallMaterial.aoMap = texture
|
||||||
wallMaterial.metalnessMap = texture
|
wallMaterial.metalnessMap = texture
|
||||||
@@ -194,16 +203,7 @@ loader.load('Poly-cobblestone-wall/ao_map.jpg', (texture) => {
|
|||||||
sidegroundTexture.repeat.set(mazeWidth, 20)
|
sidegroundTexture.repeat.set(mazeWidth, 20)
|
||||||
sidegroundTexture.rotation = Math.PI
|
sidegroundTexture.rotation = Math.PI
|
||||||
|
|
||||||
sideGroundMaterial.map.wrapS = sideGroundMaterial.map.wrapT = THREE.RepeatWrapping
|
|
||||||
sideGroundMaterial.map.repeat.set(mazeWidth, 20)
|
|
||||||
sideGroundMaterial.map.rotation = Math.PI
|
|
||||||
sideGroundMaterial.normalMap.wrapS = sideGroundMaterial.normalMap.wrapT = THREE.RepeatWrapping
|
|
||||||
sideGroundMaterial.normalMap.repeat.set(mazeWidth, 20)
|
|
||||||
sideGroundMaterial.normalMap.rotation = Math.PI
|
|
||||||
sideGroundMaterial.aoMap = sidegroundTexture
|
sideGroundMaterial.aoMap = sidegroundTexture
|
||||||
sideGroundMaterial.roughnessMap.wrapS = sideGroundMaterial.roughnessMap.wrapT = THREE.RepeatWrapping
|
|
||||||
sideGroundMaterial.roughnessMap.repeat.set(mazeWidth, 20)
|
|
||||||
sideGroundMaterial.roughnessMap.rotation = Math.PI
|
|
||||||
sideGroundMaterial.metalnessMap = sidegroundTexture
|
sideGroundMaterial.metalnessMap = sidegroundTexture
|
||||||
|
|
||||||
sideGroundMaterial.needsUpdate = true
|
sideGroundMaterial.needsUpdate = true
|
||||||
@@ -246,13 +246,7 @@ const groundMaterial = new THREE.MeshStandardMaterial({
|
|||||||
aoMap : loader.load('angled-blocks-vegetation/ao.webp', repeatGroundMaterial),
|
aoMap : loader.load('angled-blocks-vegetation/ao.webp', repeatGroundMaterial),
|
||||||
metalnessMap: loader.load('angled-blocks-vegetation/ao-roughness-metalness.webp', repeatGroundMaterial),
|
metalnessMap: loader.load('angled-blocks-vegetation/ao-roughness-metalness.webp', repeatGroundMaterial),
|
||||||
normalMap : loader.load('angled-blocks-vegetation/normal-dx.webp', repeatGroundMaterial),
|
normalMap : loader.load('angled-blocks-vegetation/normal-dx.webp', repeatGroundMaterial),
|
||||||
roughnessMap: loader.load('angled-blocks-vegetation/ao-roughness-metalness.webp', repeatGroundMaterial),
|
roughnessMap: loader.load('angled-blocks-vegetation/ao-roughness-metalness.webp', repeatGroundMaterial)
|
||||||
/*hexTiling : {
|
|
||||||
patchScale: 1,
|
|
||||||
useContrastCorrectedBlending: true,
|
|
||||||
lookupSkipThreshold: 0.01,
|
|
||||||
textureSampleCoefficientExponent: 32,
|
|
||||||
}*/
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const ground = new THREE.Mesh(
|
const ground = new THREE.Mesh(
|
||||||
@@ -296,7 +290,7 @@ const ocean = new Water(waterGeometry, {
|
|||||||
waterColor : 0x001e0f,
|
waterColor : 0x001e0f,
|
||||||
distortionScale: 3.7,
|
distortionScale: 3.7,
|
||||||
fog : scene.fog !== undefined,
|
fog : scene.fog !== undefined,
|
||||||
alpha : 0.7
|
alpha : 0.9
|
||||||
})
|
})
|
||||||
ocean.rotation.x = - Math.PI / 2
|
ocean.rotation.x = - Math.PI / 2
|
||||||
ocean.position.y = -0.2
|
ocean.position.y = -0.2
|
||||||
@@ -526,27 +520,9 @@ if (dev) {
|
|||||||
wallMaterialFolder.add(wallMaterial, "roughness").min(0).max(1)
|
wallMaterialFolder.add(wallMaterial, "roughness").min(0).max(1)
|
||||||
wallMaterialFolder.add(wallMaterial, "metalness").min(0).max(1)
|
wallMaterialFolder.add(wallMaterial, "metalness").min(0).max(1)
|
||||||
wallMaterialFolder.add(wallMaterial, "aoMapIntensity").min(-10).max(10)
|
wallMaterialFolder.add(wallMaterial, "aoMapIntensity").min(-10).max(10)
|
||||||
wallMaterialFolder.add(wallMaterial, "bumpScale").min(-10).max(10).onChange(() => wallMaterial.needsUpdate = true)
|
wallMaterialFolder.add(wallMaterial.normalScale, "x")
|
||||||
|
wallMaterialFolder.add(wallMaterial.normalScale, "y")
|
||||||
wallMaterialFolder.close()
|
wallMaterialFolder.close()
|
||||||
|
|
||||||
if (wallMaterial?.hexTiling) {
|
|
||||||
const hexTilingFolder = gui.addFolder('Hex Tiling')
|
|
||||||
if (wallMaterial?.hexTiling?.patchScale) {
|
|
||||||
const wallMaterialFolder = hexTilingFolder.addFolder("wall")
|
|
||||||
wallMaterialFolder.add(wallMaterial.hexTiling, "patchScale", 0, 10)
|
|
||||||
wallMaterialFolder.add(wallMaterial.hexTiling, "useContrastCorrectedBlending")
|
|
||||||
wallMaterialFolder.add(wallMaterial.hexTiling, "lookupSkipThreshold", 0, 1)
|
|
||||||
wallMaterialFolder.add(wallMaterial.hexTiling, "textureSampleCoefficientExponent", 0, 64).name("SampleCoefExp")
|
|
||||||
}
|
|
||||||
if (groundMaterial?.hexTiling?.patchScale) {
|
|
||||||
const groundMaterialFolder = hexTilingFolder.addFolder("ground")
|
|
||||||
groundMaterialFolder.add(groundMaterial.hexTiling, "patchScale", 0, 10)
|
|
||||||
groundMaterialFolder.add(groundMaterial.hexTiling, "useContrastCorrectedBlending")
|
|
||||||
groundMaterialFolder.add(groundMaterial.hexTiling, "lookupSkipThreshold", 0, 1)
|
|
||||||
groundMaterialFolder.add(groundMaterial.hexTiling, "textureSampleCoefficientExponent", 0, 64).name("SampleCoefExp")
|
|
||||||
}
|
|
||||||
hexTilingFolder.close()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 542 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 2.0 MiB |
|
Before Width: | Height: | Size: 475 KiB |
|
Before Width: | Height: | Size: 7.2 MiB |
|
Before Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 9.1 MiB |
|
Before Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 396 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 301 KiB |
|
Before Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 243 KiB |