Skip to main content
1 of 6

Is it possible to use a pre-existing texture buffer containing vertex data to initialise a vertex buffer for rendering in openGL?

I'm generating a heightmap in a compute shader in openGL and storing it to a texture.

Lets say I actually store the full vertex data in that texture instead of just the height, which is a trivial change, and that I could easily also create an index buffer in a seperate texture/SSBO at the same time.

Is there a way to use this pre-existing texture/SSBO data to create a vertex and index buffer directly if I made sure the memory layouts were correct?

It seems wasteful to pull the data back from GPU just to copy it to a new vertex array on CPU and then push back to GPU, when I could just get the CPU code to tell the GPU that this data is the vertex array instead and never have the data leave the GPU... But I have no idea how I'd tell openGL to map one to the other.

I've also tried to a google and a search here, but all the suggestions are about something different.