Multisampling - GLCapabilities vs. glEnable

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

Multisampling - GLCapabilities vs. glEnable

bgroenks96
I'm a bit confused about the interaction between GLCapabilities.setSampleBuffers/setNumBuffers and glEnable(GL2.MULTISAMPLE)

Does enabling sample buffers on GLCapabilities just enable the GLCanvas to use MSAA?  And then glEnable must be called to actually use multisampling?  If that's the case, what kind of difference in resource usage does creating a GLCanvas with the setSampleBuffers enabled is there versus creating one with it disabled?
Reply | Threaded
Open this post in threaded view
|

Re: Multisampling - GLCapabilities vs. glEnable

jmaasing
I haven't looked into the source to see what is happening in jogl but when I do:

final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4));
caps.setSampleBuffers(true);
caps.setNumSamples(8);
GLWindow glWindow = GLWindow.create(caps);

I get MSAA without doing anything else in my NEWT window.
Reply | Threaded
Open this post in threaded view
|

Re: Multisampling - GLCapabilities vs. glEnable

bgroenks96
jmaasing wrote
I haven't looked into the source to see what is happening in jogl but when I do:

final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4));
caps.setSampleBuffers(true);
caps.setNumSamples(8);
GLWindow glWindow = GLWindow.create(caps);

I get MSAA without doing anything else in my NEWT window.
So I guess that means that either glEnable/glDisable have no effect or that when you set the capabilities accordingly MSAA is enabled by default.

The latter would mean that you could, in theory, use glDisable(GL2.MULTISAMPLE) to disable it.  Of course, I don't know which explanation is correct...

Very interesting.  Thanks for your input.