如何让 Three.js 精灵背景混合?

amf*_*tal 1 javascript three.js

我在 Three.js 中使用精灵来加载点纹理(以前是点云),但我无法使混合正常工作。这是我正在使用的代码:

this._renderer = new THREE.WebGLRenderer({alpha: true, antialias: true, preserveDrawingBuffer: true});
this._renderer.setClearColor( 0x000000, 0 );
....
new THREE.Points(geometry, new THREE.PointsMaterial({transparent: true,  blending: THREE.CustomBlending, blendSrc: THREE.OneFactor,  blendEquation: THREE.AddEquation, map: lt._sprite, size: 1, vertexColors: true}));
Run Code Online (Sandbox Code Playgroud)

该精灵包含 Threejs 附带的 Disc.png 精灵。它看起来是这样的:

我使用的不同混合看起来与上述之一相同和/或精灵未正确加载(方形点)。

我对 Threejs 或 webgl 不太熟悉。任何帮助表示赞赏。整个代码又长又复杂,但我可以发布任何相关的部分。

amf*_*tal 5

对于遇到同样问题的人来说,为我解决的问题是:

alphaTest: 0.5
Run Code Online (Sandbox Code Playgroud)

传递给pointsmaterial。

new THREE.PointsMaterial({transparent: true, alphaTest: 0.5, ....);
Run Code Online (Sandbox Code Playgroud)