I'm using a circle texture to render particles:
The circle has transparent pixels. I'm using ShaderMaterial
and BufferGeometry
to provide custom size, color for each node. However I'm stuck with proper z-index rendering. In the image below:
The white particle is the nearest to the camera, the cyan (0x00ffff
) is the second, and hibiscus color on the top right (0xC3206F
looks pinkish) is the farthest.
As you can see the order is not correct. Ideally white circle should fully override cyan, and partially cover hibiscus. If I set depthTest: true
for ShaderMaterial
, the transparent regions of the texture become solid:
Here is the full source code: http://jsbin.com/mikimifipi/edit?js,output
I'm probably missing something with blending or messed up with the shaders. Can you please help?