PDA

View Full Version : vertex attrib clarification



zed
10-03-2006, 01:00 PM
hangon, before i remove my fixed pipeline stuff

now with nvidia i can do the following

#define VA_INDEX_VERTEX 0
glSetVertexAttribArray( VA_INDEX_VERTEX, ....

which is sweet, but i vaguely remember for ATI that they dont have fixed indexs for the various attribs eg color/vertex/tc0

thus i will have to do something like
glSetVertexAttribArray( this_shaders_vertice_index,
which is a lot more work + frankly a PITA

is this true or are my fears unfounded?
ta zed

Komat
10-03-2006, 01:39 PM
The generic vertex attribute 0 is defined by standard to be equivalent to standard glvertex. Actually you must bind something to generic attribute 0, otherwise the rendering might not happen (there was thread about that some time ago).

RickA
10-03-2006, 11:49 PM
As Komat mentioned, I had that problem a few weeks ago. I was not binding anything to 0, thus causing the program to render incorrectly on ATI cards.

On those cards you need to specify before linking which attribute will go into slot 0. However, you are correct, fixed function attributes aren't guarenteed to be at specific places. They happen to be on nVidia cards, but the spec doesn't specify it, so it'd be unwise to rely on that.

zed
10-04-2006, 11:55 AM
ok cheers esp komat for the other thread as well,
FWIW im having second thoughts about using vertex attributes they seem to occur few benifits for a lot more hassle