SDL_GL_ACCELERATED_VISUAL and FSAA

Hi,

Whenever I combine the following attributes I get the error “Couldn’t
find matching GLX visual” instead of a display surface when I run
SDL_SetVideoMode():

SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
SDL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);

Is this a known error?

It’s interesting though that disabling either SDL_GL_ACCELERATED_VISUAL
or FSAA solves the problem and SDL_SetVideoMode() works just fine.
However, in both of these cases
SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL) indicates that
acceleration is available by returning 1!

My question is: does SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL)
always “tell the truth”? I want to disable a few features (like FSAA)
when acceleration isn’t available. Should I just forget about setting
SDL_GL_ACCELERATED_VISUAL explicitly and decide solely on what a query
on that attribute returns…?

Cheers,
Oliver

Anyone?

Oliver Bock wrote:> Hi,

Whenever I combine the following attributes I get the error “Couldn’t
find matching GLX visual” instead of a display surface when I run
SDL_SetVideoMode():

SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
SDL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);

Is this a known error?

It’s interesting though that disabling either SDL_GL_ACCELERATED_VISUAL
or FSAA solves the problem and SDL_SetVideoMode() works just fine.
However, in both of these cases
SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL) indicates that
acceleration is available by returning 1!

My question is: does SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL)
always “tell the truth”? I want to disable a few features (like FSAA)
when acceleration isn’t available. Should I just forget about setting
SDL_GL_ACCELERATED_VISUAL explicitly and decide solely on what a query
on that attribute returns…?

Cheers,
Oliver


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Does you video card support the options you are asking for? Not all
do. Also, all through you post you talk about FSAA while the code does
not mention FSAA. FSAA is not the same as what you are asking for.

Bob PendletonOn Wed, Nov 26, 2008 at 4:02 AM, Oliver Bock <oliver.bock at aei.mpg.de> wrote:

Anyone?

Oliver Bock wrote:

Hi,

Whenever I combine the following attributes I get the error “Couldn’t find
matching GLX visual” instead of a display surface when I run
SDL_SetVideoMode():

SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
SDL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);

Is this a known error?

It’s interesting though that disabling either SDL_GL_ACCELERATED_VISUAL or
FSAA solves the problem and SDL_SetVideoMode() works just fine. However, in
both of these cases SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL)
indicates that acceleration is available by returning 1!

My question is: does SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL) always
"tell the truth"? I want to disable a few features (like FSAA) when
acceleration isn’t available. Should I just forget about setting
SDL_GL_ACCELERATED_VISUAL explicitly and decide solely on what a query on
that attribute returns…?

Cheers,
Oliver


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

±-------------------------------------+

Not that any of this matters much, but…

I racked my brain (and a small corner of the internet) for a pedantic
necessity to distinguish multisampling with “full screen
anti-aliasing.” I guess it’s less full screen than "supersampling,"
but according to the OpenGL docs, multisampling is a subset of
operations called supersampling. If supersampling is not “full screen
anti-aliasing,” I don’t know what is. (Perhaps you can enlighten me.)On Sun, Nov 30, 2008 at 2:47 PM, Bob Pendleton wrote:

Also, all through you post you talk about FSAA while the code does
not mention FSAA. FSAA is not the same as what you are asking for.


http://codebad.com/

Also, all through you post you talk about FSAA while the code does
not mention FSAA. FSAA is not the same as what you are asking for.

Not that any of this matters much, but…

I racked my brain (and a small corner of the internet) for a pedantic
necessity to distinguish multisampling with “full screen
anti-aliasing.” I guess it’s less full screen than "supersampling,"
but according to the OpenGL docs, multisampling is a subset of
operations called supersampling. If supersampling is not “full screen
anti-aliasing,” I don’t know what is. (Perhaps you can enlighten me.)

FSAA == Full Screen Anti-Aliasing.

It only works on the full screen. It is incredibly simple to add
FSAA to the back end video pipeline on a video card. It only takes a
small number of adders in the final stage before the video DACs.

Supersampling is simply keeping around a sample larger than you
"sorta" need and then reducing it later. It is the same as using
double precision to reduce error accumulation during a computation and
then rounding down to single precision because that is all you really
need. Think double precision transformation matrices that are
converted to single precision before being passed to a hardware
rendering pipe that works in single precision.

FSAA uses supersampling on the whole screen and is nice because it is
so simple to implement in hardware.

So, supersampling can be used on any buffer of any size while FSAA
is supersampling applied to the one buffer that is going to be
converted to a video signal.

General purpose supersambling requires changes through out the entire
rendering system. FSAA only requires a few small changes. FSAA is a
subset of supersampling. So, when the original poster asked for
features that require general purpose supersampling and then talks
about FSAA… well a guy has to wonder what is going on in his head.
If he has them confused and does not know the difference or why you
might have one but not the other, then it is easy to see why he might
not get what he expected.

Bob Pendleton

Thank you, and I hoped I passed the audition. :-)On Sun, Nov 30, 2008 at 3:26 PM, Donny Viszneki <donny.viszneki at gmail.com> wrote:

On Sun, Nov 30, 2008 at 2:47 PM, Bob Pendleton <@Bob_Pendleton> wrote:


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

±-------------------------------------+

It only works on the full screen. It is incredibly simple to add
FSAA to the back end video pipeline on a video card. It only takes a
small number of adders in the final stage before the video DACs.

Ah, clever. And a reminder of how specialized graphics hardware has to
be to remain competitive. It’s hard to imagine that scaling+resampling
isn’t something that can be applied to any framebuffer in graphics
memory. You’re certainly correct though.

FSAA uses supersampling on the whole screen and is nice because it is
so simple to implement in hardware.

Simple enough to implement as an in-circuit video adapter! It would
only require a few scanlines of RAM depending on what scaling factor
you wanted to achieve…

General purpose supersambling requires changes through out the entire
rendering system.

Alternatively, couldn’t the OpenGL driver implement this functionality
in lieu of hardware accommodations by rendering to an intermediate
buffer – one which is accessible to the downsampling hardware? Would
be quite a bit slower…

Thank you, and I hoped I passed the audition. :slight_smile:

Feel free to take a bow :)On Sun, Nov 30, 2008 at 5:19 PM, Bob Pendleton wrote:


http://codebad.com/