multisample and shaders

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

multisample and shaders

Mathieu Blossier
Hi,

I use vertex and fragment shaders. How do you specifiy fragment shader to be multisampled ?
glEnable(GL.GL_MULTISAMPLE) doesn't seem to work.

Thanks,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: multisample and shaders

Mathieu Blossier
Sorry, I've forgot to set properly setNumSamples() to the GLCapabilities.

What is the correct value ? 4 seems not enough...

Cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: multisample and shaders

jmaasing
I use this in my app:

if (useFSAA) {
        caps.setSampleBuffers(true);
        caps.setNumSamples(prefs.getFSAANumSamples());
}

to enable anti-aliasing but I haven't done anything special in my shaders to handle multi-sampling so maybe it isn't enough for what you are trying to do.

EDIT:  Forgot to say that 4,8,16 all works for me as value for numSamples, at least it looks like AA is enabled then :-)
Reply | Threaded
Open this post in threaded view
|

Re: multisample and shaders

Mathieu Blossier
Hi,

Thanks ! What is prefs.getFSAANumSamples() ? I thought prefs were "profile", but maybe it's something you've created from your own ?

Cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: multisample and shaders

jmaasing
Yes, sorry I was a bit quick in pasting there, prefs is my own class, that method just return an integer to indicate the number of samples like: 4, 8, 16
Reply | Threaded
Open this post in threaded view
|

Re: multisample and shaders

Mathieu Blossier
Ok, thanks !

Is there any way to check what multisample size is possible with the GPU ? Or is it automatically set to the maximum value if oversized ?

Cheers,
Mathieu