Mic*_* Ma 0 sprite material three.js
我希望场景中的精灵在相机放大或缩小时不会改变大小.精灵使用不同的画布纹理作为材质.
我发现ParticleBasicMatierial中的sizeAttenuation对我有用.但是如果我使用WenGLRenderer,我必须使用ParticleSystem而不是使用CanvasRenderer的Particle.
我目前使用ParticleSystem只包含一个顶点,每个顶点对应一个ParticleSystem,所以我的场景中有大约800多个ParticleSystem,这可以工作,但是消耗很多.
显然,我不能使用"HUD"作为three.js源代码中的例子,因为精灵都在3D场景中.
有人能帮我吗.或者将sizeAttenuation添加到Sprite材质!谢谢!
如果要使用精灵防止尺寸衰减,并且使用透视摄像头,则可以将sizeAttenuation材质的属性设置为false:
var material = new THREE.SpriteMaterial( {
color: 0xffffff,
map: texture,
sizeAttenuation: false
} );
Run Code Online (Sandbox Code Playgroud)
此功能已添加到three.js r.96中.
编辑:更新为three.js r.96