Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: bind tangent array?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Feb 2004

    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.


  2. #2
    Junior Member Regular Contributor
    Join Date
    Nov 2002
    Kiev, Ukraine

    Re: bind tangent array?

    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:
    Code :
        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, ...)
    Andrey Yaromenok

  3. #3
    Advanced Member Frequent Contributor yooyo's Avatar
    Join Date
    Apr 2003
    Belgrade, Serbia

    Re: bind tangent array?

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts