Bind tangent array?

im curently using vbo’s in my application, and have got shaders working, but seems there is no glTangentPointer,

now im using vbo’s for performance, and dont want to have to manually go a bind a tangent for each vertex when using shaders, surely there must be some way to bind an array to a shader parameter?

some 1 suggested BindAttributeLocation but there aint really much info on this on the net yet.

ideas?

the right solution is VertexAttrib/VertexAttribPointer;

but it is possible to use MultiTexCoord(in fact, it’s just another interface to the same data array)

table from ARB_vertex_program spec:

  
    Generic
    Attribute   Conventional Attribute       Conventional Attribute Command
    ---------   ------------------------     ------------------------------
         0      vertex position              Vertex
         1      vertex weights 0-3           WeightARB, VertexWeightEXT
         2      normal                       Normal
         3      primary color                Color
         4      secondary color              SecondaryColorEXT
         5      fog coordinate               FogCoordEXT
         6      -                            -
         7      -                            -
         8      texture coordinate set 0     MultiTexCoord(TEXTURE0, ...)
         9      texture coordinate set 1     MultiTexCoord(TEXTURE1, ...)
        10      texture coordinate set 2     MultiTexCoord(TEXTURE2, ...)
        11      texture coordinate set 3     MultiTexCoord(TEXTURE3, ...)
        12      texture coordinate set 4     MultiTexCoord(TEXTURE4, ...)
        13      texture coordinate set 5     MultiTexCoord(TEXTURE5, ...)
        14      texture coordinate set 6     MultiTexCoord(TEXTURE6, ...)
        15      texture coordinate set 7     MultiTexCoord(TEXTURE7, ...)
       8+n      texture coordinate set n     MultiTexCoord(TEXTURE0+n, ...)

Try to to following:

  1. in your vertex program define a new verex attribute:
    attribute vec4 vTangent;

  2. BEFORE LINKING do following
    glBindAttribLocationARB(ProgramObject, INDEX, “vTangent”);

  3. Now, tangent will take INDEX position. Use glVertexAttribPointerARB(INDEX, …) to setup your tangent array.

yooyo

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.