FBO's and Multisampling

Started by
6 comments, last by n00body 14 years, 6 months ago
http://www.opengl.org/wiki/Multisampling This page goes over the standard method of creating a program that detects and enables FSAA under windows, but I can't seem to find any instructions for doing the same on Linux. Can anybody provide me with information on this topic? Also kind of related: what is the difference from FSAA (the type that you force from the driver control panel in windows) vs the ARB Multisample Extension (which i'm hoping one can use to selectively antialias parts of a scene by using glEnable(GL_MULTISAMPLE) or some such)? I've been googling this stuff for hours now and all i've got is a headache. Heres an interesting tidbit: I have a Ubuntu 9.04 VM in Virtualbox on Windows 7 host, and when I put this line
	SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); 
before creating my SDL window, Virtualbox crashes when I run the program. [Edited by - dc443 on November 6, 2009 11:59:45 PM]
Advertisement
OK, well first of all, the ARB_multisample extension is a mess. Try to avoid it if possible. A much better alternative is to use a non-FSAA screen format, together with a multisampled FBO. This is much more flexible, powerful and clean. It's also much easier to setup and use.

That said, I'm not sure if you can get any of this on Linux if it is running under a VM.

So I take it that you are suggesting I use GL_EXT_framebuffer_multisample and GL_EXT_framebuffer_blit in addition to the GL_EXT_framebuffer_object extension... as described in this page: http://blog.dexta.ch/2008/08/27/gl_ext_framebuffer_object-with-multisampling/

(btw how do you do hyperlinks on this forum?)

How does this method compare to "the other ways" of doing multisampling? Is this separate from the settings that you force in the display drivers?
Quote:Original post by Yann L
OK, well first of all, the ARB_multisample extension is a mess. Try to avoid it if possible. A much better alternative is to use a non-FSAA screen format, together with a multisampled FBO. This is much more flexible, powerful and clean. It's also much easier to setup and use.

That said, I'm not sure if you can get any of this on Linux if it is running under a VM.


VirtualBox has Pretty decent OpenGL support (OpenGL 2.0 was fully supported in VB 3.0 including GLSL support (On Linux, Windows and Solaris guests atleast)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Quote:Original post by dc443
So I take it that you are suggesting I use GL_EXT_framebuffer_multisample and GL_EXT_framebuffer_blit in addition to the GL_EXT_framebuffer_object extension...

Yep. Or use ARB_framebuffer_object, which includes all three extensions in one.

Quote:Original post by dc443
How does this method compare to "the other ways" of doing multisampling? Is this separate from the settings that you force in the display drivers?

It's separate, since FBOs are independent render targets. You choose the multisampling level and config separately for each FBO (although you can share attachments). You can even have several FBOs with different MS settings in use simultaneously, within the same application.

The settings on the driver page will only change the AA config of your main framebuffer, ie. the one that is eventually displayed on the screen. This one is independent of any FBO you create.

In practice, your screen framebuffer would be non-multisampled. You do all your rendering into a MS FBO, resolve it (possibly using a customized resolve shader, if needed) and copy it onto the non-AA'ed screen framebuffer.

Quote:Original post by dc443
(btw how do you do hyperlinks on this forum?)

Standard HTML link tags.
Thanks for the quick replies! :)

How does the performance of this multisampled FBO method compare with traditional methods?

As I understand it, I need to render to a multisampled FBO, then blit it into another FBO attached to a texture, and then render that texture as a full screen quad. This seems like doing so much extra work. Drawing a full screen texture quad always felt like a big hack to me.

How is support for this from ATI? I saw some Nvidia charts indicating that the FBO extensions are supported for the hardware that is capable of it with recent drivers, but I don't know about ATI.
Quote:Original post by Yann L
OK, well first of all, the ARB_multisample extension is a mess. Try to avoid it if possible. A much better alternative is to use a non-FSAA screen format, together with a multisampled FBO. This is much more flexible, powerful and clean. It's also much easier to setup and use.

That said, I'm not sure if you can get any of this on Linux if it is running under a VM.


Hehehe. That's an interesting idea.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
As far as I know, you can just blit straight to the back-buffer.

[Hardware:] Falcon Northwest Tiki, Windows 7, Nvidia Geforce GTX 970

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework

This topic is closed to new replies.

Advertisement