大量のパーティクル(正確には80.000)を作成していて、透明なマップを設定しましたが、すべてのパーティクルが透明であるとは限りません。
透明なPNG画像を使用しています:(ほとんど表示されていませんが、問題ありません)マテリアルマップとして使用していますが、ここに示すように背景は黒です。
よく見ると、一部のパーティクルはうまく混ざり合っています(重なり合う黒いエッジはありません)が、そうでないものもあります。重なり合う透明なオブジェクトが非常に多いためでしょうか、それともこれが問題になるべきではないでしょうか。
これが私のパーティクルの生成に関与するスニペットです:
// load the texture
var map = THREE.ImageUtils.loadTexture('img/particle.png');
// create temp variables
var geometry, material;
// create an array with ParticleSystems (I need multiple systems because I have different colours, thus different materials)
var systems = [];
// Loop through every colour
for(var i = 0; i < colors.length; i++) {
// Create a new geometry
geometry = new THREE.Geometry();
// create a new material
material = new THREE.ParticleBasicMaterial({
color: colors[i],
size: 20,
map: map, // set the map here
transparent: true // transparency is enabled!!!
});
// create a new particle system
systems[i] = new THREE.ParticleSystem(geometry, material);
// add the system to the scene
scene.add(systems[i]);
}
// vertices are added to the ParticleSystems' geometry here
一部のパーティクルの背景が黒いのはなぜですか?