Jump to content

  • Log In with Google      Sign In   
  • Create Account


Jagged Edges with Anti-Aliasing LWJGL

  • You cannot reply to this topic
2 replies to this topic

#1 minibutmany   Members   -  Reputation: 1472

Like
0Likes
Like

Posted 17 June 2014 - 01:58 PM

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:

Screenshot 2014-06-17 15.50.49.png

Without PixelFormat:

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.

Stay gold, Pony Boy.

Sponsor:

#2 TheChubu   Crossbones+   -  Reputation: 3698

Like
2Likes
Like

Posted 18 June 2014 - 02:45 AM

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.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#3 minibutmany   Members   -  Reputation: 1472

Like
1Likes
Like

Posted 18 June 2014 - 10:15 AM

Thank you very much!

All hail the chubu!


Stay gold, Pony Boy.





PARTNERS