如何在多采样纹理上渲染帧缓冲对象? [英] How to render Framebuffer Objects on multi-sampled textures?

查看:167
本文介绍了如何在多采样纹理上渲染帧缓冲对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个渲染引擎,它使用多次遍历,其中将图像的各个部分渲染在纹理上,然后使用着色器进行组合.它可以工作,现在我想激活多重采样.

I currently have a rendering engine using multiple passes in which various parts of the image are rendered on textures, and then combined using shaders. It works, and now I would like to activate multi-sampling.

我在这里阅读( http://www.opengl.org/wiki/Framebuffer_Object_Examples#MSAA ),使用OpenGL,您不能将GL_TEXTURE2D_MULTISAMPLE附加到帧缓冲区对象.

I read here ( http://www.opengl.org/wiki/Framebuffer_Object_Examples#MSAA ) that, with OpenGL, you can't attach a GL_TEXTURE2D_MULTISAMPLE to a framebuffer object.

似乎使用多重采样的一种方法仍然可以访问结果,因为纹理是使用多重采样的渲染缓冲区,然后将结果复制到多重采样纹理中.

It seems one way to use multi-sampling and still have access to the result as texture is to use a multi-sampled render buffer, and then copy the result into a multisample texture.

我的问题是:前进的最佳方法是什么?

My question is: what would be the best way to go forward?

  • 是否可以在渲染缓冲区中渲染并在我的着色器中使用输出,而无需复制到纹理中?
  • 我是否真的应该将缓冲区的内容复制到纹理中,然后使用它?
  • 还有另一个更好的解决方案吗?

谢谢.

推荐答案

我在这里阅读( http://www.opengl.org/wiki/Framebuffer_Object_Examples#MSAA ),对于OpenGL,您无法将GL_TEXTURE2D_MULTISAMPLE附加到帧缓冲区对象.

I read here ( http://www.opengl.org/wiki/Framebuffer_Object_Examples#MSAA ) that, with OpenGL, you can't attach a GL_TEXTURE2D_MULTISAMPLE to a framebuffer object.

再次阅读.它没有提到GL_TEXTURE_2D_MULTISAMPLE纹理.实际上,我对此表示赞同:不要再次阅读该页面.如果您希望获得良好的FBO信息,请阅读有关帧缓冲对象的页面,该页面说明了3.x的行为.您链接到的页面较旧.

Read it again. It says nothing about GL_TEXTURE_2D_MULTISAMPLE textures. Actually, I take that back: don't read that page again. If you want good FBO info, read the page on Framebuffer Objects that explains 3.x behavior. The page you linked to is old.

在EXT日子里,您所拥有的只是多采样渲染缓冲区,因为不存在多采样纹理.您可以创建多采样缓冲区,但是不能使用它们纹理.你只能把它们烧死.

Back in the EXT days, all you had were multisampled renderbuffers, because multisample textures didn't exist. You could create multisampled buffers, but you couldn't texture with them. You could only blit them.

在3.3 OpenGL中,您可以创建多采样纹理.而且,您可以像将其他纹理一样将它们附加到FBO.

In 3.3 OpenGL, you can create multisampled textures. And you can attach them just like any other texture to an FBO.

这篇关于如何在多采样纹理上渲染帧缓冲对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆