Results 1 to 10 of 10

Thread: glVertexAttribPointer indices?

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2006
    Posts
    160

    glVertexAttribPointer indices?

    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

  2. #2
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,107

    Re: glVertexAttribPointer indices?

    This is for NVIDIA:

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

    Go to page 15 of this document.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Mar 2006
    Posts
    160

    Re: glVertexAttribPointer indices?

    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?

  4. #4
    Senior Member Frequent Contributor Mars_999's Avatar
    Join Date
    Mar 2001
    Location
    Sioux Falls, SD, USA
    Posts
    519

    Re: glVertexAttribPointer indices?

    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.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Mar 2006
    Posts
    160

    Re: glVertexAttribPointer indices?

    I see, just a quick question, is overwriting indices 8-15 with glVertexAttribPointer(8-15) is allowed? or we must use glTexCoordPointer?

  6. #6
    Senior Member Frequent Contributor Mars_999's Avatar
    Join Date
    Mar 2001
    Location
    Sioux Falls, SD, USA
    Posts
    519

    Re: glVertexAttribPointer indices?

    I haven't tried it, but why not use opengl's *Pointer functions they are easy to use already...

  7. #7
    Senior Member Regular Contributor
    Join Date
    Mar 2006
    Posts
    160

    Re: glVertexAttribPointer indices?

    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…

  8. #8
    Senior Member Frequent Contributor
    Join Date
    May 2005
    Location
    Prague, Czech Republic
    Posts
    913

    Re: glVertexAttribPointer indices?

    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.

  9. #9
    Senior Member Regular Contributor
    Join Date
    Mar 2006
    Posts
    160

    Re: glVertexAttribPointer indices?

    Code :
    ATI hw they are likely independent
    smart ati... that is how it should be done...

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

    thx for your post komat!

  10. #10
    Senior Member Frequent Contributor
    Join Date
    May 2005
    Location
    Prague, Czech Republic
    Posts
    913

    Re: glVertexAttribPointer indices?


    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.

Similar Threads

  1. glVertexAttribPointer
    By sajis997 in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 01-30-2015, 07:44 AM
  2. glVertexAttribPointer
    By artariel in forum OpenGL: Basic Coding
    Replies: 14
    Last Post: 05-02-2012, 09:16 PM
  3. only using glVertexAttribPointer
    By FryderykC in forum OpenGL: GLSL
    Replies: 3
    Last Post: 02-15-2010, 03:56 PM
  4. glVertexAttribPointer or.. ?
    By Spongebob in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-31-2008, 01:45 PM
  5. glVertexAttribPointer
    By Hylke Donker in forum OpenGL: General
    Replies: 4
    Last Post: 06-26-2006, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean