THREE.js - 创建发光球体的粒子系统

时间:2016-07-22 23:33:59

标签: three.js

所以我有一个简单的粒子系统,使用THREE.Points和THREE.ParticleBasicMaterial作为材料。

使用此.png图像将所有点渲染为广告牌。 enter image description here

当渲染时,我希望每个粒子都是一个发光的球体(不完全发光,但由于径向渐变渐渐变成透明度,它肯定具有这种效果)。如何让透明度发挥作用?结果如下: enter image description here

我的材料看起来像这样(注意我尝试使用不同类型的混合模式,但它们只是让事情变得更糟)。

        this.material = new THREE.ParticleBasicMaterial({
            color: 'transparent',
            size: 0.8,
            map: this.spriteImage,
            transparent: true,
            sizeAttenuation: true
        });

1 个答案:

答案 0 :(得分:1)

在材质中添加“depthWrite:false”,如下所示:

this.material = new THREE.ParticleBasicMaterial({
    color: 'transparent',
    size: 0.8,
    map: this.spriteImage,
    transparent: true,
    opacity: 0.5,        // should be less than 1.0
    sizeAttenuation: true,
    depthWrite: false
});
相关问题