PDA

View Full Version : glVertexAttribPointer indices?



Golgoth
06-24-2006, 03:22 PM
Hi all!

Im using glVertexAttribPointer and I do not want to overwrite any of the standard indices... I cant find any information on this so far... like a table of who use what and the available indices... ring a bell?

thx

k_szczech
06-24-2006, 04:47 PM
This is for NVIDIA:

http://developer.nvidia.com/object/nv_ogl2_support.html

Go to page 15 of this document.

Golgoth
06-24-2006, 05:28 PM
thank you!

so refering to this:

vertex attribute index
gl_Vertex 0
gl_Normal 2
gl_Color 3
gl_SecondaryColor 4
gl_FogCoord 5
gl_MultiTexCoord0 8
gl_MultiTexCoord1 9
gl_MultiTexCoord2 10
gl_MultiTexCoord3 11
gl_MultiTexCoord4 12
gl_MultiTexCoord5 13
gl_MultiTexCoord6 14
gl_MultiTexCoord7 15

1,6 and 7 are free... which leaves only 3 generic attributes to send to glsl shader?

Mars_999
06-24-2006, 06:55 PM
Correct you can only have 16 total currently. But you can send data in as secondary color, texcoord 1-7 fog any of them, you just don't get to name more than 16. So you can upload your data into secondary color for tangents and fog for bitangents if you want and access them in the VS to do calculations.

Golgoth
06-24-2006, 07:29 PM
I see, just a quick question, is overwriting indices 8-15 with glVertexAttribPointer(8-15) is allowed? or we must use glTexCoordPointer?

Mars_999
06-24-2006, 10:53 PM
I haven't tried it, but why not use opengl's *Pointer functions they are easy to use already...

Golgoth
06-24-2006, 11:33 PM
I find glVertexAttribPointer even easier... unfortunately, I need all of the standard pointers... I already filled 1,6 and 7... at first I saw 16 vertex attributes can be sent to shaders, I was like, yes yes yes... I turn around and I get punched in the stomach... 13 of them are already reserved… honestly, I m getting fade up being in a tight closet… can anyone tell me why cant we send 64 vertex attributes plus the 13 standard ones if we need to? what is so hard about this? glVertexAttribPointer is used only for 1, 6,7 indices… seriously… someone fell asleep on the drawing board there…

Komat
06-25-2006, 05:08 AM
I see, just a quick question, is overwriting indices 8-15 with glVertexAttribPointer(8-15) is allowed? or we must use glTexCoordPointer? You can use glVertexAttribPointer or corresponding glTexCoordPointer. You can not however use both simultaneously on current nVidia OGL implementation. The same is true for other "conflicting" pairs.

The current nVidia hw aliases conventional attributes with the generic one while on the ATI hw they are likely independent. The older shader extension, the ARB_vertex_program, which also uses the glVertexAttribPointer, allowed aliasing between attributes to acomodate both hw behaviours. The GLSL specification now requires that there is no aliasing however since some of the entry points are used by more than one extension, the nVidia may have some problem with implementing that.

Golgoth
06-25-2006, 10:15 AM
ATI hw they are likely independentsmart ati... that is how it should be done...

16 + 13(std) attributes... is that what you meant?

thx for your post komat!

Komat
06-25-2006, 02:15 PM
16 + 13(std) attributes... is that what you meant?
Theoretically yes. Practically is is possible that vertex processing will fall to the SW emulation once you hit some number of simultaneously used attributes. You will need to try that, I never used that many simultaneous attributes.