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

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Feb 26 10:51:30 CET 2013


On Tue, 26 Feb 2013 06:05:15 +0100
Michalis Kamburelis <michalis.kambi at gmail.com> wrote:

> 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?

I checked: There is no error, so the fallback is not called.

 
> 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?

Yes, it does and the copy contains them too.


Mattias




More information about the Lazarus mailing list