GL_EXT_framebuffer_multisample

Hm… yes, actually it disables multisampling. I thought it should not…

Take a closer look to the picture, is it AntiAliased or not?

On our machines the MSAA never switches off completely.

Yes, it is not antialiased.
Here are three files which I get when I put glDisable(GL_MULTISAMPLE) before glBegin call: http://www.box.net/shared/l2p0yh9p3p

Here are mangified fragments of these files: http://img201.imageshack.us/img201/953/msaa.png

There are two pieces to MSAA/CSAA. One is the multisample “rasterization”. The other is the multisample “downsample filtering”. From what I’ve seen, glDisable(GL_MULTISAMPLE) only switches off the former, not the latter, which seems to be a function of the rendering surface you’ve allocated.

See this past post for images.

Hi Dark Photon,

I saw the images of the post you provided (they show exactly what I am talking about). Do you confirm that on NVidia GPU using CSAA is a better choice and the only way to disable FSAA using gl.Disable(GL_MULTISAMPLE_EXT)?

We saw some samples searching the net that provide MSAA code for ATI and CSAA for NVidia. This way you can enable/disable corectly the AntiAliasing.

Thanks,

Alberto

martinism,

I see in your example you are using GL_RGBA8, can the reason be that we are trying to read a RGB and not RGBA bitmap?

Is RGBA mandatory in this case?

Thanks,

Alberto

It doesn’t matter. I changed everything to 3 components (GL_RGB8, GL_BGR, …). Nothing changed - msaa still works, and can be turned off with glDisable.

You are right, studing your code and rewriting ours now we managed to get RGB and AntiAliased bitmaps.

THANKS SO MUCH.

The only open issue remains the antialiasing not switching on completely on MSAA. In your program is impossible to see because in this case we need to see the viewport not only to generate a raster image.

Thanks again,

Alberto

I haven’t tried that. However, AFAIK how downsampling is done by vendors is <u>not</u> standardized at all, so capitalizing on what you’re seeing could break the next driver version…

Best to use a single-sample FBO if you don’t want any MSAA/CSAA/SSAA.

Sorry Dark Photon,

I don’t understand your post. We need a way to have full screen antialising on and off. As you reported in the post you referenced above, there is no way to disable it completely on NVidia geForce.

What’s wrong in using CSAA for NVidia and MSAA in ATI?

Thanks,

Alberto

Nothing. Feel free. HOWEVER, your argument for using CSAA on NVidia over MSAA was simply that you don’t get any apparent antialiasing effects when you disable multisample rasterization. But how they do the downsampling could change the next driver version, which would hit you if you’re still rendering to a multisampled framebuffer. They could change their filter taps and you’re hosed. Besides CSAA limits you to GeForce 8+.

I didn’t say that. What I said is that glDisable( GL_MULTISAMPLE ) apparently doesn’t do it if your framebuffer is multisampled.

You could always reallocate the window to have the correct number of samples when switching AA on/off. You could also render to FBO (single or multisample as needed for AA) and blit that to the window when done.

Ok, thanks. BTW do you know exacly the difference between CSAA and MSAA and why with MSAA on NVidia you get a ‘residual’ antialiasing when you magnify the viewport contents?

Thanks again,

Alberto

Not first-hand (I don’t work for NVidia ;-), but from what I’ve read, CSAA and MSAA are fundamentally the same thing. The only catch is that with MSAA you have a separate color “value” per subsample (e.g. 4X MSAA = 4 RGBA colors per pixel), and with CSAA you store a color “index” instead (4X MSAA = 4 color indices). These indices look up into a per-pixel color table which is smaller than the number of samples (e.g. 4X CSAA might have say maximum 2 color values per pixel in that color table, and each of the 4 subsamples could have a color index of 0 or 1).

This saves memory space and bandwidth. It works just as good as MSAA in nearly all cases (when the color table doesn’t overflow). But it fails when more colors are needed to represent the subsample colors than space exists for in the per-pixel color table (e.g. where you have a number of edges running through a single pixel, and thus you prob need more than a few subsample colors).

and why with MSAA on NVidia you get a ‘residual’ antialiasing when you magnify the viewport contents

AFAIK, that’s totally an NVidia-driver-internal-behavior thing.

It appears when multisample rasterization is disabled with MSAA, they don’t disable MSAA downsample filtering, and the filter taps for a pixel touch samples in adjacent pixels.

Why this same thing doesn’t happen for CSAA is NVidia-internals as well. Maybe they are disabling downsample filtering with rasterization in CSAA but not MSAA. Maybe they’re not but just using a different filter kernel in CSAA than in MSAA that doesn’t have taps in the samples for adjacent pixels. Who knows.

We’re in the land of vendor- and driver-specific behavior. I say driver for a number of reasons, not the least of which is a few months back NVidia totally changed their FSAA mode linup in their drivers. You don’t want to do something that makes you dependent on vendor or driver-specific oddities.

Thanks so much again Dark Photon, your explanation is perfect!