Any way Render to VBO directly?

Started by
3 comments, last by FireInDark 11 years, 9 months ago
OK?I know it is possiable to "Render to Texture " or "Render to PBO" and the throw the data to VBO..
But some topics on web told that maybe Render to VBO is the best way ..
Any one can tell how to do with it ?
Advertisement
I'm not the most experienced with this feature, but from what I know:
* You'll find some information by searching for "R2VB" (render to vertex buffer), but AFAIK, R2VB is only possible on certain, old (DX9/GL2?), AMD GPUs.
* On DX10(GL3?) GPUs, you should be able to tell the vertex shader to "stream out" (aka "transform feedback") the transformed vertices to a VBO, instead of rasterising them as triangles/primitives.
* On modern GPUs (DX11/GL4?) there might be a way to render to a texture, but then bind that texture resource as if it were a VBO (i.e. the same GPU memory allocation can be bound as a writeable texel buffer and as a readable vertex buffer), much like R2VB does.
You'll need to look up a feature called "Transform Feedback" in OpenGL. You can disable polygon rasterization and have the output of a vertex shader stored directly in a VBO. This feature was enabled at least as early as 3.3
I have a transform feedback example in my examples: https://github.com/progschj/OpenGL-Examples/blob/master/09transform_feedback.cpp
Sorry for saying thanks so late..
Thanks to all of you ,I will try as you've said ..

I will show the right when it's OK.

This topic is closed to new replies.

Advertisement