Slide 33
Slide 33 text
Explosions
const particleSettings = {
texture: {
value: textureLoader.load(smokeImage)
},
depthTest: true,
depthWrite: false,
blending: THREE.NormalBlending,
maxParticleCount: 1000
}
const emitters = [
{
particleCount: 600,
type: SPE.distributions.SPHERE,
position: {
radius: 0.1
},
maxAge: {
value: 0.5
},
activeMultiplier: 20,
velocity: {
value: new THREE.Vector3(1.2)
},
size: { value: 1.5 },
opacity: { value: [0.5, 0] }
}
]
// init particles
initParticles () {
this.particleGroup = new SPE.Group(
particleSettings
)
this.particleGroup.addPool(1, emitters, false)
this.headGroup.add(this.particleGroup.mesh)
}
// play sound and show smoke
triggerSmoke () {
player.play('shot')
this.particleGroup.triggerPoolEmitter(
1,
smokePosition
)
}
I used Shader Particle Engine