1

I have an OpenGL texture that I generate through a couple of render passes in my FBO.
Now I want to use the texture as vertex data in a VBO and render stuff with it.
Since all data is GPU-sided, is there an efficient way to transfer (or re-interpret) texture data as vertex data in OpenGL?

Or do I have to go all the way through the CPU with

// ... generate texture on GPU.
glReadBuffer(..where the texture is..);
glReadPixels(..., mainMemoryBuffer);
glBufferSubData(GL_ARRAY_BUFFER, ..., mainMemoryBuffer);

? Or is there another way to achieve what I want?

4

1 回答 1

0

好的。经过更多研究后,似乎 PBO(像素缓冲区对象)是启用此功能的 OpenGL 功能:

glBindBuffer(GL_PIXEL_PACK_BUFFER, myVbo);
glReadPixels(..., 0);

不幸的是,它们似乎在 OpenGL ES 上不可用(请参阅 GameDevelopment 上的这个线程)。

于 2012-09-25T14:19:55.587 回答