How to scale shader sprite size to world coords?-

Hi there,

There is a very simple Three.JS sketch based on two shaders. First one is rendering particles, while the second one has to draw something between them.

So, to do that I have calculated distance medians, which would be used for the second GLSL. However, the shader sprites have different scales from 3D world values.

They had to be like that, but they don’t.

The question is—how can I match the GLSL scale with the world coordinates, so I would have sizes as I have on my second reference image?

During some experiments, I have figured out that shader particle size has something with camera.fov/camera.aspect.

The live example is here: