PDA

View Full Version : ATi vertex attributes aliases in OpenGL



06-28-2006, 04:24 AM
I can't find any documentation about ATi aliases for vertex attributes.

The only aliases I could find were those for nVidia, but for ATi the only thing I know for sure is that index 0 alises for gl_Vertex built-in attribute (from the OpenGL 2.0 specification).

I tried to guess them through RenderMonkey StreamMapping but couldn't even guess the usage of de index combo box... in all examples (those that allow a fast start with simple effects) index always is 0, it doesn't matter if it's a binormal, texcoord or whatever.

Can anyone help me? Are the same as nVidia?

k_szczech
06-28-2006, 04:41 AM
According to specs you can use glBindAttrib to select the location yourself before you link the program. Perhaps ATI supports it and does not have fixed locations for fixed-functionality attributes.
Anyway, to remain NVIDIA compatible you have to link and use glGetAttribLocation anyway, so knowledge of attribute location becomes nearly irrelevant.
If you use hardcoded attribute locations in your application then I suggest redesigning it not to do so.

06-30-2006, 12:53 AM
I'm afraid I don't understand what you mean by having to use glGetAttribLocation for nVidia, because they are documented, so I know that index 0 aliases for gl_Vertex, 2 for gl_Normal and so on.

Anyway it seems that ATi follows the specification, I used GLIntercept with RenderMonkey and tangents and binormals are mapped to indices 3 and 4, which are used for gl_Color and gl_SecondaryColor on nVidia cards... but on the other side in the ATiOpenGL pdf refering to GL_NV_VERTEX_PROGRAM extension ATi claims that the same aliasing is followed to keep compatible with nVidia approach so if anyone has more info about this it will be wellcome.

Thanks a lot

Komat
06-30-2006, 04:00 AM
The best way is to avoid mixing the conventional and the generic attributes and use only the generic or only the conventional ones.