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 8 of 8

Thread: glVertexAttribFormat/glDrawArrays issue

Threaded View

  1. #1
    Junior Member Regular Contributor
    Join Date
    Aug 2006
    Posts
    218

    glVertexAttribFormat/glDrawArrays issue

    Hi

    EDIT: Ok, I've fixed the problem, turns out you can't pass 0 as the stride to BindVertexBuffer like you can to VertexAttribPointer you actually have to specify the correct stride, otherwise each element gets uses the 0th attribute in the buffer.

    Can anyone tell me why this would work:
    Code :
    GL20.glEnableVertexAttribArray(0);
    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, buffers[0]);
    GL20.glVertexAttribPointer(0, 4, GL11.GL_FLOAT, false, 0, 0);
    GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, 3);
    But this would fail?:
    Code :
    GL20.glEnableVertexAttribArray(0);
    GL43.glVertexAttribFormat(0, 4, GL11.GL_FLOAT, false, 0);
    GL43.glVertexAttribBinding(0, 0);
    GL43.glBindVertexBuffer(0, buffers[0], 0, 0); //EDIT: Stride can't be 0, it must be the correct value
    GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, 3);
    Thanks & Regards
    elFarto
    Last edited by elFarto; 06-21-2013 at 03:46 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
  •