three.js point clouds, BufferGeometry and incorrect transparency

后端 未结 1 555
臣服心动
臣服心动 2021-01-23 04:38

The problem: I have a point cloud with quite a lot of data points (around one million). When I apply transparency to the rendered points, the transparency somehow does not show

相关标签:
1条回答
  • 2021-01-23 05:20

    The way the alpha blending equation works is that a source colour for geometry that is behind is covered by a destination colour for geometry that is in front. This means you need to render your transparent geometry in sorted order from back to front, so that geometry in front will correctly blend with geometry behind.

    If all you have is transparent geometry then you can just disable depth testing, render in reverse depth sorted order, and it will work. If you have opaque geometry as well then you need to first render all opaque geometry normally, then disable depth writing (not testing) and render transparent geometry in reverse depth sorted order, then re-enable depth writing.

    Here are some answers to similar questions if you're interested in learning a bit more.

    0 讨论(0)
提交回复
热议问题