Hello!
I created a gLCanvas with 4x fsaa using the Multisample jogl demo. My fps hasn’t changed! I don’t understand?
What did I wrong? Or it is normal?
My code is below:
public class MultisampleChooser extends DefaultGLCapabilitiesChooser {
public int chooseCapabilities(GLCapabilities desired,
GLCapabilities[] available,
int windowSystemRecommendedChoice) {
boolean anyHaveSampleBuffers = false;
for (int i = 0; i < available.length; i++) {
GLCapabilities caps = available[i];
if (caps != null && caps.getSampleBuffers()) {
anyHaveSampleBuffers = true;
break;
}
}
int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
if (!anyHaveSampleBuffers) {
System.err.println("WARNING: antialiasing will be disabled because none of the available pixel formats had it to offer");
} else if (!available[selection].getSampleBuffers()) {
System.err.println("WARNING: antialiasing will be disabled because the DefaultGLCapabilitiesChooser didn't supply it");
}
return selection;
}
}
public static GLCanvas newGLJObject(){
GLCapabilities caps = new GLCapabilities();
caps.setSampleBuffers(true);
caps.setNumSamples(4);
return GLDrawableFactory.getFactory().createGLCanvas(caps, new MultisampleChooser() );
}
public void init(GLDrawable glDrawable) {
…
gl.glEnable(GL.GL_MULTISAMPLE_ARB);
…
}