Transparency within instanced shapes

前端 未结 2 1588
庸人自扰
庸人自扰 2021-01-24 23:09

I\'ve been playing with THREE.InstancedBufferGeometry. I finally got an example to work, and have now been playing with the shader. The first thing I tried was sett

2条回答
  •  借酒劲吻你
    2021-01-24 23:37

    You are using InstancedBufferGeometry with meshes that are translucent.

    The instances are rendered in the order they appear in the buffer. The faces of each instance are rendered in the ordered specified by the geometry.

    Consequently, if you use instancing with translucency, you will likely have artifacts depending on the viewing angle.

    Depending on your use case, you can try setting material.depthWrite = false, but that can lead to other artifacts.

    If your mesh textures have areas of complete transparency (rather than partial) you should be able to use material.alphaTest to discard unwanted fragments without artifacts.

    three.js r.84

提交回复
热议问题