无蓄积缓冲OpenGL的运动模糊 [英] OpenGL motion blur without accumulation buffer

查看:881
本文介绍了无蓄积缓冲OpenGL的运动模糊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现的真正的使用OpenGL运动模糊,但不累加缓冲器(由于它不工作我的显卡)。这是我的想法的实现:

I'm trying to implement a real motion blur using OpenGL, but without the accumulation buffer (due to it not working on my graphics card). Here is my idea for the implementation:

  • 有(临时)空白帧缓冲区和放大器的固定阵列;材质为每一个模糊
  • 新帧时遇到,将第一个元素进行到底,并作出的的帧缓冲,而不是
  • 渲染所有这些,第一帧具有1 / N 的不透明性,第二个具有1 /(的 N 的/ 2),等...具有最新的一个,直至1
  • Have a fixed array of (temporarily) blank framebuffers & textures for each "blur"
  • Whenever a new frame is encountered, move the first element to the end, and render to that framebuffer instead
  • Render them all, first frame having 1/n opacity, second one having 1/(n / 2), etc... until the newest one having 1.

有没有更简单/更快/更优化的方式比这个?或者,这是最好的解决办法?

Is there any simpler/faster/more optimized way than this? Or is this the best solution?

推荐答案

什么NicolBolas说,在他的评论是正确的:为了得到真正的运动模糊必须应用这是由每个片段的速度控制向量模糊;计算每个顶点的屏幕空间速度,并传递作为另一均匀到片段着色器。然后应用矢量模糊的方向和距离的片段的速度。

What NicolBolas says in his comments is correct: To get real motion blur you must apply vector blur which is controlled by each fragment's speed; calculate the screen space speed of each vertex and pass that as another uniform to the fragment shader. Then apply a vector blur in the direction and distance of the fragment's speed.

由于这将与你结束了与透明度排序的问题,其他的片段模糊。因此,你应该将此作为一个后处理效果,最好与深度层剥离。您可以保存在深度使用$ P $积压pviously渲染的帧排序的复杂性融入,这基本上是你建议的帧缓冲方法,添加了矢量模糊。

Since this will blur with other fragments you're ending up with a problem of transparency ordering. Hence you should apply this as a post processing effect, ideally with depth peeled layers. You can save on the depth sorting complexity by using a backlog of previously rendered frames to blend into, which is essentially the framebuffer method you suggested, with vector blur added.

这篇关于无蓄积缓冲OpenGL的运动模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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