平民程序 - linghuye's blog

天下风云出我辈,一入江湖岁月催。皇图霸业谈笑中,不胜人生一场醉。提剑跨骑挥鬼雨,白骨如山鸟惊飞。尘事如潮人如水,只笑江湖几人回。

随笔 - 221, 文章 - 0, 评论 - 680, 引用 - 0
数据加载中……

Render To Vertex Buffer理解和使用

It simply adds two new targets to which buffer objects can be bound: GL_PIXEL_PACK_BUFFER and GL_PIXEL_UNPACK_BUFFER.  When a buffer object is bound to the GL_PIXEL_PACK_BUFFER target, commands such as glReadPixels pack (write) their data into a buffer object. When a buffer object is bound to the GL_PIXEL_UNPACK_BUFFER target, commands such as glDrawPixels and glTexImage2D unpack (read) their data from a buffer object.

A buffer initially filled with vertex data can be bound to one of the pixel buffer targets and used for pixel operations and vice versa. You would render an image using some shader and read back the data from the color buffer into a PBO using glReadPixels(), and the use this buffer as a source for vertex data.

Reference:
More OpenGL Game Programming

posted on 2008-02-05 10:42 linghuye 阅读(1642) 评论(0)  编辑 收藏 引用 所属分类: 3D图形学研究

只有注册用户登录后才能发表评论。