Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hello guys,
I'm trying to set some line loops to 1 pixel width, but I always get some antialiasing effect when the width number is an odd number Here some example code: gl2.glLineWidth(1.0f); gl2.glBegin(GL2.GL_LINES); gl2.glVertex2i(-10, 0); gl2.glVertex2i(-10, 10); gl2.glEnd(); gl2.glLineWidth(2.0f); gl2.glBegin(GL2.GL_LINES); gl2.glVertex2i(-10, -10); gl2.glVertex2i(-10, 0); gl2.glEnd(); gl2.glLineWidth(3.0f); gl2.glBegin(GL2.GL_LINES); gl2.glVertex2i(-10, -20); gl2.glVertex2i(-10, -10); gl2.glEnd(); gl2.glLineWidth(4.0f); gl2.glBegin(GL2.GL_LINES); gl2.glVertex2i(-10, -30); gl2.glVertex2i(-10, -20); gl2.glEnd(); gl2.glLineWidth(5.0f); gl2.glBegin(GL2.GL_LINES); gl2.glVertex2i(-10, -40); gl2.glVertex2i(-10, -30); gl2.glEnd(); produces this (in order from up to down): http://dl.dropbox.com/u/1401029/LineWidth.png gl2.glIsEnabled(GL2.GL_LINE_SMOOTH) returns false and gl2.glhint doesnt seem to affect it at all any ideas? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
You might try querying the supported widths as described at http://www.opengl.org/wiki/GLAPI/glLineWidth. Implementations aren't required to support non-antialiased line widths greater than 1.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
float[] b = new float[2]; gl2.glGetFloatv(GL2.GL_ALIASED_LINE_WIDTH_RANGE, b, 0); System.out.println("b[0]: "+b[0]+" b[1]: "+b[1]); gl2.glGetFloatv(GL2.GL_SMOOTH_LINE_WIDTH_RANGE, b, 0); System.out.println("b[0]: "+b[0]+" b[1]: "+b[1]); gl2.glGetFloatv(GL2.GL_SMOOTH_LINE_WIDTH_GRANULARITY, b, 0); System.out.println("b[0]: "+b[0]); b[0]: 1.0 b[1]: 10.0 b[0]: 0.5 b[1]: 10.0 b[0]: 0.125 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Very strange that the anti-aliasing would be width-dependent... do you have multisampling AA turned on, by any chance?
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Where do you mean exactly? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
I mean, have you got full-screen antialiasing turned on via ARB_multisample (defined at http://www.opengl.org/registry/specs/ARB/multisample.txt, see http://nehe.gamedev.net/tutorial/fullscreen_antialiasing/16008/ for an example). This could give the appearance of line antialiasing, though I don't know why it would only work at some widths.
This could also just be a driver bug or bad line implementation in your graphics card. As I understand it, consumer graphics cards sometimes don't implement lines very well, since they're mostly used in CAD applications. You might try on another graphics card to see if you get the same results. |
Free forum by Nabble | Edit this page |