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
Forgot to say that blending is enabled
GL11.glEnable(GL11.GL_BLEND);
Michael
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
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).
I'm working with the lwjgl java binding (included in eclipse 3.2 M3 and heigher). How can I use multisampling with this binding?
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:
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;
// }