How to send attribute arrays

Browsing the net I found glEnableVertexAttribArrayARB but that’s not really what I need… From what I’ve understood and tested it’s used jointly with vertex arrays.

But what I need is to send, vertex per vertex, an array such as:

[vertex shader]
attribute vec3 TexCoords[4];

How can I send that from C++ ?

GLSL doesn’t support attribute arrays.
See issue 75 in the GLSL specs.

What you need is four vertex arrays with texture coordinates in your application and four attributes in the vertex shader sourcing them.

Thanks… so bad I have to decompose it.

uhm… im not sure, but try:

attribute mat4 MyMatrix;

yooyo

Still needs four (now continuous!) attribute arrays on OpenGL API side, because OpenGL attribs are maximum vec4.
If you’re concerned about decomposing into different memory locations on app side, that’s not a problem. Vertex arrays have a stride parameter, so you can interleave the data in memory.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.