glFramebufferTexture2D 性能

发布于 2024-09-05 17:39:54 字数 266 浏览 1 评论 0原文

我正在使用 GPU 进行大量计算,其中涉及大量渲染到纹理操作。这是一个迭代计算,因此需要对纹理进行大量渲染,然后将该纹理渲染到另一个纹理,然后将第二个纹理渲染回第一个纹理,依此类推,每次都将纹理传递给着色器。

我的问题是:对于我想要渲染的每个纹理有一个单独的 FBO 是否更好,或者我应该有一个 FBO 并在每次我想要更改渲染目标时使用 glFramebufferTexture2D 绑定目标纹理?

我的平台是 iPhone 上的 OpenGL ES 2.0。

I'm doing heavy computation using the GPU, which involves a lot of render-to-texture operations. It's an iterative computation, so there's a lot of rendering to a texture, then rendering that texture to another texture, then rendering the second texture back to the first texture and so on, passing the texture through a shader each time.

My question is: is it better to have a separate FBO for each texture I want to render into, or should I rather have one FBO and bind the target texture using glFramebufferTexture2D each time I want to change render target?

My platform is OpenGL ES 2.0 on the iPhone.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

心意如水 2024-09-12 17:39:54

在 iPhone 实现上,假设新旧纹理具有相同的尺寸/格式/等,则更改附件的成本并不高。否则,驱动程序必须执行一些额外的工作来重新配置帧缓冲区。

On the iPhone implementation, it is inexpensive to change the attachment, assuming the old and new textures are the same dimensions/format/etc. Otherwise, the driver has to do some additional work to reconfigure the framebuffer.

背叛残局 2024-09-12 17:39:54

AFAIK,仅使用一个 FBO 并根据需要更改纹理附件即可实现更好的性能。

AFAIK, better performance is achieved by using only one FBO, and changing the texture attachments as necessary.

你对谁都笑 2024-09-12 17:39:54

最好的方法是做基准测试。

The best way is to do benchmark.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文