PDA

View Full Version : setting attribute value



Beau
11-10-2006, 02:47 AM
Hi,

I'm building an anisotropic shader so I need to set the tangent and binormal vector for each vertex but when I set the binormal like this:



GLint BLoc = glGetAttribLocation(*sp,"B");
glVertexAttrib3f(BLoc, b.x,b.y,b.z);
I get glitches, even when I don't use the attribute value in my shader at all.

What could be wrong?

Thanks,
Beau

k_szczech
11-10-2006, 02:57 AM
"glitches" - sorry, I don't know this word. I'll just assume you have performance issues.
You should use glGetAttribLocation only once, after you link your shader. Locations don't change unless you re-link shader.

Beau
11-10-2006, 03:05 AM
I figured it out...shouldn't call glGetAttributeLocation within glBegin