سؤال

I'm using OpenTK and C#. I'm rendering to a renderbuffer and I need to copy it's contents(ColorAttachment0) to a Texture2D so I can do some post-processing on it, and the draw it to the screen. How do I do this? I would use texture instead of a renderbuffer, but I need to Anti-alias the framebuffer, and using GL.RenderbufferStorageMultisample is the only way I know how to.

هل كانت مفيدة؟

المحلول

Just create another FBO and attach the texture to it. Bind the multisampled FBO to GL_READ_FRAMEBUFFER and the texture FBO to GL_DRAW_FRAMEBUFFER. Then call glBlitFramebuffer with the correct parameters. This will copy and resolve the samples to make non-multisampled data, and output it to the texture.

If you want to resolve the samples directly, you can use the GL_ARB_texture_multisample extension.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top