Render to texture and multisampling

Is it possible to render to a texture using a frame buffer object and get multisampling? If so, any sample code available?

Thanks in advance.

s.

Is it possible to render to a texture using a frame buffer object and get multisampling?

Yes. Create a multisample texture. See ARB_texture_multisample or GL 3.2.

It depends on what you want. A.R. described the way to render your stuff to special multisampled texture. Reading from such texture requires special processing.

There is also a possibility to render with multisampling enabled (just like you render to Window) but have result in normal texture.

First render you stuff to FBO with multisampled render buffer (glRenderbufferStorageMultisampleEXT)
Then copy this (glBlitFramebufferEXT) to non multisample FBO with texture attachment (e.g. glFramebufferTexture2DEXT)

See:
EXT_framebuffer_multisample
GL_EXT_framebuffer_blit