Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have some doubts with multisampled textures.

In fragment shader, how to pass multiple samples?

We use glTexImage2DMultisample instead of glTeximage2D. so, how to upload texture data?

I want to use default FBO for this.

share|improve this question
up vote 0 down vote accepted

It is not possible to directly use a multisampled texture. You have to resolve it to another texture (same format, same size) first.

You can do that by binding the non-multisampled texture and blitting the multisampled one to it with glBlitFramebuffer (you might need to append EXT to function name - use glBlitFramebufferEXT - if you use OpenGL 2).

share|improve this answer
Can you please provide more details? – user1737197 Dec 27 '12 at 13:52
@Roshan More details on what, exactly? – snake5 Dec 27 '12 at 13:56
You mean render to texture? also, what will be the fragment shader for multisampled textures? – user1737197 Dec 27 '12 at 15:34
1) Render to texture - what? Binding a buffer and changing some pixels via draw calls / blitting is "render to texture". Not sure how that changes anything, though. 2) There is no "fragment shader for multisampled textures". Drawing to a multisampled texture generally doesn't require shader changes. And it is not allowed to use a multisampled texture in draw calls. – snake5 Dec 27 '12 at 16:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.