--- a/src/game/world.js +++ b/src/game/world.js @@ -1,4 +1,6 @@ import * as THREE from 'three'; +import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; +import beaconUrl from './beacon.glb?url&inline'; import { fbm, surface, surfaceMaterial } from '../kit/textures/textures.js'; import { ramp, rockGeometry, scatter, slab, terrain } from '../kit/world/builders.js'; @@ -22,6 +24,14 @@ export function buildWorld(ctx) { const rng = ctx.rng.fork(); + new GLTFLoader().load(beaconUrl, ({ scene: beacon }) => { + beacon.name = 'Original amber beacon'; + beacon.position.set(-1, groundHeight(-1, 2), 2); + beacon.scale.setScalar(2.5); + ctx.scene.add(beacon); + }); + + const groundTex = surface(rng, { size: 256, scale: 9, octaves: 5, colors: ['#d8d2c8', '#ffffff'], speckle: 0.25, normal: 0.9, roughness: [0.85, 1], repeat: 90 }); const groundMat = new THREE.MeshStandardMaterial({ ...groundTex, metalness: 0 }); const low = new THREE.Color('#6f4f38');