Per vertex attribute to vertex program

I cannot find a way to pass custom per-vertex Vector2f attribute to a shader program. Mesh seems to support only predefined types of VertexBuffers, which are placed into predefined slots inside vertext programs.

For my specific usage, I might probably misuse second texture coordinates, as I need only one ‘real’ texture, but it seems to be a bit hacky (and I might need Vector3f at some point). Is there an elegant way to do this?

The types of attributes do not matter, you can pass an int or a vec2 or whatever as any parameter. You can use TexCoord2 in your case.


I’m uping this (quite old) topic because i have exactly the same “problem” : i want to pass an attribute which is not related to the existing ones.

I know i could use one of the numerous “texCoord” attribute, but it feel a bit dirty to do that.

Is there a way to pass custom attribute to a mesh with a custom name (like i used to do in shaders before) ?

Thanks in advance,


Nope. Get dirty.