Sign in to follow this  
minibutmany

OpenGL Jagged Edges with Anti-Aliasing LWJGL

Recommended Posts

I am using 

Display.create(new PixelFormat(0, 8, 0, 2));

to create anti-aliasing in my LWJGL project, and it is having an strange effect:

With PixelFormat:

[attachment=22182:Screenshot 2014-06-17 15.50.49.png]

Without PixelFormat:

[attachment=22183:Screenshot 2014-06-17 15.51.15.png]

 

Here is what I am using to init openGL:

 

glMatrixMode(GL_PROJECTION);

glLoadIdentity();
gluPerspective(90f, (float)width / (float)height, 0.001f, 70f);
glMatrixMode(GL_MODELVIEW);
glEnable(GL_DEPTH_TEST);
 
The cubes are rendered with the solid cube slightly smaller than a wireframe cube.

Share this post


Link to post
Share on other sites

new PixelFormat(0, 8, 0, 2)
*checks javadocs*

 

So you're trying to create a context with 0 bits for alpha, 8 bits for depth, 0 bits for stencil and 2 samples? 8 bits for depth is awfully low. Try with 24 bit for depth, 8 bit for stencil. Which is the standard setup.

gluPerspective(90f, (float)width / (float)height, 0.001f, 70f);
Your near plane is awfully small too. Try something higher, 0.5 or 1.0.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this