updated material + lighting

This commit is contained in:
2025-07-28 23:14:29 +01:00
parent 9cc9e71a31
commit 92710b3fc2
2 changed files with 26 additions and 0 deletions

View File

@@ -38,5 +38,12 @@ export class LightingManager {
const pointLight2 = new THREE.PointLight(0xff4444, 0.3, 25)
pointLight2.position.set(5, -5, -8)
scene.add(pointLight2)
// Purple backlight for atmospheric effect
const purpleBacklight = new THREE.DirectionalLight(0x8844ff, 0.8)
purpleBacklight.position.set(0, 0, -15)
purpleBacklight.target.position.set(0, 0, 0)
scene.add(purpleBacklight)
scene.add(purpleBacklight.target)
}
}

View File

@@ -254,10 +254,20 @@ export class ModelLoader {
// Create multiple instances of the loaded model
const numInstances = 20
// Create polished gun metal material
const gunMetalMaterial = new THREE.MeshStandardMaterial({
color: 0x2C3E50,
metalness: 0.9,
roughness: 0.3,
envMapIntensity: 1.5
})
gltf.scene.traverse((child) => {
if (child instanceof THREE.Mesh) {
child.castShadow = true
child.receiveShadow = true
// Apply the gun metal material to all meshes
child.material = gunMetalMaterial
}
})
@@ -265,6 +275,15 @@ export class ModelLoader {
// Clone the model
const modelClone = gltf.scene.clone()
// Apply gun metal material to cloned meshes
modelClone.traverse((child) => {
if (child instanceof THREE.Mesh) {
child.material = gunMetalMaterial.clone()
child.castShadow = true
child.receiveShadow = true
}
})
// Start objects close to the attraction point for immediate clustering
const x = (Math.random() - 0.5) * 6 // Reduced from 25 to 6
const y = (Math.random() - 0.5) * 6 // Reduced from 25 to 6