How do points smoothly disappear with increasing distance?

I have a model in a self-generated sphere of points. The problem is that I can’t figure out how the points smoothly disappear with distance. I have created a test excerpt from my project.

PointsSphereTEST

Since I have little experience with materials, is it possible that I have overlooked an important parameter? Or is it necessary to modify the PointsMaterial?

//................................................................................
const aT = 0.404; // points that are strongly visible from afar
// const aT = 0.405; // points that disappear widely abruptly from a distance
//................................................................................

new THREE.PointsMaterial( {
   map: circle, size: 0.02, color: 'yellow', sizeAttenuation: true, transparent: true, opacity: 0.8, alphaTest: aT } );

aT = 0.404;
2023-02-17 10.14.48


aT = 0.405;

2023-02-17 09.44.20 2023-02-17 10.14.00


Postscript. You can click on the pdf icon.

void main() {

	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>

	gl_PointSize = size;

	#ifdef USE_SIZEATTENUATION

		bool isPerspective = isPerspectiveMatrix( projectionMatrix );

		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );

	#endif

	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>

}

@hofk
I’m not sure how correct this approach is, but I hope it will be helpful:

@Chaser_Code
Would be cool to add some explanation to the code you provided. What it is, why it’s here, and what supposed to do with it. Not specifically for me, but for those, who don’t know what the vertex shader of points looks like.

PS

Mmm… good old times :slight_smile:

I have guessed that it does not work without shader! Rather, after the first answer. I was already trying onBeforeCompile: and looked if you can find a suitable shader material somewhere. But if I would have reached the goal with that is very questionable. To look at the vertex shader of points, that might have been the last thing I wanted to do.

Thanks for the solution. :+1:

In the example of the original post, the question is visible and the solution is applied.