Hello,
first I’ve written a blog entry about this:
http://blog.blackhc.net/2009/07/from-vertex-positions-to-packed-element-arrays/
It’s explaining what I am going to say in more details and with screenshots.
I’m going to paraphrase the general concept here though.
My question is whether this idea is valid and whether I can expect it to continue to work with new drivers (it works on my 8600M GT right now) and if anyone knows something better to achieve the same.
So as the topic says, I want to render primitives without specifying any vertex data but generate everything procedurally using gl_VertexID.
gl_VertexID is only supplied by OGL if you bind a vertex buffer to your vertex array.
I’m using an one-element VBO but render more than one vertex out of it - I pretty much ignore the bounds and if I accessed the vertex information at all it would be an out-of-bounds condition.
My GLSL shader doesn’t access gl_Vertex, so there shouldn’t be a problem.
The actual idea is to specify an element array (which sets gl_VertexID) and encode some vertex data in the element array. The advantage over using a vertex array buffer is that the gfx card should be able to use the vertex cache to minimize shader executions.
Again my question is whether anyone knows a better way to achieve all this and/or if my current method is good or too big a hack.
Thanks in advance.
Cheers,
Andreas