Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

1 Answer 1

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
1  
@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

 
discard

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.