Doing really well on an OpenGL 3.1 shader supported wrapper, but before I go any further I have some questions about the OpenGL 3.1+ and GLSL #version 150 design. I’m familiar with the current (and outdated) GLSL Red Book and Orange Book.
Question #1: Assumption: As far as getting information to and from GLSL via ‘in’ variables using glDrawElements, glDrawArrays ect and the like, we have only the glVertexAttribPointer
Is this true?
(rephrase: the only way to set variables when the draw functions are called are to set varriable ids to be linked by glVertexAttribPointer)
Question #2: Assumpion: glVertexAttribPointer is ONLY able to retrieve data from the VBO, or Vertex Buffer Objects set by glBufferData(GL_ARRAY_BUFFER, sizeof(your_data), your_data, DRAW_MODE). There is no way to make it draw from other arrays like the GL_ELEMENT_ARRAY or some generic data buffer?
True or false?
(rephrase: when using glDrawElements ect, the variables automatically set by their glVertexAttribPointer bindings can ONLY draw from the GL_ARRAY_BUFFER);
IS THE FOLLOWING TRUE:
If i wish to obtain and update in variables in my GLSL shader programs when using draw calls like glDrawElements, all of the information I wish to obtain must be packed in the GL_ARRAY_BUFFER.
Here’s the situation, My shaders all work with my new drawing system, however I’m looking to draw from an index (GL_ELEMENT_ARRAY_BUFFER) to a vertex buffer. It needs to pass info from the vertex specified by the index, and the texture coords of that vertex. (there’s more but coords are all I need for the example)
Because the above is true, I need to pack texture coord data, and anything else I want updated and passed into the GL_ARRAY_BUFFER via some sort of interleaved array correct?
Thanks for the help, I need to understand this limitation before I design an array to hold the data I need.