[SOLVED] glBindAttribLocation and NVidia

Started by
2 comments, last by idinev 14 years, 4 months ago
Does NVidia's drivers still not allow you to use the indices for old built-in vertex attributes? From: http://developer.download.nvidia.com/opengl/glsl/glsl_release_notes.pdf If so... doesn't this make glBindAttribLocation kinda useless? I would really like to have all 16 of my vertex attributes and be able to reference them with my own names... WTF NVidia? [Edited by - Scienthsine on December 2, 2009 5:52:44 PM]
Advertisement
I think you're misunderstanding. There is only a problem if you actually use the old built-in name, and at the same time try to bind your own name to the same index.
Quote:For example, you should not use gl_Normal (a built-in vertex attribute) and also use glBindAttribLocation to bind a generic vertex attribute named “whatever” to vertex attribute index 2 because gl_Normal aliases to index 2.
...
The compiler will automatically assign vertex shader attribute variables not pre-assigned by glBindAttribLocation to locations that do not collide with any built-in attribute variables used by the vertex shader. The assigned locations can be queries with glGetAttribLocation. This means that a developer only needs to worry about collisions when they are explicitly requesting an attribute to be bound to a specific location.
Ohhhhhhhh ok!

I think this tutorial has the wrong idea then: http://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/attributes.php

I felt that they were saying that those indices are reserved for built-ins only.
You just misinterpreted it :) . It really basically reads "If you use gl_Normal, it takes slot 2 and no other". It's a limitation of GF6x00 and GF7x00.

This topic is closed to new replies.

Advertisement