I would like to add antialiasing to a jogl program I made. I have a large polygon with many tiny polygons on it. The tiny polygons rarely appear correctly without antialiasing and there are lots of jagged edges where the large polygon touches the background color in my scene.
What is the best way to implement this given my situation?
I am embedding the opengl stuff in an SWT window. If I understand, this means I cannot use code like this because I don’t use a standard GLCanvas:
GLCapabilities cap = new GLCapabilities();
cap.setSampleBuffers(true);
cap.setNumSamples(2);
SWT has an object similar to GLCapabilities called GLData which is passed to the SWT version of GLCanvas. It has two variables sampleBuffers and samples which I have set to 1 and 16, respectively. I really don’t know how to proceed beyond this (or even if what I did was useful). I have seen reference to using gl.glEnable(GL.GL_POLYGON_SMOOTH) in many places online, but whatever snippets of code I try, they never seem to work. I feel I am missing something or have something present that is interfering. Antialiasing does work on my computer as I can enable it by overriding the application via my nvidia control panel.