Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glVertexAttribPointer or.. ?

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2008
    Posts
    4

    glVertexAttribPointer or.. ?

    Hello all
    The last days I've been asked to make a project in OpenGL. I haven't touch OpenGL since 2005. I was looking an OpenGL Engine of mine from the past and I realized that I was passing some vertex data to the VertexBufferObject using glTexCoordPointer() (tangents and bitangents) instead of glVertexAttribPointer(). But I can't remember why! :P
    So.. now I want to use VBO for a mesh with this data structure:
    Code :
    struct VertexTBN
    {
       vector3 pos;
       vector2 texCoord;
       vector3 normal;
       vector3 tangent;
       vector3 bitangent;
    };

    What is better to use for Tagnents and Bitangents? glTexCoordPointer()? or glVertexAttribPointer()?

    I guess for pos, texCoord and normal is best to use glVertexPointer(), glTexCoordPointer(), glNormalPointer() respectively. right?

    If I try to glDrawElements() that VBO without a glsl shader will it work?(skiping the tangent and bitangent ofc). or it will fail?

    Thanks for your time!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: glVertexAttribPointer or.. ?

    You can only use generic attributes (defined through glVertexAttribPointer) if you're using glslang (or ARB_vertex_program). So if you have need of the fixed-function pipeline, you'll need to use glTexCoordPointer.

Posting Permissions

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