Edge Anti-Aliasing

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Edge Anti-Aliasing

fmorat
Hello!

My 3d objects have some horrible edge aliasing. All the edges that are not vertical or horizontal look really bad. This causes the overall look of my 3D objects to look like crap. It doesn't appear that OpenGL is applying any anti-aliasing to the edges.

Anybody have any resources that could help me with a fix? My google-foo has failed me.

I'm calling
                     gl.glEnable(GL_MULTISAMPLE);

but it does not seem to be doing anything. Plus apparently it is already on by default. Does anybody know of any
other calls to OpenGL that I could make to fix the edge aliasing.

Unfortunately the book "Computer Graphics Programming in OpenGL with Java" 1st Edition,
does not have anything on the subject.

FYI: Texture aliasing is working fine. I enabled MIPMAPPING for that.

Any help is greatly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Edge Anti-Aliasing

fmorat
Finally figure it out. After creating the GLCapabilities object as so:

            final GLCapabilities glcapabilities = new GLCapabilities(profile);

 I needed to make the two calls below:


            glcapabilities.setSampleBuffers(true);
            glcapabilities.setNumSamples(4);

After doing this my 3D objects now look quite nice. No more ugly aliasing!

Must also not forget to make the call below:
 
              gl.glEnable(GL_MULTISAMPLE);

Just mentioning it for anybody that may be having this same problem in the future.
Reply | Threaded
Open this post in threaded view
|

Re: Edge Anti-Aliasing

gouessej
Administrator
Hello

Actually, the Java documentation of this class explains how it works, especially in setSampleBuffers():
https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLCapabilities.html#setSampleBuffers(boolean)
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Edge Anti-Aliasing

fmorat
Thanks! This helps.

As a side note, fun to find out that in this class I can enable stereo display!