I ve been reading OpenGLĀ® Shading Language, Second Edition... and its says for Uninforms variables:

All data types and arrays of all data types are supported for uniform qualified variables.My concern is this... we can sending a vector3 no problem... but what about an array of vector3... like sending Tangents to the shaders...

void glUniform3iv(GLint location, GLsizei count, const GLint *value)

the part im confused about is the *value, do I send someting like Tangent[0] as value?

thx

V-man

06-14-2006, 06:37 PM

Tangents are vertex attributes so you should send them as an array. Put them in your VBO along with your vertex position, normal, texcoord, ...

If you insist on doing it your way, then the call is

glUniform3iv(GLint location, X, &Tangent[0][0]);

where
GLint Tangent[X][3];

In your GLSL, you should have

uniform ivec3 Tangent[X];

Golgoth

06-14-2006, 07:12 PM

Tangents are vertex attributes so you should send them as an array. Put them in your VBO along with your vertex position, normal, texcoord, ...interesting, even though VOB are up and running, im not familiar with adding extra vertex attributes yet... I suppose it would be through glGetVertexAttribPointerv is that correct?

how would I send/retrieve them(the tangents) to/in the shader now? I m sorry, it must be super simple... but im not quite sure.

thx

V-man

06-15-2006, 11:26 AM

If you are using generic vertex attributes, then it's just another call to glVertexAttribPointer