Setting attribute value


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?


“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.

I figured it out…shouldn’t call glGetAttributeLocation within glBegin

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