Multisample Texture

From OpenGL Wiki
Jump to navigation Jump to search

A Multisample Texture is a Texture that can have multiple samples per pixel. This allows them to be used as multisample render targets and also as source data for shaders.

As you would use glTexImage2D , here we can use glTexImage2DMultisample. Primary use is for creating Frame buffers and providing them support for multi sampling:

       glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, t);
       glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGB, w, h, GL_TRUE);

Now you may use this texture with your Frame buffer object:


Similar functions are provided for using multisample render buffer with your frame buffer: e.g.: glRenderbufferStorageMultisample

You may use glBlitFramebuffer to copy this Frame buffer to any regular frame buffer.