[Lazarus] TOpenGLControl: multisampling not working (Linux/GLX)

Michalis Kamburelis michalis.kambi at gmail.com
Tue Feb 26 06:05:15 CET 2013


Reimar Grabowski wrote:
> Hi,
>
> as the title says multisampling does not work for me.

I was testing TOpenGLControl.MultiSampling on Linux (with Radeon GPU), 
it worked fine for me.

Note that there is a fallback (documented in TCustomOpenGLControl 
interface): if the requested MultiSampling is not available, we fallback 
to non-multisampled context (that's because for most applications 
anti-aliasing can be just an optional feature). I guess you already 
checked that this didn't happen in your case?

The code is pretty straightforward, in glgtkglxcontext.pas 
LOpenGLCreateContextCore gets called with given MultiSampling value, and 
then CreateOpenGLContextAttrList adds to the attributes this:

       Add(GLX_SAMPLE_BUFFERS_ARB); Add(1);
       Add(GLX_SAMPLES_ARB); Add(MultiSampling);

The GLX_SAMPLES_ARB is the minimal required value (as 
http://www.opengl.org/registry/specs/ARB/multisample.txt says 
"...accepts GLX_SAMPLES_ARB in <attribList>, followed by the minimum 
number of samples that can be accepted in the multisample buffer"). So 
it should work... Well, unless GLX is just lying to us.

Can you check what list was created in your case by 
CreateOpenGLContextAttrList, did it contain appropriate GLX_SAMPLES_ARB 
and MultiSampling items?

Michalis




More information about the Lazarus mailing list