Polygon antialiasing not working

Started by mimhof, April 09, 2006, 18:36:46

Previous topic - Next topic

mimhof

I try to draw filled polygons wich should be antialiased. But for a unknown
reasons its not working.
 
GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL);
GL11.glEnable(GL11.GL_POLYGON_SMOOTH);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_NICEST);
GL11.glBegin(GL11.GL_POLYGON);
    // draw some vertexes..
GL11.glEnd();


The funny thing its working when I try with the polygon mode = GL_LINE!
But of course the polygon is not filled then!

Michael

mimhof

Forgot to say that blending is enabled
GL11.glEnable(GL11.GL_BLEND);

Michael

mimhof

I tested this on different computers and I get different results:

Laptop 1
----------
Polygon antialising is ok.
Filling is not plain color (some strange structure).

Laptop 2
----------
Polygon antialising is not working.
Filling is ok.

Workstation
--------------
Polygon antialising is ok.
Filling is ok.

I got also different behaviour with horizontal/vertical lines with width = 1.
On some machines the line color is smoother and the width is 2 and on
other machines the line color is 1 and the color is the original color.
What I need is a sharp horizontal/vertical line on all machines.

Can somebody explain that??

Michael

Fool Running

GL11.glEnable(GL11.GL_POLYGON_SMOOTH);

This is not true anti-alaising. On my card (GeForce 5600) it produces holes at the polygon edges. To my knowledge, this is not supported too much in cards (someone can correct me on this) since true anti-alaising came out.

If you want real anti-alaising, look at the PixelFormat you give to Display.Create(). The number of samples is the number of the anti-alaising (i.e. samples == 4 == 4x anti-alaising).
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

mimhof

I'm working with the lwjgl java binding (included in eclipse 3.2 M3 and heigher). How can I use multisampling with this binding?

Fool Running

QuoteI'm working with the lwjgl java binding (included in eclipse 3.2 M3 and heigher). How can I use multisampling with this binding?
I'm not sure. I'm not familiar with the eclipse binding. :cry:

Anyone else know?  :lol:
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

baysmith

Unfortunately, OpenGL in SWT does not yet support multisampling. Although the org.eclipse.swt.opengl.GLData class contains samples and sampleBuffers fields, they are not currently used in the org.eclipse.swt.opengl.GLCanvas class. The following code is from the GLCanvas:
Quote
//FIXME - use wglChoosePixelFormatARB
//   if (data.sampleBuffers > 0) {
//      wglAttrib [pos++] = WGL.WGL_SAMPLE_BUFFERS_ARB;
//      wglAttrib [pos++] = data.sampleBuffers;
//   }
//   if (data.samples > 0) {
//      wglAttrib [pos++] = WGL.WGL_SAMPLES_ARB;
//      wglAttrib [pos++] = data.samples;
//   }