Jagged Edges with Anti-Aliasing LWJGL

Started by
1 comment, last by minibutmany 9 years, 10 months ago

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.
Stay gold, Pony Boy.
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.

"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

Thank you very much!

All hail the chubu!

Stay gold, Pony Boy.

This topic is closed to new replies.

Advertisement