updated material + lighting
This commit is contained in:
@@ -38,5 +38,12 @@ export class LightingManager {
|
|||||||
const pointLight2 = new THREE.PointLight(0xff4444, 0.3, 25)
|
const pointLight2 = new THREE.PointLight(0xff4444, 0.3, 25)
|
||||||
pointLight2.position.set(5, -5, -8)
|
pointLight2.position.set(5, -5, -8)
|
||||||
scene.add(pointLight2)
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,10 +254,20 @@ export class ModelLoader {
|
|||||||
// Create multiple instances of the loaded model
|
// Create multiple instances of the loaded model
|
||||||
const numInstances = 20
|
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) => {
|
gltf.scene.traverse((child) => {
|
||||||
if (child instanceof THREE.Mesh) {
|
if (child instanceof THREE.Mesh) {
|
||||||
child.castShadow = true
|
child.castShadow = true
|
||||||
child.receiveShadow = 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
|
// Clone the model
|
||||||
const modelClone = gltf.scene.clone()
|
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
|
// Start objects close to the attraction point for immediate clustering
|
||||||
const x = (Math.random() - 0.5) * 6 // Reduced from 25 to 6
|
const x = (Math.random() - 0.5) * 6 // Reduced from 25 to 6
|
||||||
const y = (Math.random() - 0.5) * 6 // Reduced from 25 to 6
|
const y = (Math.random() - 0.5) * 6 // Reduced from 25 to 6
|
||||||
|
|||||||
Reference in New Issue
Block a user