从GLSL获取最后一帧颜色 [英] Get the last frame color from GLSL

查看:168
本文介绍了从GLSL获取最后一帧颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在片段着色器中处理纹理.但是,当前帧应基于最后一帧信息,例如邻居位置.因此,我需要将当前帧写入一个位置/属性/对象,并在下一个循环中读取它.

I want to processing a texture in the Fragment Shader. However, current frame should base on last frame information, such as neighbor positions. So I need write current frame into one place/buffur/object and read it in next loop.

有人可以给我指导我的要求吗?

Can someone give me a direction about my requirement?

推荐答案

使用帧缓冲区对象.创建两个要交替渲染的FBO,每次将另一个绑定为纹理以获取数据.

Use Frame Buffer Objects. Create two FBOs into which you render alternatingly, each time binding the other one as texture for sourcing the data.

这篇关于从GLSL获取最后一帧颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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