Jump to content
  • Advertisement
Sign in to follow this  
minibutmany

OpenGL Jagged Edges with Anti-Aliasing LWJGL

This topic is 1519 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!