-
Generic vertex attributes
Can anyone tell me how to access generic vertex attributes with the GLSL. The spec only mentions standard attributes.
-
Re: Generic vertex attributes
// Get the attribute index for the
// monkey parameter
monkeyAttrib = glGetAttribLocationARB(myVertexProgram, "monkey");
glVertexAttribPointerARB(monkeyAttrib, 1, GL_FLOAT, GL_FALSE, 1234, monkeyData);
http://www.3dlabs.com/support/develo...ocationARB.htm http://www.3dlabs.com/support/develo...PointerARB.htm
-
Re: Generic vertex attributes
I understand how to set generic attributes. I just don't know how to get at them from within a vertex shader.
For example, to get the normal, I can use gl_Normal, but how do I get attribute 6?
-
Re: Generic vertex attributes
Scratch that. I see what you mean. There's no way to access a specific attrib because the GLSL determines the number for me. Thanks!
-
Re: Generic vertex attributes
You can tell GLSL which attrib index you want a given variable to have using glBindAttribLocationARB().
http://www.3dlabs.com/support/develo...ocationARB.htm
-
Re: Generic vertex attributes
That's useful. I should really RTFM at some point. I hadn't realised 3DLabs' documentation was so good. Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules