PDA

View Full Version : How to render to texture with antialias?



muratmat
01-02-2006, 06:29 AM
I have the need to render 2D shapes on a texture (lets say offline buffer).
Are some forms of antialias available on render to texture techniques?
What could be the best solution? PBuffer, FBO or other? Is fsaa supported on those buffers?

Thanks in advance.
Turbo - www.amanith.org (http://www.amanith.org)

Mikkel Gjoel
01-02-2006, 06:50 AM
AA on FBO is a very new extension:
http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_multisample.txt

IIRC multisample is available on pbuffers. An alternative is to render into your framebuffer (e.g. the backbuffer), and copy the antialiased result to a texture.

ChiefWiggum
01-04-2006, 12:58 PM
Yep, its a new extension, only available on Radeon X1800 level cards at the moment, as far as I know.

If you create a multisampled pbuffer though, you cant bind it to a texture. You'll have to glCopyTexSubImage it from the pbuffer into a texture.

Also, I think no cards support multisampled floating point textures yet!

def
01-05-2006, 01:34 AM
You will not get a clean copy of your multisampled framebuffer on NVidia cards using glCopyTexSubImage()...
This seems to be a bug. So, if you need the multisampled quality, glCopyTexSubImage() is not going to help.

Claytonious
01-06-2006, 06:26 PM
You will not get a clean copy of your multisampled framebuffer on NVidia cards using glCopyTexSubImage()...
This seems to be a bug. So, if you need the multisampled quality, glCopyTexSubImage() is not going to help.It's working perfectly on a few different nvidia cards here. Sorry, def, I think your app has a bug, not nvidia.

To the original poster, just render your scene normally with antialiasing on and then use glCopyTexSubImage to grab it as a texture. glCopyTexSubImage is really fast these days.

def
01-08-2006, 03:50 AM
Claytonious, if you are talking about Quadro cards, yes, supposedly the copy works flawlessly on those cards, but not on "game oriented" geforce cards.
If you have different experiences I would be very interested in hearing about them!
Thanks

Claytonious
01-08-2006, 04:34 PM
Hi, Def. Yes, it is working fine on a Geforce 6600 and on a Geforce 5200, among some other nvidia cards (I don't have specs on all of our beta testers, but at least a handful of them have "game class" nvidia cards).

And, of course, it's working fine on the ATI cards, too.

V-man
01-08-2006, 07:13 PM
Originally posted by Mikkel Gjoel:
AA on FBO is a very new extension:
http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_multisample.txt

IIRC multisample is available on pbuffers. An alternative is to render into your framebuffer (e.g. the backbuffer), and copy the antialiased result to a texture.I think there is some issue of hw limit here but in principle, p-buffer render to texture (RTT) allows AA.
Old cards can't do RTT AA.

You should be able to enable primitive AA.
glEnable(GL_LINE_SMOOTH) or
glEnable(GL_POINT_SMOOTH) or
glEnable(GL_POLYGON_SMOOTH)