PDA

View Full Version : Render to texture and multisampling



sdrouin
09-28-2009, 09:14 AM
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.

Alfonse Reinheart
09-28-2009, 10:31 AM
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.

mfort
09-28-2009, 12:22 PM
Is it possible to render to a texture using a frame buffer object and get multisampling? If so, any sample code available?

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