View Full Version : Multisampling and point_parameters extension

09-08-2006, 09:22 AM
This extension is driving me crazy...

I attempt to draw some stars with points. I want the stars to light off when moving away (just like in startrek or in the stars screensavers).

Without multisample, I can not use the Fade-Threshold. So, I activated it (I added "GLX_SAMPLE_BUFFERS, 1" to my attribList in my call to glXChooseVisual).

I check (with glGetIntergerv) that I have a GLX_SAMPLE_BUFFERS of 1. While checking for GLX_SAMPLES it returns 2. So, I suppose the multisample is ok.

Now, there is my code:

// Enabling the multisample

// Enabling a standard blending for alpha
glEnable (GL_BLEND);

// Please make me beautiful round points

// Configuring the point_parameters extension
GLfloat att[3]={0.f,0.f,1.f};
glPointParameterf (GL_POINT_SIZE_MIN, 1.f);
glPointParameterf (GL_POINT_SIZE_MAX, 100.f);
glPointParameterf (GL_POINT_FADE_THRESHOLD_SIZE, 4.f);
glPointParameterfv (GL_POINT_DISTANCE_ATTENUATION, att);

// Drawing my points
glPointSize (2.f);
glBegin (GL_POINTS);
for (...)
glVertex3f (...);
glEnd ();My problem is that with or without the multisample, this code does exactly the same thing. When moving away, all the points go in the center of the screen, and I have a white heap of stars.

What's wrong?

09-08-2006, 03:06 PM
The minimum size of the points is 1 and can't become less than that, thus multisample doesn't work with pointsprites, since there is nothing to multisample.

Try fading out pixels instead(using glColor4f), or supersampling if your brave.