// --- Dust Particle System Function --- function createDust() { const particleCount = 2000; const particlesGeometry = new THREE.BufferGeometry(); const positions = []; for (let i = 0; i < particleCount; i++) { positions.push( (Math.random() - 0.5) * 15, Math.random() * 10, (Math.random() - 0.5) * 15 ); } // Use THREE.Float32BufferAttribute to correctly set the position attribute particlesGeometry.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3)); const particleMaterial = new THREE.PointsMaterial({ color: 0xffffff, size: 0.015, transparent: true, opacity: 0.08, blending: THREE.AdditiveBlending }); dust = new THREE.Points(particlesGeometry, particleMaterial); // Dust particles generally don't cast or receive shadows in this context scene.add(dust); }