In reading the new OpenGL blubook Version 5, there is a section on Transform feedback which is based on using a Texture buffer object with data from a vertex buffer object. The code online does not exist so I went thru and coded this up myself. The book used
in vec3 positions; in the vertex shader and correspondingly I
set it with glVertexAttribPointer(index_Rcm, 3, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0) ); but when I glTexBuffer(GL_TEXTURE_BUFFER,GL_RGBA32F,attribute); I can never get this code to work.
in vec3 positions;
...
glVertexAttribPointer(index_Rcm, 4, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0) );
..
glTexBuffer(GL_TEXTURE_BUFFER,GL_RGBA32F,attribute);
If I replace everything with vec4 ie
in vec4 positions;
...
glVertexAttribPointer(index_Rcm, 4, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0) );
..
glTexBuffer(GL_TEXTURE_BUFFER,GL_RGBA32F,attribute);
it works as expected.
I then read deeper into glTexBuffer and took note of the table (for floats)
Component
Sized | Internal Format |Base Type Components| Norm| 0 1 2 3
-----------------------------------------------------------------
GL_R32F float 1 NO R 0 0 1
GL_RG32F float 2 YES R G 0 1
GL_RGBA32F float 4 NO R G B A
Does this mean that texture buffer objects can only alias a vertex buffer object with stride of 1,2,or 4 (ie stride of 3 not possible)?