Threejs精灵订购

时间:2013-03-23 18:51:29

标签: three.js webgl voxel

我在使用Three.js渲染精灵时遇到问题,使问题进一步复杂化我正在使用游戏引擎voxel.js来管理实例。

示例:http://christopherdebeer.com/sandbox/voxeljs/

我已经尝试搞乱了深度{write | test}:

material = new game.THREE.SpriteMaterial({
  map: spriteB, 
  useScreenCoordinates: false,
  alignment: game.THREE.SpriteAlignment.bottomCenter,
  color: 0xffffff,
  fog: true,
  depthWrite: true,
  depthTest: false
});

表示示例左侧的半透明网格。

我需要的是透明网格或体素,以便在该位置显示2d精灵时为空间提供一些物质。

我如何解决这个问题,或者我做错了什么?

2 个答案:

答案 0 :(得分:2)

这几乎是你需要它的一年后,但@WestLangley描述了精灵最后呈现的方式,因此不能很好地与透明对象一起使用。他提供了一些解决这个问题的技巧。

three.js - cannot view a sprite through a mesh with transparency?

答案 1 :(得分:0)

我似乎缺少一个alpha测试:尝试将参数alphaTest: 0.5添加到您传递给SpriteMaterial的参数中,看看它是否有帮助(尝试将depthTest设置为{{1 }})

相关问题