Rendering spheres (or points) in a particle system

后端 未结 3 797
失恋的感觉
失恋的感觉 2021-01-06 19:45

I am using the Three.JS library to display a point cloud in a web brower. The point cloud is generated once at start up and no further points are added or removed. But it do

3条回答
  •  一个人的身影
    2021-01-06 20:15

    The problem with the image is that when you have thousands of points it seems they sometimes obscure each other around the edges. From what I can gather it seems like the black region in a point's png file blocks the image immediately behind the current point. (But it is transparent to points further behind)

    You can get rid of the transparency overlapping problem of the underlying square structure by turning

    depthTest:false
    

    The problem then is, if you are adding additional objects to the scene the depth-testing will fail and the PointCloud will be rendered in front of the other objects, ignoring the actual order. To get around that you can additionally turn off

    depthWrite:false
    

提交回复
热议问题